Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Simcom Sim300 GPRS connection problem

Status
Not open for further replies.

phaedrus

Member level 4
Member level 4
Joined
Feb 20, 2007
Messages
78
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,913
sim300 get request

Hello,
This is discussed in other posts too ,but I am still unable to find the problem.I need to send some data to the server using the SIM300.
I get CONNECT OK where I connect a Socket to the server.After this I bring up a prompt using CIPSEND. So far its fine.

I then send a file which contains:
GET /MYFOLDER/ReceiveEvents.aspx?Area=z123&Sensor=s123&Loc=456 HTTP/1.1
HOST: xx.xxx.xxx.xxx
After this I manually send ^j twice and ^z once.Now I don't get any response from the modem on the terminal.

I have checked the server by using another PC over the internet and it works fine.This was done by typing
**broken link removed**
This works just fine.

When I try this on the modem, after setting the DNS and CDNSORIP=1
GET HTTP/1.1
Host: www.google.com
Connection: Keep-Alive
Accept: */*
Accept-Language: en-us
I get SEND OK and the data from google. So I think it is fine too.

When does the modem return a SEND OK ??

Hope to get some ideas.
 

sim300 tcp

The SIM300 will return a "SEND OK" after it receives the ^Z and the data has been sent. If you lose your connection for any reason, it will not send the data and it will not return the "SEND OK". After you send the data, send a "AT+CIPSTATUS" and see what it returns for the status. If it's not returning "CONNECT OK", then for some reason your server is disconnecting.

If you want you can send me a private message with your server's IP address and I can try to troubleshoot it from here.
 

sim300 gprs data log

Hi GSMMan

Thanks for your generous offer. I have sent you a PM.
For others who will benefit from the thread :
When I send the request ,after ^z the modem does not respond for about 5 mins.During this time the TCP status is Connect OK. After 5 mins or so I get

TCP ERROR: 12
RDY

+CFUN: 1

+CPIN: READY
Is the modem resetting ?
 
at+cipstatus

The "TCP ERROR: 12" indicates that your TCP connection has timed out. This is because there is no TCP activity and therefore the network closes your connection.

When you send to your server do you send the command "CDNSORIP=0" to indicate you are sending to an IP address?

After you send "AT+CIPSEND" are you waiting for the module to return ">" before sending your data?

It would be helpful if you showed each command you send and its response.
 
sim 300 tcp error: 12

Hello GSM Man

I have attached a log of the modem communications.Its a log file generated by the Terminal software.
I am checking the CIPSTATUS over a period of 5 mins or so.

Thanks again!!
 

sim300 tcp error

Hello GSM Man,
i want to ask a question related to SIM300.
i have tried all command sequence from phaedrus' file.

but when i type
at+cipstart="TCP","x.x.x.x","80"
i only got this response
OK

CONNECT


There is no CONNECT OK.
after that, SIM300 seems to hang and after some more minutes, SIM300 send this response:
CLOSED

can you help me this? what's wrong with my SIM300?

Thanks.
 

header sim300

Hen, try the following - in the example below '>>' indicates data you send to the module, while'<<' indicates data returned from the module. First you need to open a PDP context.
Code:
>> AT+CGATT=1   - Attach to GPRS Service 
<< OK 

>> AT+CGDCONT=1,"IP","wap.cingular"   - Define PDP Context (cid, PDP type, APN) 
<< OK 

>> AT+CDNSCFG="208.67.222.222","208.67.220.220" - Configure Domain Name Server (primary DNS, secondary DNS) 
<< OK 

>> AT+CSTT="wap.cingular","wap(at)cingulargprs.com","cingular1" - Start Task & set APN, User ID, and password 
<< OK 

>> AT+CIICR     - Bring up wireless connection with GPRS - THIS MAY TAKE A WHILE 
<< OK 

>> AT+CIFSR      - Get Local IP address 
<< 10.190.245.172   - returns IP address assigned to your module 
<< OK 

>> AT+CIPSTATUS      - Get Connection Status 
<< OK 
<< STATE: IP STATUS   - returns status of connection, needs to be 'IP STATUS' before you can connect to a server

After you have context, you need to make a connection to the server and then send your data.
Code:
>> AT+CIPHEAD=1      - Tells module to add an 'IP Header' to receive data 
<< OK 

>> AT+CDNSORIP=1   - Indicates whether connection request will be IP address (0), or domain name (1) 
<< OK 

>> AT+CIPSTART="TCP","www.google.com","80" - Start up TCP connection (mode, IP address/name, port) 
<< OK 
<< CONNECT OK      - Indicates you've connected to the server - IT MAKE TAKE A WHILE FOR THIS TO BE RETURNED 

>> AT+CIPSEND      - Issue Send Command 
<< >                   - wait for module to return'>' to indicate it's ready to receive data 
>> GET / HTTP/1.1   - Send data - this example is an HTTP request for the default page 
>> Host: [url]www.google.com[/url] 
>> Connection: Keep-Alive 
>> Accept: */* 
>> Accept-Language: en-us 
>> 
<< data from server returned - Server will return data here
 

