teensy 4.1 / wiz5500 / ethernet library / UDP OSC to broadcast address does not output

fcana

Member
Hi,
a strange thing is happening on transmitting OSC UDP packets to broadcast address (for instance x.x.x.255)

UDP packet are not arriving to pc, and instead is received:
Screenshot 2024-05-17 093633.png


if destination of packets is transformed to a static ip everything goes just fine:

Screenshot 2024-05-17 093435.png


I suspect a bug somewhere, because everything was double checked (no firewall active on connection).
any idea?
here the example code:

C:
#include <Ethernet.h>     //internal teensy 1.59.0 library
#include <EthernetUdp.h>  //internal teensy 1.59.0 library
#include <SPI.h>          //internal teensy 1.59.0 library
#include <OSCBundle.h>    //internal teensy 1.59.0 library
#include <OSCBoards.h>    //internal teensy 1.59.0 library
#include <OSCMessage.h>   //internal teensy 1.59.0 library

const uint8_t mioMAC[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress teensyIP(169, 254, 0, 1);
IPAddress outIP(169, 254, 192, 255);  // WITH 169,254,192,40 WORKS FINE
IPAddress subnet(255, 255, 0, 0);

const int outPORT = 1234;
const int inPORT = 9900;
EthernetUDP udpCanale;

void setup() {
 
  Serial.begin(115200);

  //start UDP
  Ethernet.begin(mioMAC, teensyIP);
  udpCanale.begin(inPORT);
  Ethernet.init(10);
  Ethernet.setSubnetMask(subnet);

}

void loop() {

  send_goal();
  delay(1000);

}

void send_goal() {

  udpCanale.beginPacket(outIP, outPORT);
  OSCMessage msgOUT("/rnbo/inst/0/messages/in/goal1");
  msgOUT.send(udpCanale);
  udpCanale.endPacket();
  msgOUT.empty();

  Serial.println("osc message sent");
}
 
I suspect you’re on a different subnet than the rest of the network. The 169.254.* addresses are the “self-assigned” range. Have you tried DHCP instead?
 
i don't think so... because with 169,254,192,40 works fine. with 255 instead of 40 don't.

anyway, with dhcp works. also with broadcast. problem is that i have no dhcp on my net, and i'd like to use broadcast messages to 169.254.255.255 (with mask 255.255.0.0)...
 
anyway, with dhcp works. also with broadcast. problem is that i have no dhcp on my net, and i'd like to use broadcast messages to 169.254.255.255 (with mask 255.255.0.0)...
Then try using that address? That's the proper broadcast address for that host + subnet mask, the outIP you've used in the posted code is not a broadcast address.
 
Then try using that address? That's the proper broadcast address for that host + subnet mask, the outIP you've used in the posted code is not a broadcast address.
it should be a broadcast... just on subnet 192, on which i was with both teensy and pc.
obv I started working with 169.254.255.255 / 255.255.0.0, and did not work. so for debugging i forced both on 169.254.192.x / 255.255.255.0 and then tried broadcasting on 169.254.192.255. nothing comes out from teensy also with this middle-conf (see wireshark screens above).

I suspect that broadcast address do not work with 169.254.x.x but I can't figure out why. several audio over ethernet protocols work with no dhcp and automatic address without any problem...
 
it should be a broadcast... just on subnet 192, on which i was with both teensy and pc.
That is not the subnet written in your code. It has the subnet mask of 255.255.0.0, so its broadcast address will be X.X.255.255.
The wireshark output looks completely normal for sending to a unicast address.
 
Out of curiosity, you could try a different, non-self assigned range static IP. Eg. 192.168.1.x range.
 
Out of curiosity, you could try a different, non-self assigned range static IP. Eg. 192.168.1.x range.
yes, tried and works: transmitting to 192.168.1.255/255.255.255.0 works just fine.
I have problems just on 169.254.255.255 / 255.255.0.0
 
Back
Top