Looking for support with AT commands and troubleshooting knowledge (Hardware, Software). Arduino UNO, SIM800F GSM Shield.
Show older comments
Hello to everyone.
I will be very gratefull for support and knowledge sharing with AT commands and troubleshooting knowledge with hardware setup and software.
Hardware context :
- Arduino Uno, SIM800F GSM shield , USB connection and power, Rx -Tx GSM connection strapped on Software Serial
- Concerning SIM card. Inserted on a mobile phone, can send and receive SMS and phone communications. Data plan available.
Software context : I'm using Serial monitor to send AT commands and receive answers. Aim : to follow manually the proper AT sequence to send one piece of data to one field of one channel.
Code :
[code]
// Sending AT commands via Serial Monitor interface
#include<SoftwareSerial.h>
SoftwareSerial mySerial(2,3); // setting up GSM serial communication
void setup()
{
digitalWrite(8, HIGH); // Switching on GSM shield
delay(1100);
digitalWrite(8,LOW);
mySerial.begin(9600);
Serial.begin(9600);
Serial.println("Type AT command :");
}
void loop()
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}
[/code]
Setup :
- AT returns OK, SMS ready, CALL ready
- AT+CPIN? returns ready
As far I understand the proper sequence of AT commands to connect device to thingspeak server and send data should be this :
- AT // is SIM800F ready ? good return is : OK
- AT+CGREG? // is SIM800F registered on GPRS provider network ? good return is : +CGREG: 0,1 (edited)
- AT+CGATT? // is GPRS attached or not ? good return is : +CGATT: 1
- AT+CIPSHUT // resets previous IP session if any. good return is : SHUT OK
- AT+CIPSTATUS // Check if IP stack is intitalized. good return is : STATE: IP INITIAL
- AT+CIPMUX=0 // Sets single connection mode. good return is : OK
- AT+CSTT="APN","","" // Starts task. good return is : OK
- AT+CIPSTATUS // Not needed but for troubleshooting Check IP status. good return is : STATE: IP START
- AT+CIICR // Brings up wireless connection. good return is : OK and quick flashing led (edited)
- AT+CIPSTATUS // Not needed but for troubleshooting Check IP status. good return is : STATE: IP GPRSACT (edited)
- AT+CIFSR // Gets local IP adress. good return is : anything else than "0.0.0.0"
- AT+CIPSTART="TCP", "api.thingspeak....","80" // Starts connection with TCP protocol, TCP, domain name, port. good return is : CONNECT OK
- AT+CIPSEND // Data sending request. good return is : >
- > data string // Sends data to the proper field and channel
- >#026 // Ctrl+Z input to indicate the end of data
- AT+CIPSHUT // Shuts down UDP context. good return is : SHUT OK
At this time :
- AT+CGREG? is returning : +CGREG: 1,0 which states : network registration is enabled, device is not registered and searching for operator's network (edited)
- AT+CGATT? is returning : 0, which states GPRS is detached
- AT+CIICR is returning +PDP: DEACT, ERROR
Question :
What may prevent network registration and getting a +CGREG: 0,1 return ? (edited)
How can I troubleshoot and assess actual situation ?
Thank you for your insights.
12 Comments
Walter Roberson
on 23 May 2022
According to https://m2msupport.net/m2msupport/atcreg-network-registration/ +CREG: 1,0 means that it is registered to the home network and technology is GSM, whereas 0,1 would mean not registered or searching, GSM Compact service.
emmanuel jallas
on 23 May 2022
emmanuel jallas
on 24 May 2022
Edited: emmanuel jallas
on 24 May 2022
Walter Roberson
on 24 May 2022
https://forums.quectel.com/t/at-cgact-1-1-cme-error-100/4963 maybe??
emmanuel jallas
on 24 May 2022
Walter Roberson
on 24 May 2022
Notice the part where someone says it happened to them when they were already in a session.
I have never used gprs. My modem experience was in the era of dial-up (but I did use some fancy modems in those days.)
emmanuel jallas
on 24 May 2022
emmanuel jallas
on 25 May 2022
Edited: emmanuel jallas
on 25 May 2022
emmanuel jallas
on 25 May 2022
Walter Roberson
on 26 May 2022
It appears to me that the meaning of the return codes is vendor-specific. For some vendors, +CREG= sets the output format for +CREG? queries
Vinod
on 2 Jun 2022
Thank you, Emmanuel, for sharing that you got it working by switching your SIM card.
emmanuel jallas
on 2 Jun 2022
Answers (0)
Communities
More Answers in the ThingSpeak Community
Categories
Find more on Waveform Design and Signal Synthesis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!