sim300 start google

Hello GSM Man,
thanks for replying.

i have tried your codes.

here's the result.

Code:
at+cgatt=1

OK

at+cgdcont=1,"IP","indosatgprs"

OK
at+cdnscfg="208.67.222.222","208.67.220.220"

OK
at+cstt="indosatgprs","indosat","indosat"

OK
at+ciicr

OK

at+cifsr

10.168.170.128
at+cipstatus

OK

STATE: IP STATUS
at+ciphead=1

OK
at+cdnsorip=1

OK
at+cipstart="TCP","www.google.com","80"

OK

CONNECT
after some minutes, i got this response
Code:
CLOSED
i got only this response.
i know it should be
Code:
CONNECT OK

and i have tried another SIM300. it's ok. it can send CONNECT OK response.

is there any setting command that can rise this problem?
or is this a hardware issue?

Thank you very much.:D
 

send data back to sim300

Hello GSMMan,HEN

Some queries :
Any idea of why CIPHEAD=1 is needed ? The modem seems to work in GPRS mode even when this is not set explicitly.

Is the DNS server specific to a service provider or is it independant ?

Did any of you face the problem of modem resetting during creation of socket ? viz
Code:
RDY

+CFUN: 1

+CPIN: READY

HEN,could you check if the versions of the 2 modems are same/different ,since 1 is working while other is not.
 

cipmode sim300

hen said:
Code:
at+cipstart="TCP","www.google.com","80"
OK
CONNECT
Hen, "CONNECT" without the "OK" is not a valid response. I suspect you have a hardware problem, although I've never seen a module fail in that way.

phaedrus said:
Some queries :
Any idea of why CIPHEAD=1 is needed ? The modem seems to work in GPRS mode even when this is not set explicitly.
This command adds a "header" to the data returned by ythe server. You don't need to send this command, but the header makes it easier to identify the data string and it indicates the number of bytes in the data packet.

phaedrus said:
Did any of you face the problem of modem resetting during creation of socket ? viz
Code:
RDY 
+CFUN: 1 
+CPIN: READY
This is a classic symptom of a power supply problem. When transmitting the power draw increases substantially. If your power supply cannot deliver the required current, the voltage will drop and the module will reset. The problem is more likely to occur if you are operating at 850 or 900MHz as the power output on these bands is 2W. Also, the power draw is greater in GPRS mode. I've seen designs where the power supply was marginal and the reset problem was intermittent.
 

    phaedrus

    Points: 2
    Helpful Answer Positive Rating
sim300 http get request

Hi GSMMan,

Hen, "CONNECT" without the "OK" is not a valid response. I suspect you have a hardware problem, although I've never seen a module fail in that way.
It may also be that his receiving program is dropping characters,which might happen if he is using a micro controller with less data buffer etc.But since he said that with the other modem he has never faced the problem,maybe this is not the case ? Or it may be a combination of RTS/CTS hardware failure on the defective modem and insufficient buffer size ?

This command adds a "header" to the data returned by ythe server. You don't need to send this command, but the header makes it easier to identify the data string and it indicates the number of bytes in the data packet.
Could you explain further on this ?Maybe a cut paste of some response data would help, which shows the header ?I was getting the same data from the modem for both the cases.

