Home/Support/Support Forum/How to broadcast UDP message to 255.255.255.255
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How to broadcast UDP message to 255.255.255.255

0 votes
I can send a broadcast using 192.168.10.255 port 7001. All receivers pick up the message fine.

But if I try send to 255.255.255.255 (or -1L) port 7001, nothing seems to transmit.

But, the rabbit receives UDP packets addressed to -1L Port 7000 just fine from Window machines on other subnets.

Code snippet:
//

udp_Socket sock;
udp_extopen(&sock,IF_ANY, LOCAL_PORT, -1L, 0, ReceiveHandlerFun, 0,0);

//Doesn't send to anywhere: ** HELP, Why not??? **
udp_sendto(&sock,"helloWorld",sizeof("helloWorld"),-1L,7001)

//Sends ok to local subnet:
udp_sendto(&sock,"helloSubnet",sizeof("helloSubnet"),aton("192.168.10.255"),7001)

//
asked May 11, 2016 in Digi TransPort Cellular by KD6BZN New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

0 votes
Solved:
I had to change the interface from "IF_ANY" to "IF_ETH0".

From:
udp_extopen(&sock,IF_ANY, LOCAL_PORT, -1L, 0, ReceiveHandlerFun, 0,0);

To:
udp_extopen(&sock,IF_ETH0, LOCAL_PORT, -1L, 0, ReceiveHandlerFun, 0,0);

Now it broadcasts UDP messages to -1L or 255.255.255.255.
answered May 11, 2016 by KD6BZN New to the Community (1 point)
...