I’m trying to send a UDP message to a nodejs server that I wrote. I am not expecting the server to send a reply back.
This is working on my Photon but not my Electron.
Top of my .ino:
UDP Udp;
IPAddress remoteIP(54, 149, 36, 255);
int port = 9000;
and inside my loop:
String udpString = String::format("B%.1f", fuel.getSoC());
int str_len = udpString.length() + 1;
char buffer[str_len];
udpString.toCharArray(buffer, str_len);
if (Udp.sendPacket(buffer, sizeof(buffer), remoteIP, port) < 0) {
Particle.publish("Error");
}
My electron is publishing “Error”.
Any ideas? The IP address / port is public & open to the world (go ahead and try it :)). My Photon can publish to it no problem.