Thanks for your answers !!
 

get sim300

phaedrus said:
Hi GSMMan,
Hen, "CONNECT" without the "OK" is not a valid response. I suspect you have a hardware problem, although I've never seen a module fail in that way.
It may also be that his receiving program is dropping characters,which might happen if he is using a micro controller with less data buffer etc.But since he said that with the other modem he has never faced the problem,maybe this is not the case ? Or it may be a combination of RTS/CTS hardware failure on the defective modem and insufficient buffer size ?
It's hard to troubleshoot that problem from a distance. He doesn't appear to be having problems receiving any other strings, so I wouldn't suspect the buffer size or the handshaking - but it may be. When you make a GPRS connection the power draw also increases significantly, so it may be a power supply issue. I've seen a lot of weird power supply problems. Again, hard to troubleshoot from a distance.

phaedrus said:
This command adds a "header" to the data returned by ythe server. You don't need to send this command, but the header makes it easier to identify the data string and it indicates the number of bytes in the data packet.
Could you explain further on this ?Maybe a cut paste of some response data would help, which shows the header ?I was getting the same data from the modem for both the cases.

If I send a GET to Google.com with "CIPHEAD=1" the following data is returned:
Code:
 SEND OK
+IPD1029:HTTP/1.1 200 OK
Fri, 14 Aug 2009 18:06:14 GMT
Server: Oversee Webserver v1.3.18
Set-Cookie: parkinglot=1; domain=.google.com; path=/; expires=Sat, 15-Aug-2009 18:06:14 GMT
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
.
.
.
href="http://searchportal.information.com?epl=00790085QUdfCQtQAwZWA1NUDEMBXA5rFFIFUEUEEwgTXFdZUAxbWgNVXFhUWw5XDgYWBgleR1U5XgcIBlVZAQU">Click here to go to google.com</a>.</noframes></html>
Note the string"+IPD1029:" at the beginning of the data. "+IPD" indicates the start of data, and "1029"is the number of bytes of data received. This is particularly handy if your module is configured to send unsolicited responses - you can look for the "+IPD"string to identify data returned by the server in response to a request, and know the number of bytes you need to read.
 

    phaedrus

    Points: 2
    Helpful Answer Positive Rating
ciicr gprs reset

Thanks for that.

You have studied these modems in quite some depth !!!
 

i am getting response closed, sim300

Hello GSM Man,
thanks for your help.
i have made the device back to normal.
this is all because
Code:
at+cipmode=1
after i change it with
Code:
at+cipmode=0
the problem is solved.:D
 

at+ciphead , sim300

Hello GSM Man,
i have another problem.
i use a microcontroller to control SIM300.
i want to get the source of a webpage.
when i start to get the data, it seems that i can't control the RTS.
it seems that SIM300 just send all the data.

what can i do to parse the data when i received them?

thank you.:D
 

I am using GSM MODEM based on SIMCOM300 Module which has TCP stack. I am using SIM of

Airtel. I have given APN=airtelgprs.com, uid=guest, pwd=guest dns=202.56.240.5 and

202.56.230.5.

I have given following commands :

>>AT+CGATT=1 //TO ATTACH TO GPRS SERVICE
<<OK
>>AT+CGDCONT=1,"IP","airtelgprs.com" // define pdp context (cid,PDP type,APN)
<<OK
>>AT+CDNSCFG="202.56.240.5","202.56.230.5"//CINFIGUR DNS SERVER PRIMARY & SECONDARY
<<OK
>>AT+CSTT="airtelgprs.com","guest","guest" //START TASK GIVE APN UID AND PWD
<<OK
>>AT+CIICR //BRING UP WIRELESS COMMUNICATION WITH GPRS IT TAKES A LITTLE WHILE
<<OK
>>AT+CIFSR //GET LOCAT IP ADDRESS
<<117.98.105.57 // RETURNS IP ADDRESS ATTACHED TO MODEM
>>AT+CIPSTATUS
<<OK
<<STATE : IP STATE //RETURNS STATUS OF CONNECTION, NEEDS TO BE IP STATUS

