Server to GSM Data Transfer

Status
Not open for further replies.

Shashankm123

Junior Member level 1
Joined
Jan 22, 2014
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
109
I am trying to establish a TCP/IP communication for GSM module(SAgem Hilo V2). I am able to send data from device to server but can you suggest me how to send data from server to the module??
 

Please Can you tell me why cant we send data from server to a GSM module??
 

@Shashankm123

Always remember only a CLIENT can initiate the communication not the other way round...

Hence if the module or the modem is in SERVER MODE, and probably your server which you are referring should be actually a CLIENT...

Tell me how you initiated the connection and data transaction done step by step...
 

Hello kgshankar1980,
I have a GSM module Sagem Hilo V2, by making use of the AT commands I am able to establish the TCP/IP connection wherein I am able to tranfer the data from the Microcontroller to the server with the help of GSM module. Now as it is using TCP/IP protocol we should be able to send data from the server back to the GSM module, I tried a lot but not able to find hoe to send the data back to the client.
 

@Shashankm123

Pls send me the AT commands which you used for the data transfer...i meant the AT commands list...starting from intialization to tcp ip data transfer..

Then will find where it is going wrong?
 

Code:
send_AT_command("AT&K3","OK",5);                            //hardware control activation
send_AT_command("AT+KCNXCFG=0,\"GPRS\",\"airtelgprs.com\"","OK",2);    //set gprs parameters //For BSNL - bsnlnet, AIRTEL - airtelgprs.com
send_AT_command("AT+KCNXTIMER=0,60,2,70","OK",5);         //set timers
send_AT_command("AT+CGATT=1","OK",5);                     //attach to network
send_AT_command("AT+KCNXPROFILE=0","OK",5);
send_AT_command("AT+KTCPCFG=0,0,\"203.200.35.69\",21001","OK",5);  
send_TCP_command(len,"CONNECT",60);            //To establish connection

I am able to register to the network and send data to the server (server IP is 203.200.35.69) but as it is TCP/IP how to send data from server back to the microcontroller
 
Last edited by a moderator:

Everytime GSM Module connect to the internet it acquires different IP, so it is a bit hard for GSM Module to act as TCP
Server. The GSM Module could initate the connection first. Send some data. Then without closing connection, let server send some data to the GSM Module. You could use some timeout period for that. I'm not sure the AT command for hilo. But for SIMCOM, after tcp connect, you could receive data instantly without using another AT command.
 

Please Can you tell me why cant we send data from server to a GSM module??
You can send data, but only if the connection is established from the mobile equipment to the server. The mobile internet provider doesn't route ingoing connections to the mobile device. He can't due to lack of IP adresses. The IP address assigned to your mobile device is shared between multiple devices, involving port translation in the internet router of the GSM base station.

Mobile providers offer internet access with public IP addresses at extra costs.

Mobile originated connections, as previously suggested, are the easier way.
 

@kgshankar,@nsypid,@FvM,
I am able to acquire the IP address of the sim card through the AT command and I am passing the same onto the server with the data,
but when i try sending some data from the server to the IP which i got, I am not able to do so... Plzz can u suggest is this method viable?? (For server side I am using java programming).

- - - Updated - - -

@kgshankar,@nsypid,@FvM,
I am able to acquire the IP address of the sim card through the AT command and I am passing the same onto the server with the data,
but when i try sending some data from the server to the IP which i got, I am not able to do so... Plzz can u suggest is this method viable?? (For server side I am using java programming).
 

but when i try sending some data from the server to the IP which i got, I am not able to do so...
I presume, by sending "from the server to the IP" you mean establish an IP connection from the server to the mobile device. This probably won't work for the reasons I explained previously.

You can establish a mobile originated connection to the server and the send data from the server to the mobile device using this connection.
 

@FvM,
Ok...according to you the GSM module through which I am able to send the data to the server by using AT commands, same way the GSM module
with the help of AT commands should fetch the data from the server periodically??
 

I was able to get back the data from the server and I am displaying on the console in IAR embedded workbench, please can u suggest in which registers the received value is stored and how to access it??
 

Did you receive data from server via AT Command ? Isn't the location of the received value depends on the device drivers of the uart/usb ? what do you mean by registers ?
 

The modem will be always connected to UART/USB of your micro...Most of the cases it will be UART for easy debugging purpose...So all the data received will be in the UART receive registers only..
 

Can anyone suggest me how to send data via microcontroller to web server, so that in web server i can fetch the value using php
Plzz suggest
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…