DynDNS with Siemens/Cinterion Modems
Posted by blogElectronica in 1.TECNOLOGÍAS (teórico), 2.DISPOSITIVOS (práctico), Comunic. GSM/GPRS, Comunic. GSM/GPRSIf you make applications with GPRS modems, a lot of the time you will encounter the problem that IP addresses, which are assigned by the network operator, are dynamic.
What’s a dynamic IP? It means that every time one of your modems connects to the GPRS network, the operator will give it a different IP address.
For a lot of applications it won’t matter. For example if I have a modem that collects data from a datalogger and the modem sends the data to a central server via GPRS at the end of the day, it doesn’t matter if the modem’s IP address is dynamic. So in this case it’s the modem that makes the connection to the central server (which must have a fixed IP address or a DNS at least).
The problem arrives when we want to work with GPRS modems in server mode i.e. with modems that are permanently connected to GPRS and are listening to a specific TCP port waiting for incoming connections (typical remote maintenance). In this situation you need to know the modem’s IP address. There are various solutions to resolve this problem. I will talk about one of them today – DynDns service.
With DynDns you can assign a specific IP address to a DNS for free. To do this, you just have to open an account ww.dyndns.org.
Let’s look at a concrete example.
I’m not going to give you an example with Java instead we are going to look at it with AT commands. Doing it with Java (from the following) is practically that same as using the ATCommand class.
Imagine that we have created our own account in DynDns.org with the following data:
DNS server: members.dyndns.org
Host: blogelectronica.dyndns.org
Login: mylogin
Password: myPassword
Current IP: 80,100,101,102 (the IP assigned by the operator)
What I want to achieve with the modem is that the blogelectronica.dyndns.org address points to the IP address 80.100.101.102 (which was assigned by my operator at a given time). This means that if do a ping from my PC to blogelectronica.dyndns.org it will have the same response if I do a ping to 80.100.101.102.
Which AT commands are required to make blogelectronica.dyndns.org point to the IP 80.100.101.102?
Well to configure the GPRS connection profile (with Movistar) use the following:
OK
AT^sics=0,inactTO,20
OK
AT^sics=0,user,MOVISTAR
OK
AT^sics=0,passwd,MOVISTAR
OK
AT^sics=0,apn,movistar.es
OK
AT^sics=0,dns1,80.58.0.33
OK
To configure the http service profile use the following (note that for DynDns you need to use basic authentication protocol with login and password, therefore we turn on hcAuth):
OK
AT^siss=0,conID,0
OK
at^siss=0,user,miLogin
OK
at^siss=0,passwd,miPassword
OK
at^siss=0,hcMethod,0
OK
at^siss=0,hcAuth,1
OK
AT^siss=0,address,http://members.dyndns.org/nic/update?hostname=blogelectronica.dyndns.org&myIP=80.100.101.102&
wildcard=NOCHG&mx=NOCHG&backmx=NOCHG
OK
Finally we keep the socket open to initiate the HTTP connection:
OK
^SIS: 0, 0, 2201, “HTTP/1.1 401 Unauthorized”
^SIS: 0, 0, 2200, “HTTP Redirect to:members.dyndns.org:80/nic/update?hostname=blogelectronica.dyndns.org&myIP=80.100.101.102&
wildcard=NOCHG&mx=NOCHG&backmx=NOCHG”
^SIS: 0, 0, 2201, “HTTP/1.1 200 OK”
^SISR: 0, 1
^SISR: 0, 17
good 80.100.101.102
OK
By only doing this, we have associated the DNS blogelectronica.dyndns.org to the IP 80.100.101.102 for free and without having to pay a monthly fee to the operator. If I remember correctly they charge around 12 Euros + VAT for each fixed IP address. This is something that we will later incorporate into MTXTunnel, although possibly we may only do it in the advanced version.
Well, I hope that this post has been interesting for you and useful for your Siemens / Cinterion GPRS modem applications, as you can see you can do everything with them they are marvellous.
Puedes comentar este post en el nuevo Foro (click aquí)
- (10) Posts Tags: cinterion, dynDNS, modem, Siemens
Comments Off