Wiz850io no handle of multicast and no answer to ARP messages?

Status
Not open for further replies.

lorenzofattori

Well-known member
I'm currently testing some Artnet input for teensy using my teensy 3.6 with Wiz850io.
Software is the one in the examples of the artnet library: ArtnetReceive with some basic changes to make it work for me

Code:
/*
This is a basic example that will print out the header and the content of an ArtDmx packet.
This example uses the read() function and the different getter functions to read the data.
This example may be copied under the terms of the MIT license, see the LICENSE file for details
*/

#include <Artnet.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <SPI.h>

Artnet artnet;

// Change ip and mac address for your setup
byte ip[] = {2, 0, 0, 2};
byte mac[] = {0x04, 0xE9, 0xE5, 0x00, 0x69, 0xEC};

void setup()
{
  pinMode(10, OUTPUT);   // Ethernet
  SPI.setSCK(14);
  digitalWrite(10, LOW); // Ethernet Enabled
  Serial.begin(115200);
  artnet.begin(mac, ip);

  Serial.println("ready");
}

void loop()
{ 
  if (artnet.read() == ART_DMX)
  {
    // print out our data
    Serial.print("universe number = ");
    Serial.print(artnet.getUniverse());
    Serial.print("\tdata length = ");
    Serial.print(artnet.getLength());
    Serial.print("\tsequence n0. = ");
    Serial.println(artnet.getSequence());
    Serial.print("DMX data: ");
    for (int i = 0 ; i < artnet.getLength() ; i++)
    {
      Serial.print(artnet.getDmxFrame()[i]);
      Serial.print("  ");
    }
    Serial.println();
    Serial.println();
  }
}

I'm experiencing two things which I would like some opinions. I observed this behavior using wireshark

- Wiz850io is not handling multicast messages
My lighting software is configure to output 1 Artnet universe as broadcast (unfortunately common standard for Artnet) and is sending out artnet messages to 2.255.255.255. The software is not displaying received message via serial port.
If I set my lighting software to output unicast messages to my teensy, then teensy shows received messages over serial.

Is there any limitation of incoming multicast / broadcast messages with the W5500 chip or is something in the Artnet library?
Personally I prefer like this because I want to filter out artnet if my teensy is used in big stages with lots of universes used and this can be a easy way to achieve it, but I would like to know if this is the case and why.

- Wiz850io is not answering to ARP messages

I connect my devices via ethernet, I turn on the software outputting artnet unicast, I turn on teeny.
Everything is working fine and I'm getting my artnet data into the serial.
Now I disconnect the ethernet cable and then reconnect it.
Now my lighting software is sending out ARP looking for teensy (who has 2.0.0.2?)
No reply at all from teensy / wiz850io.
if I reboot teensy then is starting to work properly.

Do I need to do something in my code to handle this kind of situations? is because I'm using a fixed IP and is configuring ethernet only at startup?
this is a quite important bug and I hope is something wrong in the example code because I need to have it work.

I'm using teensy 3.6 @ 180Mhz with Arduino 1.8.3 and Teensyduino 1.37
Thank you for your time
Lorenzo
 
Last edited:
I'm pretty sure you need Udp.beginMulti() to work with multicast. You'll probably need to edit the Artnet lib.

On the ARP issue, is there some why to reproduce the problem without special lighting control software? Maybe something I could run here on my Linux desktop machine?
 
I'm pretty sure you need Udp.beginMulti() to work with multicast. You'll probably need to edit the Artnet lib.

On the ARP issue, is there some why to reproduce the problem without special lighting control software? Maybe something I could run here on my Linux desktop machine?

Good to know, thanks, I will give it a try but I think I will keep with the standard begin for now because I want to filter out too many broadcasts.
About free artnet software for linux I don't know, my lighting software is available for linux but needs a bit of configuration.
Maybe with OLA (https://www.openlighting.org/ola/) is possible to send dmx but I never used it.

For windows and mac you should find plendy of them, like the official DMX workshop (http://www.artisticlicence.com/index.php?mode=products&sub=overview&product_id=351)
 
Ok, looks like the problem is not only related to artnet but is something wrong in the ethernet or udp communication stack.
For this test I didn't use artnet but standard UDP messages

I loaded in teensy the UDPSendReceiveString esample:
Code:
/*
 UDPSendReceiveString:
 This sketch receives UDP message strings, prints them to the serial port
 and sends an "acknowledge" string back to the sender

 A Processing sketch is included at the end of file that can be used to send
 and received messages for testing with a computer.

 created 21 Aug 2010
 by Michael Margolis

 This code is in the public domain.
 */


#include <SPI.h>         // needed for Arduino versions later than 0018
#include <Ethernet.h>
#include <EthernetUdp.h>         // UDP library from: bjoern@cs.stanford.edu 12/30/2008


// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(2, 0, 0, 2);

unsigned int localPort = 8888;      // local port to listen on

// buffers for receiving and sending data
char packetBuffer[UDP_TX_PACKET_MAX_SIZE];  // buffer to hold incoming packet,
char ReplyBuffer[] = "acknowledged";        // a string to send back

// An EthernetUDP instance to let us send and receive packets over UDP
EthernetUDP Udp;

void setup() {
  // start the Ethernet and UDP:

//  pinMode(10, OUTPUT);   // Ethernet
  SPI.setSCK(14);
//  digitalWrite(10, LOW); // Ethernet Enabled  
  Ethernet.begin(mac, ip);
  Udp.begin(localPort);

  Serial.begin(9600);
}

void loop() {
  // if there's data available, read a packet
  int packetSize = Udp.parsePacket();
  if (packetSize) {
    Serial.print("Received packet of size ");
    Serial.println(packetSize);
    Serial.print("From ");
    IPAddress remote = Udp.remoteIP();
    for (int i=0; i < 4; i++) {
      Serial.print(remote[i], DEC);
      if (i < 3) {
        Serial.print(".");
      }
    }
    Serial.print(", port ");
    Serial.println(Udp.remotePort());

    // read the packet into packetBufffer
    Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
    Serial.println("Contents:");
    Serial.println(packetBuffer);

    // send a reply to the IP address and port that sent us the packet we received
    Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
    Udp.write(ReplyBuffer);
    Udp.endPacket();
  }
  delay(10);
}


On my windows PC i loaded PacketSender (free and also available for linux) and configured to send a UDP message.
packetsender.png

Windows PC is connected to Teensy directly with a ethernet cable, no switches in between.
Opened wireshark on the windows PC, I press send and I get the ARP response and ARP reply from teensy
then I disconnect the ethernet cable, wait some time and reconnect.

Now the ARP message gets no response
wireshark.jpg

Teensy is 2.0.0.2, Windows PC is 2.0.0.20

I saw that if you unplug and replug immediately is usually working, you need to wait a while for the issue to appear



Edit: actually the initialization of Ethernet was wrong (not specified subnet), but even with complete Ethernet Begin and also with 192.168.0.x the problem is the same
 
Last edited:
Status
Not open for further replies.
Back
Top