user411095
user411095

Reputation: 21

tcp/ip sockets on gprs modem

i want to establish a TCP/IP socket connection between a device connected to gprs modem and another device that is also connected to gprs modem.both devices are connected to gprs via sims.now for tcp/ip socket connection how a client can get destination ip address of server in order to establish connection with it that is listening to the incoming connections.i have numbers of both devices since sims are integrated with them that allows us to access the gprs .but for tcp/ip socket we must know the destination ip address.so how can i get the ip address of other clients /servers on the network via their simnumbers to whom we wish to connect .i m using socket programming to establish tcp/ip connection

Upvotes: 2

Views: 4375

Answers (2)

Louis
Louis

Reputation: 1

What I did is, each unit constantly monitors its assigned IP address.

I use the LEON200 GPRS modem from Ublox with TCP/IP, HTTP and FTP stack. Once this IP changes, it creates a HTTP connection to my server, and use the &_POST, the IMEI and new IP address into a php script that updates a lookup table. Whenever any unit needs to connect to another unit, all I need to know is the IMEI number of the unit and then use the same HTTP connection to &_POST a request to a php script that will return the listed IP address.

This way I can connect from device to device. On my carrier, I had to activate an unrestricted APN for the GSM asigned IP addresss is not visable from the internet APN side.

I hope this will help.

Upvotes: 0

Nikolai Fetissov
Nikolai Fetissov

Reputation: 84189

Hmm, you can try one of free dynamic DNS services like dyndns.com - you'd need one end to register it's IP every time it changes with a small program like ddclient - and then use the host name instead of numeric IP for looking up the server.

One caveat though - the devices could actually be within carrier private networks and be given non-routable RFC1918 addresses. In that case you can only connect out.

Upvotes: 1

Related Questions