Author Topic: UDP based IoT project.  (Read 3440 times)

0 Members and 1 Guest are viewing this topic.

Offline fcbTopic starter

  • Super Contributor
  • ***
  • Posts: 2174
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
UDP based IoT project.
« on: November 01, 2015, 03:04:52 pm »
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).

« Last Edit: November 01, 2015, 03:07:28 pm by fcb »
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16394
  • Country: za
Re: UDP based IoT project.
« Reply #1 on: November 01, 2015, 03:12:36 pm »
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.
 

Offline fcbTopic starter

  • Super Contributor
  • ***
  • Posts: 2174
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: UDP based IoT project.
« Reply #2 on: November 01, 2015, 03:42:07 pm »
SeanB: Thanks a million :-+

I 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.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16394
  • Country: za
Re: UDP based IoT project.
« Reply #3 on: November 01, 2015, 04:06:53 pm »
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 from www.GRC.com and see just what you have opened up doing so.

https://www.grc.com/x/ne.dll?bh0bkyd2

 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4599
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: UDP based IoT project.
« Reply #4 on: November 01, 2015, 04:22:21 pm »
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_NAT

Special plans for IoT devices such as this exist. Where the device gets a public IP, and maybe a special range phone number.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->