SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
User avatar
By SebaS
#81247
Hello everybody!!

Well, I've been working with SIM200 a lot, since about a year and a half... At the beggining of the year I start using SIM340, because SIM200 is obsolete.

For the SIM 200 I've made a software to connect via GPRS to a Server application made in Visual Basic. It worked fine, very fine... Then I modify the code so I would be compatible with SIM340. [I mean, I modify the code of the MCU that controls the GPRS module]. There were few little differences between SIM200 and SIM340... I made this changes, about 6 months ago, and when I tested it also work very fine.

Since that, till today I haven't touch that project... Now I return to it, because I want to do some changes, and I found out that I can't connect to the Server... The MCU code has not change, it's exactly the same... The Visual Basic application has experience some changes (not done by me, my boss did it, he knows lot about Visual Basic). The changes on this application were necesary because the software uses a DataBase, and now it works with another DataBase...

The GPRS module arrives to the point of connnecting to server, and after a long waiting (about a minute) it response:
STATE: TCP CONNECTING
CONNECT FAIL

Don't know what to look for what to do.... It seems like the Server never exists... I can tell that because if I close my Visual Basic application, the same thing happens...

I know the module is connecting to the cell-phone provider Network because it gives me an IP address

Thanks A LOT!!!!
User avatar
By Gsm Man
#81251
Without seeing the commands you're sending I assume your connection to the Cellular network is good and that you have successfully opened as PDP context. If they are OK, then the following are a couple of things to check:
1 - Signal level - GPRS is not reliable at low signal levels, and you may find that TCP connections timeout or are dropped

2 - If you are connecting to a 'Domain name', as opposed to an IP address you need to set the DNS servers addresses in the sim340.

3 - If you are connecting to a server using HTTP, do you have the required fields in your header?

Without more information about your connection, that's about the best I can offer.
User avatar
By SebaS
#81254
This is the command sequence:
In bold is what the MCU sends, other commands are SIM340 module's replies.

RDY
+CFUN: 1
+CPIN: READY
AT+IPR=9600
OK
AT&W
OK
ATE0
OK
AT
OK
AT+GSN
<IMEI number>
OK
AT+CBAND=EGSM_DCS_MODE
+CME ERROR: 765
AT+CMEE=1
OK
AT+CGEREP=1
OK
AT+CREG=1
OK
AT+CGREG=1
OK
AT+COPS=0
OK
AT+CGATT?
+CGATT: 0
OK
AT+CGATT=1
Call Ready
+CREG: 1
+CGREG: 1
OK
AT+COPS?
+COPS: 0,0,"UNIFON"
OK
AT+CSTT="wap.gprs.unifon.com.ar","wap","wap"
OK
AT+CIICR
OK
AT+CIFSR
<IP Address>
OK
AT+CDNSCFG="200.45.0.115"
OK
AT+CDNSORIP=1
OK
AT+CIPSTART="TCP","<domain name>","<port #>"
STATE: TCP CONNECTING
CONNECT FAIL
By bretth
#81256
Several tests immediately come to mind:

0. Can you connect to the same server/port from a laptop on the public internet, using something like "telnet <ip> <port>". This ensures your server is running as you expect.

1. Have you checked connectivity to another server from your device? Maybe google.com on port 80? This will validate your DNS configuration and give you a good data point.

