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.

[sim548c] How to give back IP, and take another in GPRS connection.

Status
Not open for further replies.

namlooc

Junior Member level 3
Junior Member level 3
Joined
Dec 21, 2010
Messages
26
Helped
9
Reputation
18
Reaction score
9
Trophy points
1,283
Activity points
1,452
[GSM sim548c] How to give back IP, and take another in GPRS connection.

Hi!

I'm sending data like this:

AT+CREG=1 --> answer: ok
AT+CSNS=4 --> answer: ok
AT+CSTT="INTERNET","INTERNET","INTERNET" --> answer: ok
AT+CIICR -->answer: ok
AT+CIFSR --> answer: ip adres
AT+CIPSTART="tcp","193.200.51.2","8000" --> answer:eek:k
AT+CIPSEND
> HELLOW WORLD <ctrl+z> -->answer: send ok
AT+CIPCLOSE -->answer: close ok
AT+CIPSHUT -->answer: shut ok
AT+CIPSTATUS -->answer: ip initial

Everything till this point is ok. Modem is sending "HELLOW WORLD" correctly to my PC.

After a while, i want to send more data. The same way i did it before:

AT+CREG=1 --> answer: ok
AT+CSNS=4 --> answer: ok
AT+CSTT="INTERNET","INTERNET","INTERNET" --> answer: ok
AT+CIICR -->answer: ERROR !!
AT+CIFSR --> answer: ERROR !!
AT+CIPSTART="tcp","193.200.51.2","8000" --> answer:eek:k
AT+CIPSEND
> HELLOW WORLD <ctrl+z> -->answer: send ok
AT+CIPCLOSE -->answer: close ok
AT+CIPSHUT -->answer: shut ok
AT+CIPSTATUS -->answer: ip initial

Modem is sending "HELLOW WORLD" correctly to my PC, but i can't get another IP adress.

My question: How to get rid of current IP address, and get another ?
or When i will be known about taking away my ip address?
and When a new IP address expires and i will need to get a new one?

I have found in the sim548c datasheet that AT+CIICR works only when STATE is IP START:
**broken link removed**

ciicr.th.jpg[/IMG][/URL]
..but i have IP INITIAL :/
 
Last edited:

Try this:
AT+CGATT=0 ' detach from gprs,
AT+CGATT=1' attach again
AT+CIICR -->answer: ERROR !!
You get this error because you have already launched a wireless application on modem.
If you only need to send more stuff on the PC without changing IP addresses, try this:
First time:

Code:
AT+CREG=1 --> answer: ok
AT+CSNS=4 --> answer: ok
AT+CSTT="INTERNET","INTERNET","INTERNET" --> answer: ok
AT+CIICR -->answer: ok
AT+CIFSR --> answer: ip adres
AT+CIPSTART="tcp","193.200.51.2","8000" --> answer:ok
AT+CIPSEND
> HELLOW WORLD <ctrl+z> -->answer: send ok
AT+CIPCLOSE -->answer: close ok
AT+CIPSHUT -->answer: shut ok
AT+CIPSTATUS -->answer: ip initial
2nd, 3rd, etc...

Code:
AT+CIPSTART="tcp","193.200.51.2","8000" --> answer:ok
AT+CIPSEND
> HELLOW WORLD <ctrl+z> -->answer: send ok
AT+CIPCLOSE -->answer: close ok
AT+CIPSHUT -->answer: shut ok
AT+CIPSTATUS -->answer: ip initial
 

Try this:
AT+CGATT=0 ' detach from gprs,
AT+CGATT=1' attach again
didn't work :/
Only hard reset the GSM modem helps to get another IP address.

If you only need to send more stuff on the PC without changing IP addresses, try this:
First time:
I know that this thing works, but i think it is unreliable. I'm making tracking device on AVR microcontroller and it must by reliable in situations where i lose signal, logout or just want to change IP.

Another thing is that when i pull out the GSM antena plug, and pull in the plug (simulates a bad signal quality in and logout/login fom network) everything goes bad.

Example:
Code:
AT+CREG=1 --> answer: ok
AT+CSNS=4 --> answer: ok
AT+CSTT="INTERNET","INTERNET","INTERNET" --> answer: ok
AT+CIICR -->answer: ok
AT+CIFSR --> answer: ip adres
AT+CIPSTART="tcp","193.200.51.2","8000" --> answer:ok
AT+CIPSEND
> HELLOW WORLD <ctrl+z> -->answer: send ok
AT+CIPCLOSE -->answer: close ok
AT+CIPSHUT -->answer: shut ok
AT+CIPSTATUS -->answer: ip initial

[B]<pull out the antenna>[/B]
+CREG: 1,0 //LOGOUT
[B]<delay 2sec>[/B]
[B]<pull in the antenna>[/B]
+CREG: 1,1 //LOGIN

AT+CIICR -->ERROR
AT+CIFSR --> nothing happends, no answer
AT+CIPSTART="tcp","193.200.51.2","8000" --> answer:ok, but no connection in PC
AT+CIPCLOSE -->answer: ERROR
AT+CIPSHUT -->answer: OK and STATE: PDP DEACT
AT+CIPSTATUS -->answer: STATE: PDP DEACT

So, after bad signal quality i can't get new ip adress.
Alsow only hard reset helps
What am i doing wrong ?
 

I've done a similar thing with a PIC and SIM900D
I checked whether it is connected to the GPRS, with AT command "AT + CGATT?".
If not connected, then I sent AT + CIPSHUT, and then AT + CSTT ="... etc.
 

I have found another sim548c and everything works perfectly on it :)

The problem seems to be in my copy of sim548c.

How to set factory settings ??
 

AT&F
Maybe is problem in firmware version, try to update firmware.
I have updated the sim900, because some AT commands are not working.
 
I have another question to you.

How much time you're waiting for reply to these questions ?
(In extrem conditions of signal strength,i mean low signal)
Code:
AT+CIICR
AT+CIFSR
AT+CIPSTART="TCP","IN......
AT+CIPSEND
 

I'm waiting about 120 sec...
I tried 60s, it worked, but only with exelent signal.
 

how do I update the firmware of sim900d? i've got a broken ATE0, everytime I issue this command, my gsm stops from responding, and to think that I issue that using hyperterminal.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top