Multiple ArtNet Universes with ofxArtnet

I’m trying to use the ofxArtnet addon, from hiroyuki, to send data to 6-10 universes via Artnet. This is going into a Enttec Pixelator that is then going out to WS2812 based LED tape. I’ve been able to successfully send values to DMX universe 0, however haven’t been able to send out to any universe beyond that or to too universes simultaneously. It feels like it’s a really simple thing, but I’m baffled at the moment. Has anyone tried sending multiple universes over ArtNet with the ofxArtnet addon?

Here’s the code at the moment.

ofApp.h below:

#pragma once

#include "ofMain.h"
#include "ofxArtnet.h"

class ofApp : public ofBaseApp{

	public:
		void setup();
		void update();
		void draw();

		void keyPressed(int key);
		void keyReleased(int key);
		void mouseMoved(int x, int y );
		void mouseDragged(int x, int y, int button);
		void mousePressed(int x, int y, int button);
		void mouseReleased(int x, int y, int button);
		void windowResized(int w, int h);
		void dragEvent(ofDragInfo dragInfo);
		void gotMessage(ofMessage msg);
    
    ofxArtnet anNode;   //artNet Node ?
    ofxArtnet anNode2; //artNet Node Universe 2
    
    unsigned char dmxData[512]; //unsigned char array to store sending vals
    
    ofColor color;  //color
		
};

ofApp.cpp below:

#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){
    
    ofSetWindowShape(800, 800);
    ofSetFrameRate(60);
    ofSetBackgroundAuto(true);
    ofBackground(0, 0, 0);      //set background color
    
    color.set(0, 0, 0);    //init color
    
    anNode.setup("192.168.1.37", 0x02, 1);  //node IP addy (machine app is running on) and the subnet/universe
    //anNode2.setup("192.168.1.37", 0x02, 1);  //universe 2
    
    for(int i = 0; i < 512; i++){       //init the unsigned char array for dmxdata
        dmxData[i] = 0;
    }
    
    //dmxData[0] = 255;   //set dmx channel 1 to value 255
    //dmxData[1] = 255;
    //dmxData[2] = 255;
    
    
}

//--------------------------------------------------------------
void ofApp::update(){
    
    float r = ofMap(ofGetMouseX(), 0, ofGetWidth(), 0, 255);
    float g = ofMap(ofGetMouseY(), 0, ofGetWidth(), 0, 255);
    float b = 100;
    
    color.set(r,g,b);
    
    for(int i = 0; i < 512; i+=3){           //fill with dmx message with data
        dmxData[i] = r;
        dmxData[i+1] = g;
        dmxData[i+2] = b;
        
        //dmxData[i] = ofRandom(0,256); //random data population
    }
    
    //WRITE OUT TO ARTNET
    anNode.sendDmx("192.168.1.11", dmxData, 512);    //send the 512 values in dmxData over artnet to pixelator
    //anNode2.sendDmx("192.168.1.11", dmxData, 512);    //send the 512 values in dmxData over artnet to pixelator uni2
}

//--------------------------------------------------------------
void ofApp::draw(){
    
}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){
    anNode.sendDmx("192.168.1.11", dmxData, 512);    //send the 512 values in dmxData over artnet to pixelator
    //anNode.sendDmx("10.0.1.18", dmxData, 512);    //send the 512 values in dmxData over artnet to pixelator
    cout<<"DMX Message Sent"<<endl;
    cout<<""<<endl;
}

//--------------------------------------------------------------
void ofApp::keyReleased(int key){

}

//--------------------------------------------------------------
void ofApp::mouseMoved(int x, int y ){

}

//--------------------------------------------------------------
void ofApp::mouseDragged(int x, int y, int button){

}

//--------------------------------------------------------------
void ofApp::mousePressed(int x, int y, int button){

}

//--------------------------------------------------------------
void ofApp::mouseReleased(int x, int y, int button){

}

//--------------------------------------------------------------
void ofApp::windowResized(int w, int h){

}

//--------------------------------------------------------------
void ofApp::gotMessage(ofMessage msg){

}

//--------------------------------------------------------------
void ofApp::dragEvent(ofDragInfo dragInfo){ 

}

HI!
you not explain well .
if your device has two universes , the code would be something like this:

    ofxArtnet node;
    unsigned char uni1[512];
    unsigned char uni2[512];

//--------------------------------------------------------------
void ofApp::setup(){
    ofSetLogLevel(OF_LOG_VERBOSE);
    ofSetFrameRate(25);
    
    node.setup("2.0.0.1");
    
    for(int i = 0; i<512; i++) {
        uni1[i] = 0;
        uni2[i] = 0;
    }
}

//--------------------------------------------------------------
void ofApp::update(){

//operations with 'uni1' y 'uni2' ...........................................
 
   node.sendDmx("2.0.0.10",0,0, uni1, 512);
   node.sendDmx("2.0.0.10",0,1, uni2, 512);
}

Got this fixed, but hadn’t had a chance to post. We found that in the addon it was defaulted to broadcast to all universes. We ended up disabling that and going in and using the raw dmx write functions available to send unicast messages to specified universes.

I had the same issue and I found a workaround. I posted it as an issue on the addon’s github.
Posting it here in case it helps someone in the future:
https://github.com/hiroyuki/ofxArtnet/issues/15

Hopefully hiroyuki will take it into account and implement a solution soon.

according to my test, ofxArtnet works great with one artnet device. but now i’m using 4 artnet devices, each with a different ip. so in setup() i use:
artnet.setup(myPCip");
in update() i use:
artnet.sendDmx("device1ip", dataArray1, 512);
artnet.sendDmx("device2ip", dataArray2, 512);
artnet.sendDmx("device3ip", dataArray3, 512);
artnet.sendDmx("device4ip", dataArray4, 512);

but it does not work correctly. does anybody have experience working with multiple artnet devices?

Check if you are using latest version, hiroyuki addressed an issue that prevented using correctly multiple devices