GithubHelp home page GithubHelp logo

openlightingproject / libartnet Goto Github PK

View Code? Open in Web Editor NEW
123.0 31.0 56.0 161 KB

An Open Source implementation of the ArtNet protocol

Home Page: https://www.openlighting.org/libartnet-main/

License: GNU Lesser General Public License v2.1

C 97.95% Makefile 0.55% M4 1.50%
artnet dmx

libartnet's Introduction

Libartnet is an implementation of the ArtNet protocol. ArtNet allows the
transmission of DMX and related data over IP networks.

For installation notes see the INSTALL file. Run autoreconf -fi to create configure scripts.

Building libartnet with mingw-w64:

set up mingw-w64 (and possibly MSYS).

for a 64-bit build: --host=x86_64-w64-mingw32
for a 32-bit build: --host=i686-w64-mingw32

./configure ac_cv_func_malloc_0_nonnull=yes  ac_cv_func_realloc_0_nonnull=yes --host=x86_64-w64-mingw32 --prefix=/some/path/prefix


Building libartnet with MS Visual Studio:

either open msvc\libartnet\libartnet.sln with devenv.exe or use msbuild:

for 64-bit build: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
for 32-bit build: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86

build libartnet:

cd msvc\libartnet

for 64-bit Release build:  msbuild libartnet.sln /t:libartnet /p:Configuration=Release /p:Platform=x64
for 32-bit Release build:  msbuild libartnet.sln /t:libartnet /p:Configuration=Release /p:Platform=x86
for 64-bit Debug build:    msbuild libartnet.sln /t:libartnet /p:Configuration=Debug /p:Platform=x64
for 32-bit Debug build:    msbuild libartnet.sln /t:libartnet /p:Configuration=Debug /p:Platform=x86

libartnet's People

Contributors

bk138 avatar douglasheriot avatar nomis52 avatar sl1200mk2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libartnet's Issues

setsockopt() are after bind()

Hi,
in network.c, setsockopt() are after bind() thus we do not benefit of the option before the bind().
for example if I set:
if (setsockopt(sock,
SOL_SOCKET,
SO_REUSEPORT,
(char_) &true_flag, // char_ for win32
sizeof(int)) == -1) {
artnet_error("Failed to bind to socket %s", artnet_net_last_error());
artnet_net_close(sock);
return ARTNET_ENET;
}
before the call to bind(), I'm able to talk to local node that also use 0.0.0.0:6454

packet rocognition

in artnet_net_recv() this check is make:
if (cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr ||
ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP) {
p->length = 0;
return ARTNET_EOK;
}

this prevent to use a node that is bound on the 0.0.0.0:6454 address:port...
in your opinion what check can be done to avoid returning at this stage....

artnet_new returns empty interface list OSX 10.8/10.9

There seems to be a problem initializing the network interfaces on OS X.

The function artnet_net_init fails to find any interfaces. For now i hardcoded the addresses, which works, but is not a great solution.

Does anyone encounter the samen problem or has a solution?

Random initialization of node unsuccessful

Hello,

I have a little problem with the libartnet on a iPad,

Sometimes, the library cannot initialize the node but it's random, sometimes it's ok, sometimes it's not ok.

            artnet_node artnetNode = artnet_new(ip_addr, 0);

            if (!artnetNode) {
                printf("Error: %s\n", artnet_strerror());
                throw new SenderException(artnet_strerror());
            }

            artnet_set_long_name(artnetNode, "Art-Net AirDMX");
            artnet_set_short_name(artnetNode, "AirDMX");

            // set the upper 4 bits of the universe address
            artnet_set_subnet_addr(artnetNode, subnet_addr);

            // enable port 0
            artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX);

            // bind port 0 to universe 1
            artnet_set_port_addr(artnetNode, 0, ARTNET_OUTPUT_PORT, port_addr);

            artnet_dump_config(artnetNode);

            //artnet_set_handler(artnetNode, ARTNET_RECV_HANDLER, artnetReceiver, NULL);

            if (artnet_start(artnetNode) != 0) {
                printf("Error: %s\n", artnet_strerror());
                throw new SenderException(artnet_strerror());
            }

Thanks

Warn when running "make"

