hiroyuki / ofxartnet Goto Github PK
View Code? Open in Web Editor NEWultra simple artnet addon for openFrameworks
License: MIT License
ultra simple artnet addon for openFrameworks
License: MIT License
I'm trying to use DMX out 1 or 2 (universes) but no success to date. only DMX 0 is working
is this the right command? thanks
anNode.setup("192.168.0.12", 1);
Currently this library only seems to support unicast. It should support broadcast.
At the moment if I send more data ( > 170 Pixels ) the data get truncated instead of sending multiple messages.
It would be great to create a Map or Vector of ofxArtnet.
I'm working in a project using three different controllers at the same time with total of 12 universes.
Thank you!
Sorry for the question, since I'm starting with OF, but is this addon runs on RaspberryPi ? Thank you.
I had an issue when trying to address a second universe with the method:
int sendDmx( string targetIp, int targetSubnet, int targetUniverse, const unsigned char* data512, int size );
The same values were getting sent to all universes.
I did some investigation and noticed that line 113 of ofxArtnet.cpp was never called.
That's because status
never changes to NODES_FOUND
.
nodes_found
is always 0.
There is nothing in the code that changes nodes_found
to 1 even when nodes were found.
I managed to get it working in the end, but with a hack.
Here's what I modified:
case NODES_FINDING:
while (ofGetElapsedTimeMillis() - find_timeout < _TIMEOUT) {
/* // commented this block out
FD_ZERO(&rset);
FD_SET(sd, &rset);
tv.tv_usec = 0;
tv.tv_sec = _TIMEOUT / 1000.f;
maxsd = sd;
switch (select(maxsd+1, &rset, NULL, NULL, &tv)) {
case 0:
// timeout
break;
case -1:
printf("select error\n");
break;
default:
artnet_read(node,0);
break;
}
*/
artnet_read(node, 0); // added this line
nodes_found = 1; // added this line
}
if ( nodes_found > 0) status = NODES_FOUND;
else status = NOT_READY;
stopThread();
break;
I assume the class is missing a nodes_found = 1;
inside the default
of that switch/case, next to artnet_read(node, 0);
But even that doesn't work on its own, because that select()
fires again and resets nodes_found
to 0. I am not sure what that select()
is doing, I just know that commenting it out worked for me.
I'm not submitting this as a pull request because I believe I'm missing something here. I hope this helps leading you to a more elegant fix.
As of now there is no way of checking if Sender/Receiver is actually connected to the udp endpoint. This makes it impossible to check if one is actually connected before sending data.
An application receiving ofxArtnet will consume 100% of a CPU core just waiting for the data (on a Mac M1, it means about 200000 loops per seconds of the threadedFunction()
. In ofxArtnetReceiver::setup()
changing settings.blocking
to false
drops the % to ~5%.
I don't mind preparing a pull request but I don't know what the default should be (I personally don't see a latency issue with blocking enabled so I use that) but either change the default and/or add a method or setup parameter to specify blocking?
Artnet Receive doesn't output the correct universe number.
I am trying to receive 4 universes, however when I go m.getUniverse(); - the universe number is always 0 even if I send from a different universe.
Hi,
Thanks a lot for this addon.
Can you provide a way to change subnet / universe ?
Is it easy to change or there are some code missing ?
thanks a lot
Correct me if I'm wrong but right now if I allocate a message with a number of bytes, ex: 512, and try to setData with the same number of bytes it actually returns a warning and does nothing, so I have to allocate the message with the size 513 to be able to copy.
maybe the <= in this line should be only a less than
if (getSize() <= index) {
Cheers
Dimitre
when i build it on RPi
I have
../../../addons/ofxArtnet/libs/artnet/src/network.c:48:28: fatal error: net/if_types.h: No such file or directory compilation terminated. distcc[12541] ERROR: compile ../../../addons/ofxArtnet/libs/artnet/src/network.c on localhost failed make[1]: *** [../../../addons/obj/linuxarmv6l/Release/ofxArtnet/libs/artnet/src/network.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Release] Error 2
may i ask what is networks.c work for
and
Any hints to make ofxArtnet support on raspberrypi?
or
What's the difference between official libartnet and ofxArtnet's libartnet
thanks
If I accidentaly disconnect some of the ethernets from the hub and re-plug it the data stops flowing to it.
I'm trying to run setup again but the ip address is already used.
Is there a way of "clear" or release the ip to re-run setup?
It would be a nice update
Thanks.
It would be great if setup() could return a bool depending on whether the setup worked or not.
This is useful for knowing whether the DMX connection was successful or not.
it works quite well on window7. however, on windows 10, it just cannot find other dmx devices. any other people have the same problem?
Very low priority, but your Art-Net logo link in the readme file is broken. Maybe something from the official Art-Net site might be more stable?
I tried building the example project under VS 2012 and unfortunately it completely fails. After updating all the project paths in the config file, the first error I'm getting is that it doesn't understand the __attribute__((packed))
syntax. After simply removing that, the next compile error comes up, etc.
Do you have a suggestion how to run it with VS 2012? Do I maybe need to follow libartnet's compilation instructions to build a .lib or .dll first (using MINGW)?
Thanks!
Not sure if it is a version problem. I was using it successfully last year but now nothing compiles, not even an empty project (fresh from the ProjectGenerator) with only ofxArtnet.
I am on MacOSX and using current master branch from OF. Compiling with 'make' but XCode also does not work.
Here is the output:
In file included from /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/src/ofxArtnet.cpp:8: In file included from /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/src/ofxArtnet.h:12: /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:172:14: error: use of undeclared identifier 'ARTNET_IP_SIZE'; did you mean 'ARTNET_PC_NONE'? uint8_t ip[ARTNET_IP_SIZE]; /**< The IP address, Network byte ordered*/ ^~~~~~~~~~~~~~ ARTNET_PC_NONE /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:64:3: note: 'ARTNET_PC_NONE' declared here ARTNET_PC_NONE = 0x00, ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:178:19: error: use of undeclared identifier 'ARTNET_ESTA_SIZE' uint8_t etsaman[ARTNET_ESTA_SIZE]; /**< The ESTA Manufacturer code */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:179:21: error: use of undeclared identifier 'ARTNET_SHORT_NAME_LENGTH' uint8_t shortname[ARTNET_SHORT_NAME_LENGTH]; /**< The short node name */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:180:20: error: use of undeclared identifier 'ARTNET_LONG_NAME_LENGTH' uint8_t longname[ARTNET_LONG_NAME_LENGTH]; /**< The long node name */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:181:22: error: use of undeclared identifier 'ARTNET_REPORT_LENGTH'; did you mean 'ARTNET_PORT_ARTNET'? uint8_t nodereport[ARTNET_REPORT_LENGTH]; /**< The node report */ ^~~~~~~~~~~~~~~~~~~~ ARTNET_PORT_ARTNET /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:95:3: note: 'ARTNET_PORT_ARTNET' declared here ARTNET_PORT_ARTNET = 0x05 /**< Data is ArtNet */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:183:21: error: use of undeclared identifier 'ARTNET_MAX_PORTS'; did you mean 'ARTNET_INPUT_PORT'? uint8_t porttypes[ARTNET_MAX_PORTS]; /**< The type of ports */ ^~~~~~~~~~~~~~~~ ARTNET_INPUT_PORT /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:117:3: note: 'ARTNET_INPUT_PORT' declared here ARTNET_INPUT_PORT = 1, /**< The input port */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:184:21: error: use of undeclared identifier 'ARTNET_MAX_PORTS'; did you mean 'ARTNET_INPUT_PORT'? uint8_t goodinput[ARTNET_MAX_PORTS]; ^~~~~~~~~~~~~~~~ ARTNET_INPUT_PORT /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:117:3: note: 'ARTNET_INPUT_PORT' declared here ARTNET_INPUT_PORT = 1, /**< The input port */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:185:22: error: use of undeclared identifier 'ARTNET_MAX_PORTS'; did you mean 'ARTNET_INPUT_PORT'? uint8_t goodoutput[ARTNET_MAX_PORTS]; ^~~~~~~~~~~~~~~~ ARTNET_INPUT_PORT /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:117:3: note: 'ARTNET_INPUT_PORT' declared here ARTNET_INPUT_PORT = 1, /**< The input port */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:186:16: error: use of undeclared identifier 'ARTNET_MAX_PORTS'; did you mean 'ARTNET_INPUT_PORT'? uint8_t swin[ARTNET_MAX_PORTS]; ^~~~~~~~~~~~~~~~ ARTNET_INPUT_PORT /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:117:3: note: 'ARTNET_INPUT_PORT' declared here ARTNET_INPUT_PORT = 1, /**< The input port */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:187:17: error: use of undeclared identifier 'ARTNET_MAX_PORTS'; did you mean 'ARTNET_INPUT_PORT'? uint8_t swout[ARTNET_MAX_PORTS]; ^~~~~~~~~~~~~~~~ ARTNET_INPUT_PORT /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:117:3: note: 'ARTNET_INPUT_PORT' declared here ARTNET_INPUT_PORT = 1, /**< The input port */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:192:15: error: use of undeclared identifier 'ARTNET_MAC_SIZE'; did you mean 'ARTNET_PC_NONE'? uint8_t mac[ARTNET_MAC_SIZE]; /**< The MAC address of the node */ ^~~~~~~~~~~~~~~ ARTNET_PC_NONE /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:64:3: note: 'ARTNET_PC_NONE' declared here ARTNET_PC_NONE = 0x00, ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:199:19: error: use of undeclared identifier 'ARTNET_SHORT_NAME_LENGTH' char short_name[ARTNET_SHORT_NAME_LENGTH]; ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:200:18: error: use of undeclared identifier 'ARTNET_LONG_NAME_LENGTH' char long_name[ARTNET_LONG_NAME_LENGTH]; ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:202:20: error: use of undeclared identifier 'ARTNET_MAX_PORTS'; did you mean 'ARTNET_INPUT_PORT'? uint8_t in_ports[ARTNET_MAX_PORTS]; ^~~~~~~~~~~~~~~~ ARTNET_INPUT_PORT /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:117:3: note: 'ARTNET_INPUT_PORT' declared here ARTNET_INPUT_PORT = 1, /**< The input port */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:203:21: error: use of undeclared identifier 'ARTNET_MAX_PORTS'; did you mean 'ARTNET_INPUT_PORT'? uint8_t out_ports[ARTNET_MAX_PORTS]; ^~~~~~~~~~~~~~~~ ARTNET_INPUT_PORT /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:117:3: note: 'ARTNET_INPUT_PORT' declared here ARTNET_INPUT_PORT = 1, /**< The input port */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:275:18: error: use of undeclared identifier 'ARTNET_MAX_PORTS'; did you mean 'ARTNET_INPUT_PORT'? uint8_t inAddr[ARTNET_MAX_PORTS], ^~~~~~~~~~~~~~~~ ARTNET_INPUT_PORT /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:117:3: note: 'ARTNET_INPUT_PORT' declared here ARTNET_INPUT_PORT = 1, /**< The input port */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:276:19: error: use of undeclared identifier 'ARTNET_MAX_PORTS'; did you mean 'ARTNET_INPUT_PORT'? uint8_t outAddr[ARTNET_MAX_PORTS], ^~~~~~~~~~~~~~~~ ARTNET_INPUT_PORT /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:117:3: note: 'ARTNET_INPUT_PORT' declared here ARTNET_INPUT_PORT = 1, /**< The input port */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:281:20: error: use of undeclared identifier 'ARTNET_MAX_PORTS'; did you mean 'ARTNET_INPUT_PORT'? uint8_t settings[ARTNET_MAX_PORTS]); ^~~~~~~~~~~~~~~~ ARTNET_INPUT_PORT /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:117:3: note: 'ARTNET_INPUT_PORT' declared here ARTNET_INPUT_PORT = 1, /**< The input port */ ^ /Users/davidjonas/Documents/Freelance/openFrameworks/addons/ofxArtnet/libs/artnet/include/artnet.h:305:15: error: use of undeclared identifier 'ARTNET_RDM_UID_WIDTH' uint8_t uid[ARTNET_RDM_UID_WIDTH]); ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated.
When I run the example example_send
in this repository the frame rate of art-net messages is much lower than the OF framerate.
It is so slow I am wondering if I'm doing something wrong. Setting ofSetFrameRate(1);
does not help and the example still drops frames. You can see it more clearly when you add these lines:
ofSetColor(255,0,0);
ofDrawRectangle(ofGetFrameNum() % (int)sendData.getWidth(), 0, 1, 1);
Hi hiroyuki
I'm working on a project where I need to receive, (do some stuff) and then send ArtNet from/to multiple universes.
Sending to multiple universes no problem... that functionality is in the addon... but receiving from multiple universes doesn't quite work as I need...
Receiving ArtNet from different single universes works OK... though getUniverse() always returns 0 irrespective of the source universe no.
Receiving ArtNet from multiple universes also kinda works... but only seems to process data from a single universe i.e. getUniverse() always returns 0 and getSize() only returns the active channels from a single universe.
Any thoughts appreciated.
Best
Lewis
Hello,
Using 0.84, OSX 10.10 and also 10.9. I am having trouble with sockets getting stuck. First time running an application (the example as well as my app), I can open the connection to the artnet device, but once i close that app and re-run, i get the node not found
error. When i put the setup function in a while loop: while(artnet.nodes_found == 0) artnet.setup(localIP.c_str());
i get the response Failed to start: Failed to bind to socket Address already in use
. I'm not sure where that error is coming from, as i can't find it in the xcode project. any help is much appreciated!
Seems like ofApp.h and ofApp.cpp aren't included in the /example/src/ directory.
Hello, first of all thanks for the great addon.
I've just noticed the complete rewrite. it would be great to accept other than ofPixels data too
Thank you
Hello Hiroyuki, I've noticed the recent rewrite and was wondering which was the correct usage for sending data to different universes.
As the universe is set in setup and protected I suppose I have to use a vector of ofxArtnetSender objects to send to multiple universes. Or maybe it is just some functionality missing and about to be implemented.
Feel free to close this issue. Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.