Environment: Raspberry Pi 3; Raspbian Jessie (update/upgrade) today; coding in NodeJS (Javascript)

I do my development in Windows under Visual Studio 2015. The code works correctly there. The receivers all see the datagrams and Etherdetect (think wireshark) show the traffic as expected. When I move the code to the RPi the traffic never shows up on the LAN, Etherdetect sees nothing, the receivers see nothing. The same nodejs environment is on the windows and RPi systems. The LAN is a single network.

The code looks like:

var message = new Buffer(data); 
var client = dgram.createSocket('udp4'); 
client.send(message, 0, message.length, "", 3639, function () {

Any help greatly appreciated.


I found the problem. It seems on the raspberry pi you need to bind the socket and setBroadcast true. socket.bind(port,function() { socket.setBroadcast(true); socket.send( . . . . .

| improve this answer | |
  • any chance you have a Git repo or anything so we can see the full code? – stevieb Sep 10 '16 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.