linus@XXXXXXX:~/libartnet-1.1.2$ make
make  all-recursive
make[1]: Verzeichnis „/home/linus/libartnet-1.1.2“ wird betreten
Making all in artnet
make[2]: Verzeichnis „/home/linus/libartnet-1.1.2/artnet“ wird betreten
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT artnet.lo -MD -MP -MF .deps/artnet.Tpo -c -o artnet.lo artnet.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT artnet.lo -MD -MP -MF .deps/artnet.Tpo -c artnet.c  -fPIC -DPIC -o .libs/artnet.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT artnet.lo -MD -MP -MF .deps/artnet.Tpo -c artnet.c -o artnet.o >/dev/null 2>&1
mv -f .deps/artnet.Tpo .deps/artnet.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT misc.lo -MD -MP -MF .deps/misc.Tpo -c -o misc.lo misc.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT misc.lo -MD -MP -MF .deps/misc.Tpo -c misc.c  -fPIC -DPIC -o .libs/misc.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT misc.lo -MD -MP -MF .deps/misc.Tpo -c misc.c -o misc.o >/dev/null 2>&1
mv -f .deps/misc.Tpo .deps/misc.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT network.lo -MD -MP -MF .deps/network.Tpo -c -o network.lo network.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT network.lo -MD -MP -MF .deps/network.Tpo -c network.c  -fPIC -DPIC -o .libs/network.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT network.lo -MD -MP -MF .deps/network.Tpo -c network.c -o network.o >/dev/null 2>&1
mv -f .deps/network.Tpo .deps/network.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT receive.lo -MD -MP -MF .deps/receive.Tpo -c -o receive.lo receive.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT receive.lo -MD -MP -MF .deps/receive.Tpo -c receive.c  -fPIC -DPIC -o .libs/receive.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT receive.lo -MD -MP -MF .deps/receive.Tpo -c receive.c -o receive.o >/dev/null 2>&1
mv -f .deps/receive.Tpo .deps/receive.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT transmit.lo -MD -MP -MF .deps/transmit.Tpo -c -o transmit.lo transmit.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -Wall -Werror -Wformat -W -g -O2 -MT transmit.lo -MD -MP -MF .deps/transmit.Tpo -c transmit.c  -fPIC -DPIC -o .libs/transmit.o
transmit.c: In function 'artnet_tx_tod_data':
transmit.c:166:5: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
     memset(&tod.data.toddata.tod,0x00, ARTNET_MAX_UID_COUNT);
     ^~~~~~
cc1: all warnings being treated as errors
Makefile:395: recipe for target 'transmit.lo' failed
make[2]: *** [transmit.lo] Error 1
make[2]: Verzeichnis „/home/linus/libartnet-1.1.2/artnet“ wird verlassen
Makefile:423: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Verzeichnis „/home/linus/libartnet-1.1.2“ wird verlassen
Makefile:331: recipe for target 'all' failed
make: *** [all] Error 2

Sorry, I just can't fix the problem myself / understand the problem.

There is no configure script.

Hi, not sure if I'm missing something obvious but inside the INSTALL file it says:

Basic Installation

Briefly, the shell commands ./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see theREADME' file for instructions specific to this package.

But I get an error when I run:

$ ./configure
bash: ./configure: No such file or directory

Am I missing something here? I'm trying to create the Debian package so I can install libartnet on my machine. Is this the most up-to-date solution?

can't change address/universe

Hi there, thanks for the lib !

I've tryed replacing homemade solution with libartnet in on one of my project but I'm struggling on something.

I simply try to send some DMX to a universes( subnet+address am I right ?),

after setting up eveything , only the subnet has effect, address doesn't,

as in wireshark I see universe 0 when subnet is 0 and 16 with subnet 1, but changing address doesnt change a thing ...

here is my code , I'm running on windows but I don't see how my config could be responsible .

in advance thanks ;)

` std::vector<uint8_t> data = {127,255};

artnet_node artnet = artnet_new("2.0.0.222", 1);

artnet_set_short_name(artnet, "Test");
artnet_set_long_name(artnet, "TEST");
artnet_set_node_type(artnet, ARTNET_SRV);

artnet_set_subnet_addr(artnet, 0);

artnet_set_port_type(artnet, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX);
artnet_set_port_addr(artnet, 0, ARTNET_OUTPUT_PORT, 1);

artnet_dump_config(artnet);

if (artnet_start(artnet) != 0) std::cout << artnet_strerror() << std::endl;

artnet_send_dmx(artnet, 0, data.size(), &data[0]);

artnet_stop(artnet);
artnet_destroy(artnet);`

FirmwareMaster blockId issue

Hi, this line of code is suspicious:

firm->expected_block %= UINT8_MAX;

It means blockId will never reach 255, but just 254.
I tested the code with a few fixtures and they errored on the 254 -> 0 switch.
Any chance this can be fixed for future versions?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.