troubleshooting libartnet

52 views
Skip to first unread message

ebkgne

unread,
Sep 16, 2021, 6:20:21 PM9/16/21
to open-lighting
Hi there,  and firstly, thanks for the lib !

So 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 (i believe) , I can't succesfully manage destination universe.

using ARTNET_SRV and artnet_send_dmx() , in wireshark I receive a packet on universe 0 when subnet is 0 and 16 with subnet 1, but changing address doesn't change a thing ...

using  ARNET_RAW and artnet_raw_send_dmx(), in wireshark I always receive a packet for universe 3 no matter the subnet

here is my code , I'm running on windows...


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);




wich outputs :

tw1oqyi.d4h' '--dbgExe=C:\msys64\mingw64\bin\gdb.exe' '--interpreter=mi' 
#### INTERFACES FOUND ####
IP: 2.0.0.222
  bcast: 2.255.255.255
  hwaddr: 02:50:f2:85:6a:00
IP: 192.168.43.4
  bcast: 192.168.43.255
  hwaddr: 18:1d:ea:f4:5e:93
#########################
#### NODE CONFIG ####
Node Type: 5
Short Name: Test
Long Name: TEST
Subnet: 0x1
Default Subnet: 0x1
Net Ctl: 0
#####################
Binding to 0.0.0.0 
Binding to 0.0.0.0
sending to 2.255.255.255

Peter Stuge

unread,
Sep 18, 2021, 12:36:57 AM9/18/21
to open-lighting
Hi,

ebkgne wrote:
> after setting up eveything (i believe) , I can't succesfully manage
> destination universe.
>
> using ARTNET_SRV and artnet_send_dmx() , in wireshark I receive a packet on
> universe 0 when subnet is 0 and 16 with subnet 1, but changing address
> doesn't change a thing ...

I've only used libartnet once but here's what I did for setup:

u10 = artnet_new(NULL, 0);
artnet_set_bcast_limit(u10, 0);
artnet_set_port_type(u10, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX);
artnet_set_port_addr(u10, 0, ARTNET_INPUT_PORT, 10);
artnet_start(u10);
artnet_send_poll(u10, NULL, ARTNET_TTM_DEFAULT);

..followed by setting up a timer, which sent out frame data:

uint8_t data10[512];

artnet_read(u10, 0);
artnet_send_dmx(u10, 0, sizeof data10, data10);


My use of INPUT could very well be wrong and your use of OUTPUT right,
making my artnet_send_poll() and artnet_read() calls useless.

I think my use of artnet_new() and especially artnet_set_port_addr() matters.

I repeated the above code for three universes with a difference only
in the universe number in the artnet_set_port_addr() call.


Since it's a C library I'd skip the C++ vector and use a C array,
but that's just my taste.


//Peter
Reply all
Reply to author
Forward
0 new messages