2. If that works, can you connect to the same port number on your own server (assuming it's running a server on that port)? This will ensure you're not running across any firewall issues.
User avatar
By SebaS
#81267
Well... I've already test the server connectivity via telnet and works fine...

About, google, I think I had try it too and didn't work, but I'll try again because I don't remember...

I'll do the test and then let you know about them


Thanks!!!
User avatar
By SebaS
#81454
Well... thanks to all... Problem solved!

It was a DNS problem... try with a different one and work just fine


Thanks again!
By mcogill
#99695
Hi All
Another beginner here. I am having a similar problem. GPRS won't connect to the server.

I am working with the Telit GE865 on the sparkfun breakout board using teleterm on vista. I followed the AT command sequence that allowed me to successfully connect to the wireless network using the command AT#GPRS=1. After that I tried to transfer a file using FTP. I managed to send some data (but I did not receive it).

Ever since that I have not been able to reconnect GPRS. I have used AT#SERVINFO to check that the network supports GPRS. I have used the AT#&F command to restore factory defaults. I have spent a couple of days trying everything I can find on forums and telit manuals. I even checked that my PAYG sim card still had credit on it.

I am stuck!

Any and all suggestions would be greatly appreciated.
By mcogill
#99734
OK- I figured it out :D

Once you issue the AT#GPRS=1 command, it gets written to Non volatile memory and subsequent reboots will return an error message because you are already on GPRS. I found this out by using the command
AT+CGATT?, which returns +CGATT:1, which means you are connected to the server on gprs.

TELIT- please change your manuals to reflect this!

hopefully it will help others also.

arriba los corazones!
By Vovik
#99867
I could not believe it that after so bad frustration seems like somebody could help me!

My sim card from AT&T as well and I have very similar problem.
After reading this post I have run AT+CGATT? and it does returns +CGATT: 1 OK. But seems like I am doing something wrong or do not know a login/pw to use...

Mcogill could you please publish whole series of command that let you reach a site by http or ftp please?

This is what I am trying to do:
Code: Select all
AT+CGATT?
+CGATT: 1

OK
AT#USERID="WAP@CINGULARGPRS.COM"
OK
AT#PASSW="CINGULAR1"
OK
AT+CGDCONT=1,"IP","isp.cingular","0.0.0.0",0,0
OK
AT#GPRS=1
+CME ERROR: 555
AT#SKTD=0,80,"google.com",0,0
+CME ERROR: 556


I tried to run the same comands with AT#SKTSAV after AT+CGDCONT=... which returenet me OK but the end result is still the same ERROR on AT#GPRS=1.

Could somebody help me please?
By follower
#99889
Vovik wrote:but the end result is still the same ERROR on AT#GPRS=1.
Did you try the same sequence but without the AT#GPRS=1? My impression from the previous poster was that removing that command was what worked.

--Philip;
By fryslan
#100486
I hook in, in this topic because it seems to be that I have the same problem. In another topic I tried to connect to a website but it failed. In this forum I found other AT commands to connect with a server I tried that also. First i will show you my at commands.
Local echo on so I can see my http requests send to the website
Code: Select all
at+cpin=0634
at+cpin=0634
OK
AT#USERID="tmobile"
AT#USERID="tmobile"
OK
AT#PASSW="tmobile"
AT#PASSW="tmobile"
OK
AT+CGDCONT=1,"IP","internet","0.0.0.0",0,0
AT+CGDCONT=1,"IP","internet","0.0.0.0",0,0
OK
AT#SKTSAV
AT#SKTSAV
OK
AT#GPRS=1
AT#GPRS=1
+IP: 95.98.170.231

OK
AT#SD=1,0,80,"www.telit.com",0,0
AT#SD=1,0,80,"www.telit.com",0,0
CONNECT
GET / HTTP/1.1
Host: www.telit.com


NO CARRIER
Follower mentioned that it will work without at#gprs=1.

I tried that also:
Code: Select all
at+cpin=0634
at+cpin=0634
OK
AT#USERID="tmobile"
AT#USERID="tmobile"
OK
AT#PASSW="tmobile"
AT#PASSW="tmobile"
OK
AT+CGDCONT=1,"IP","internet","0.0.0.0",0,0
AT+CGDCONT=1,"IP","internet","0.0.0.0",0,0
OK
AT#SKTSAV
AT#SKTSAV
OK
AT#SD=1,0,80,"www.telit.com",0,0
AT#SD=1,0,80,"www.telit.com",0,0
ERROR
That isn't working.

For a extra check I tried with a telnet session on port 80 of the http://www.telit.com and that is working fine with the following commands
Code: Select all
GET / HTTP/1.1
Host: www.telit.com
Also I tried AT+CGATT? and is returning 1

Command AT#SERVINFO is returning.
#SERVINFO: 998,-51,"Ben NL","20416",64,0172,00,1,,"I",00,6
So gprs is supported.

I really don't know what I can do more. I hope somebody here can tel me.
By fryslan
#100493
Little update.

I can connect with my ftp server, but still not with my homepage.
Code: Select all
t+cpin=0634
OK
AT#FTPTO=1000
AT#FTPTO=1000
OK
AT+CGDCONT= 1,"IP","internet","0.0.0.0",0,0
AT+CGDCONT= 1,"IP","internet","0.0.0.0",0,0
OK
AT#SGACT = 1,1,"tmobile","tmobile"
AT#SGACT = 1,1,"tmobile","tmobile"
#SGACT: 188.91.232.50

OK
AT#FTPOPEN="ftp.gltronics.nl","***","***",0
AT#FTPOPEN="ftp.gltronics.nl","***","***",0
OK
AT#FTPLIST
AT#FTPLIST
CONNECT
drwx--x--x    8 388560   gltronic     2048 Dec 20 20:32 .
drwx--x--x    8 388560   gltronic     2048 Dec 20 20:32 ..
-rw-r--r--    1 388560   gltronic      210 Apr 16  2007 .htaccess
drwx--x--x    3 388560   gltronic     2048 Apr 16  2007 _vti_bin
drwx------    2 388560   gltronic     2048 Apr 16  2007 _vti_cnf
-rw-r--r--    1 388560   gltronic     1754 Apr 16  2007 _vti_inf.html
drwx------    2 388560   gltronic     2048 Apr 16  2007 _vti_log
drwx--x--x    2 388560   gltronic     2048 Apr 16  2007 _vti_pvt
drwx--x--x    2 388560   gltronic     2048 Apr 16  2007 _vti_txt
-rwxr-xr-x    1 388560   gltronic     1699 Dec 20 20:32 atmel.php
-rw-r--r--    1 388560   gltronic     3325 Apr 16  2007 b-one-default.html
drwxr-xr-x    2 388560   gltronic     2048 Jul 19  2008 catalog
-rwxr-xr-x    1 388560   gltronic     2525 Dec 20 20:32 databasefunc.php
-rwxr-xr-x    1 388560   gltronic    30894 Dec 20 19:46 favicon.ico
-rwxr-xr-x    1 388560   gltronic     4032 Dec 20 20:32 index.php
-rwxr-xr-x    1 388560   gltronic      121 Dec 20 20:32 stijl.css
-rwxr-xr-x    1 388560   gltronic     1776 Dec 20 20:32 xmlhttprequest.php

NO CARRIER
By mcogill
#100881
Here is what I have learned from this:

Use the AT+CMEE=2 command. It gives you verbose error responses and alows you to check all your settings more efficiently.

Get a M2M service provider. They have development tools and can ensure that you get GPRS connected. You can even see the sim status and data transfer in semi real time on their site. Its expensive but if you are serious...
I went with Jasper wireless.
I hope this eases someones pain.

Oh and unless you are already huge some wireless HW manufacturers will not be supporting you.
Where do they think innovation comes from? Large companies? Ha!
By Vovik
#101251
Seems like now I accidentally changed some configuration and now even when trying

AT#USERID="EASY GPRS"

the module returns

+CME ERROR: operation not supported

So my questions are:
1. What could be wrong (need to know where was the trap to do not get there again) and how could I reset the gm862 module (tryed ATZ and AT&F but still AT#USERID="EASY GPRS" returns the error
2. Is there a place where I could find a freelance consultant to help me with sequence of command for gm862 that would let me consistently connect my mcu device (send an HTTP get request) to my web server?