UDP based IoT project. - Page 1
Forum section: electronics / projects

author: fcb
author_rank: Super Contributor
timestamp: November 01, 2015, 03:04:52 pm
content: I'm trying to design a system that uses a GPRS GSM modem to send/receive small amounts of data, I don't have to design the server side of things (someone else will do that), but I do need to be able to do the GSM/firmware and attached hardware.I've settled on using UDP (data intergrity isn't that important) to keep the SIM monthly costs down. I won't be using an Arduino on the production units, but am prototyping the comms on one (with the Quectel M10 based GSM shield).So for my first tests I deceided I would try to get two PC's to send UDP packets to each other.TEST 1:Take two laptops (on my WiFi network at home), find out their IP addresses (192.168.0.11 & 192.168.0.17), download and use "Packet Sender" on each of the PC's to send UDP test messages (port: 55056). This test was successful.TEST 2:Run a little program on one of the laptops (Purebasic, UDP sender found on the purebasic forum) to send UDP to other PC "Packet Sender" (on port 55056). Also successful.TEST 3:Run another little program on one of the laptops (UDP server, again in purebasic) to receive UDP packets from other PC "Packet Sender" (this time on port 12345, as well as other made up port numbers). Successful.So I've established that I can send UDP packets between a couple of PC's sat on my WiFi/Broadband network.TEST 4:Goto "whatismyipaddress" on one PC and establish my IP address. This is XXX.XXX.XXX.XXX.Now use the "packet sender" to send a UDP packet to this address (port 55056, packet sender appears to be jammed to receive UDP on this port) -nothing.TEST 4A:Use my iphone6S as a hotspot for the other PC, establish it's IP address. This is YYY.YYY.YYY.YYY.Now try to use "packet sender" on the second PC to send UDP to the first, and vice versa. Both using port 55056 -nothing again."Packet Sender" appears to have full permission in Windows Firewall. What am I not understanding about networking??? Any ideas how to get this test done (before I move onto the complexity of the GSM connection).

author: SeanB
author_rank: Super Contributor
timestamp: November 01, 2015, 03:12:36 pm
content: Router blocks incoming packets, so they are dropped before they get to the computer. Try using ping to send a request to the phone IP address ( this will change every so often) and try again from the phone, it should work now.Alternatively take the router and put the PC ( temporarily, very much recommended not to do this as permanent) in the DMZ of the router, or assign the PC IP as the forwarding IP. When you put this in a server you simply leave port 55056 open, and make sure that the server listens on that port only, and that the datacentre firewall allows incoming connections on that port.

author: fcb
author_rank: Super Contributor
timestamp: November 01, 2015, 03:42:07 pm
content: SeanB: Thanks a millionI went into my router (via the usual 192.168.0.1, and username/password). Enabled the DMZ Server option and set the IP of the DMZ server to 192.168.0.11 (the PC I was on), then I was able to send a UDP packet from the 2nd PC (the one using my iPhone as the hotspot) to the first PC!!!!I'll update this thread when I next hit a snag, and if I get it running.

author: SeanB
author_rank: Super Contributor
timestamp: November 01, 2015, 04:06:53 pm
content: Don't forget to turn it off when you are done for the day. Placing a Windows PC direct on the internet like this does is not really good at all. try scanning it fromwww.GRC.comand see just what you have opened up doing so.https://www.grc.com/x/ne.dll?bh0bkyd2

author: Jeroen3
author_rank: Super Contributor
timestamp: November 01, 2015, 04:22:21 pm
content: Instead of DMZ, use a single port forward. Much safer.Not that you cannot rely on the GPRS device to have a publicly accessible IP, since providers often use carrier grade NAT.https://en.wikipedia.org/wiki/Carrier-grade_NATSpecial plans for IoT devices such as this exist. Where the device gets a public IP, and maybe a special range phone number.