0

I want to send the foll data (lat/long, date/time, velocity, deviceID) using gprs (tcp/ip connection) from a gps/gsm tracker i made (using sim900A as the gsm/gprs module). I know how to send data to a particular IP and port number on the hardware side. But I want help in the foll:

How to setup a TCP/IP webserver/connection where a specific port/socket can be configured in listening mode, so that the GPRS packets sent by the device to a public IP and port number, can be received by this server. (in other words, backend setup and configuration of tcp/ip webserver)

Thank you for your time.

pSi
  • 3

1 Answers1

1

If you want to save / process these requests, you may have to write your own webserver.

For just viewing the requests that your tracker sends you can setup a simple server using Python

python -m SimpleHTTPServer 8080

Then use https://ngrok.com/ to create a public listener without any port-forwarding hassle.

Download and run the binary. You will get a public hostname (like this http://a1b2c3d4.ngrok.com)

ngrok 8080

Enter whatever hostname you get into your GPS tracker. Port would be 80.

If your tracker can only use IP addresses then you will have to open ports (on your router) to your computer that is running the webserver. Then find out your public ip (type what is my ip in Google) and enter that in your tracker.

Beware that if your ISP assigns IP addresses to you dynamically, this IP will change after a period of time or whenever you restart your router. The ngrok method is free from this problem.

Kedar
  • 569