Also, if you wait longer than 60 seconds to reply, the port route may timeout on the cellular network.
@LucaMora A good test here is to use a simple listener script on the server. If you send from the electron to that server's known IP and open port, it should be received just fine as long as the server does not have something blocking a range of ports.
A nice end to end test which you can be sure to have control over is to find the public IP address for your home internet connection. Log into your WAP and add a route under port forwarding for your local computer's internal IP and PORT range you want open. The electron will definitely be able to hit that IP:PORT as long as you have set it up correctly. Repeat with your server.
###Here's a nice packaged up version of this in a test app I wrote for debugging UDP on the Electron.
IPAddress serverIPaddress( 0,0,0,0 ); // IMPORTANT SET THIS!!!
###Sample output from shorting B0 to GND on electron, and typing messages in terminal to send back:
$ node udp.js 5000
Remote Port (arg 2) not specified, using default: 0
Remote Address (arg 3) not specified, using default: 0.0.0.0
Initialized using remote IP:PORT: 0.0.0.0:0
Listening for UDP packets on 0.0.0.0:5000 ...
received [172.56.20.163:55854(21)] hello from electron 2
received [172.56.20.163:55854(21)] hello from electron 3
received [172.56.20.163:55854(21)] hello from electron 4
hello from server 1
sent [172.56.20.163:55854(19)] hello from server 1
hello from server 2
sent [172.56.20.163:55854(19)] hello from server 2
###Logs from electron:
socketSendTo(0,myhomeipaddress,5000,,21)
32.212 AT send 35 "AT+USOST=0,\"myhomeipaddress\",5000,21\r\n"
32.488 AT read > 3 "\r\n@"
32.538 AT send 21 "hello from electron 2"
32.578 AT read + 16 "\r\n+USOST: 0,21\r\n"
32.588 AT read OK 6 "\r\nOK\r\n"
0000032589 [app] udp-test-app.cpp:52, callHomeUDP1(): INFO: UDP 1 HELLO SENT
0000033623 [app] udp-test-app.cpp:47, callHomeUDP1(): INFO: UDP 1 HELLO SENDING
socketSendTo(0,myhomeipaddress,5000,,21)
33.627 AT send 35 "AT+USOST=0,\"myhomeipaddress\",5000,21\r\n"
33.683 AT read > 3 "\r\n@"
33.733 AT send 21 "hello from electron 3"
33.773 AT read + 16 "\r\n+USOST: 0,21\r\n"
33.783 AT read OK 6 "\r\nOK\r\n"
0000033784 [app] udp-test-app.cpp:52, callHomeUDP1(): INFO: UDP 1 HELLO SENT
0000034818 [app] udp-test-app.cpp:47, callHomeUDP1(): INFO: UDP 1 HELLO SENDING
socketSendTo(0,myhomeipaddress,5000,,21)
34.822 AT send 35 "AT+USOST=0,\"myhomeipaddress\",5000,21\r\n"
34.868 AT read > 3 "\r\n@"
34.918 AT send 21 "hello from electron 4"
34.958 AT read + 16 "\r\n+USOST: 0,21\r\n"
34.968 AT read OK 6 "\r\nOK\r\n"
0000034969 [app] udp-test-app.cpp:52, callHomeUDP1(): INFO: UDP 1 HELLO SENT
48.752 AT read + 17 "\r\n+UUSORD: 0,19\r\n"
Socket 0: handle 0 has 19 bytes pending
48.764 AT send 16 "AT+USORF=0,512\r\n"
48.804 AT read + 56 "\r\n+USORF: 0,\"myhomeipaddress\",5000,19,\"hello from server 1\""
48.816 AT read UNK 2 "\r\n"
48.826 AT read OK 6 "\r\nOK\r\n"
0000048827 [app] udp-test-app.cpp:75, checkUDP1(): INFO: UDP 1 MESSAGE FROM myhomeipaddress:5000 "hello from server 1"
55.354 AT read + 17 "\r\n+UUSORD: 0,19\r\n"
Socket 0: handle 0 has 19 bytes pending
55.376 AT send 16 "AT+USORF=0,512\r\n"
55.416 AT read + 56 "\r\n+USORF: 0,\"myhomeipaddress\",5000,19,\"hello from server 2\""
55.428 AT read UNK 2 "\r\n"
55.438 AT read OK 6 "\r\nOK\r\n"
0000055439 [app] udp-test-app.cpp:75, checkUDP1(): INFO: UDP 1 MESSAGE FROM myhomeipaddress:5000 "hello from server 2"