**** now TO MAKE CONNECTION TO SERVER

>>AT+CIPHEAD=1 // TELLS MODULE TO ADD 'IP HEADER' TO RECEIVE DATA
<<OK
>>AT+CDNSORIP=1 //INDICATES CONNECTION REQUEST IS DOMAIN NAME
<<OK
>>AT+CIPSTART="TCP","www.google.com","80" //START TCP CONNECTION,MODE,IP ADDRESS/NAME,PORT
<<OK

<<ERROR:5
<<STATE : IP STATUS

WHAT COULD BE THE PROBLEM? i HAVE NOKIA MOBILE 2730C AND IF I PUT SAME SIM in the Mobile

THEN I AM ABLE TO BROWSE AND GET **broken link removed** clearly means that my SIM is

activated..Is there any activation necessary for using GSM Modem. If i call the Airtel Call

centre then they ask me which Mobile you are using..If I tell them that I am using GSM

Modem based on SIMCOM300 then they just say that it is not compatible and they dont have

any information. But I feel when I can ge Google.com through mobile why not through GSM

Modem... WHAT IS THE MISSING LINK. Can somebody tell.

I ALSO TRIED TO CONNECT TWO GSM MODEMS THROUGH UDP As given in the Application Note from

SIMCOM : How to intercommunicate between Modules :

I have use two GSM Modems. I give Initialization as :

>>AT+CIPCSGP=1,"airtelgprs.com","guest","guest"//set csd or gprs connect mode, apn uid,pwd
<<OK
>>AT+CIPSRP=1 //SHOW REMOTE IP PORT BEFORE RECEIVED DATA
<<OK
>>AT+CLPORT="UDP","201" // SET UDP PORT
<<OK
>>AT+CSTT="airtelgprs.com","guest","guest" //START TASK GIVE APN UID AND PWD
<<OK
>>AT+CIICR //BRING UP WIRELESS COMMUNICATION WITH GPRS IT TAKES A LITTLE WHILE
<<OK
>>AT+CIFSR //GET LOCAT IP ADDRESS
<<117.98.105.57 // RETURNS IP ADDRESS ATTACHED TO MODEM
>>AT+CIPSTATUS
<<OK
<<STATE : IP STATE //RETURNS STATUS OF CONNECTION, NEEDS TO BE IP STATUS


I DO THIS FOR BOTH MODEMS AND THEN THE IST MODEM : IP 117.98.96.161 AND PORT 201
2ND MODEM IP 110.226.108.144 AND PORT IS 501

FROM 1ST MODEM I GIVE CIPSTART WITH IP ADDRESS OF 2ND MODEM

FROM IST MODEM I GIVE

>>AT+CIPSTART="UDP","110.226.108.144","501" //IP ADDRESS & PORT OF 2ND MODEM
<<CONNECT OK

<<OK
>>AT+CIPSEND // I GIVE SEND COMMAND
<<'>' //RECEIVE SEND PROMPT
>>414141412412412412412414141414141414//I TYPE A STRING FOLLOWED BY ctrl z
<<SEND OK

IN THE SECOND MODEM I SHOULD HAVE RECEIVED THE STRING BUT I DONT.
I REPEAT THE SAME PROCEDURE FOR THE 2ND MODEM GIVING IP AND PORT OF 1ST MODEM

>>AT+CIPSTART="UDP","117.98.96.161","201" //IP ADDRESS & PORT OF 1ST MODEM
<<CONNECT OK

<<OK
>>AT+CIPSEND // I GIVE SEND COMMAND
<<'>' //RECEIVE SEND PROMPT
>>ASHOKA IS SENDING A PACKET HOPEFULLY YOU WILL RECEIVE//TYPE A STRING FOLLOWED BY ctrl z
<<SEND OK

IN THE FIRST MODEM I SHOULD HAVE RECEIVED THE STRING BUT I DONT.

Somewhere I am making some mistake... Can anyone please tell.

incidently i am getting ERROR:5 if i try to connect in TCP mode.

Thanks in Advance.
 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top