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.

1 Answer 1

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.

3
  • trying this right now. ngrok is running and I did get the public IP.
    – pSi
    Dec 25, 2014 at 20:22
  • But while using ngrok, can I not get an IP address instead of something like this - a1b2c3d4.ngrok.com. I tried to use the ping command to get the IP, but it returns the same IP as ngrok.com. Any other way to get the IP, without portforwarding ?
    – pSi
    Dec 26, 2014 at 11:07
  • @pSi There are dynamic DNS solutions but those will also give you a hostname. Without port-forwarding you can consider buying a VPS with static IP and using that to log request from the tracker.
    – Kedar
    Dec 26, 2014 at 11:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .