SIM800L sleep mode

Adafruit cellular platform - SMS and IoT over celluar

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
biod101
 
Posts: 184
Joined: Sun Apr 19, 2015 4:21 pm

Re: SIM800L sleep mode

Post by biod101 »

The problem is my board won't recognize any AT commands, since the serial terminal doesn't recognize the board anymore. I have already tried restarting the board by resetting the board via digital pin 4.

The board was working fine. The issue started when I executed the command AT+CSCLK=1, which led me to believe I put serial communications to sleep, but your post makes it sound like something else is going on (?).
Last edited by biod101 on Thu Sep 03, 2015 1:24 am, edited 1 time in total.

User avatar
biod101
 
Posts: 184
Joined: Sun Apr 19, 2015 4:21 pm

Re: SIM800L sleep mode

Post by biod101 »

Kimlorentz wrote:Hva you tryed Programming your arduino Board to send AT+CSCLK=0 every 20-50 ms and only that and restarting the SIM800?
You suggested using the Arduino to send the AT command. Would I do that using this command?

Code: Select all

fonaSS.println("AT+CSCLK=0"); 
or is there another way to do this?

Would the following code work for restarting the board (same as a reset)?

Code: Select all

// Toggle the reset pin low for 100 ms
pinMode(FONA_RST, OUTPUT);
digitalWrite(FONA_RST, HIGH);
delay(10);
digitalWrite(FONA_RST, LOW);
delay(100);
digitalWrite(FONA_RST, HIGH);
Sorry - I'm really new at this.

User avatar
biod101
 
Posts: 184
Joined: Sun Apr 19, 2015 4:21 pm

Re: SIM800L sleep mode

Post by biod101 »

Tried your recommendation as I understand it, borrowing some code from "FONA_test"

Code: Select all

#include "Adafruit_FONA.h"

#define FONA_RX 2
#define FONA_TX 3
#define FONA_RST 4

// This is to handle the absence of software serial on platforms
// like the Arduino Due. Modify this code if you are using different
// hardware serial port, or if you are using a non-avr platform
// that supports software serial.
#ifdef __AVR__
  #include <SoftwareSerial.h>
  SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);
  SoftwareSerial *fonaSerial = &fonaSS;
#else
  HardwareSerial *fonaSerial = &Serial1;
#endif

Adafruit_FONA fona = Adafruit_FONA(FONA_RST);

uint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout = 0);

void setup() {

// Toggle the reset pin low for 100 ms
pinMode(FONA_RST, OUTPUT);
digitalWrite(FONA_RST, HIGH);
delay(10);
digitalWrite(FONA_RST, LOW);
delay(100);
digitalWrite(FONA_RST, HIGH);

// Try AT command in setup
fonaSS.println("AT+CSCLK=0");

  while (!Serial);

  Serial.begin(115200);
  Serial.println(F("FONA basic test"));
  Serial.println(F("Initializing....(May take 3 seconds)"));

  fonaSerial->begin(4800);
  if (! fona.begin(*fonaSerial)) {
    Serial.println(F("Couldn't find FONA"));
    while(1);
  }
  Serial.println(F("FONA is OK"));

}

void loop() {
 Serial.println(F("In the loop"));
 fonaSS.println("AT+CSCLK=0");
 delay(50);
}
No luck - the response in the serial monitor window is "Couldn't find FONA"

User avatar
biod101
 
Posts: 184
Joined: Sun Apr 19, 2015 4:21 pm

Re: SIM800L sleep mode

Post by biod101 »

As a last resort, I used an FTDI board to issue AT commands to the FONA shield directly rather than going through the Arduino UNO / sketch. I was able to issue the command "AT+CSCLK=0" from a terminal window, which returned an "OK" response. Upon re-attaching the FONA shield to the Arduino UNO, I was once again able to communciate with the board via my original sketch. Hopefully, this helps anyone else who may run into a similar situation.

User avatar
Kimlorentz
 
Posts: 191
Joined: Mon Jun 23, 2014 7:11 am

Re: SIM800L sleep mode

Post by Kimlorentz »

Good you got it back working. :)
Did not know if you got a FTDI board, thats way I told you about reprogramming the arduino board :)
Good luck with your projects, I am almost done with mine and now working on the same project with the use of Intel Edison and webpage interface. :)

User avatar
bilica
 
Posts: 28
Joined: Tue Jun 17, 2014 1:08 pm

Re: SIM800L sleep mode

Post by bilica »

Hi again Kimlorentz!

Just posted this question on your other thread (http://forums.adafruit.com/viewtopic.ph ... 08#p404108) -

Can you please post how you accessed the DTR pin on the FONA 808 ? Maybe some photos ;)

Or does the "AT+CSCLK=1" (Sleep Mode On) works without the need to pull DTR HIGH ?

Thanks again!

Kimlorentz wrote:I am going to use current measurement equipment to get the correct currents.
I am also removing the PWR LED to se what I can save in power consumption.
Also going to show whit photo and drawings :)

Note!! I am doing the same thing with the FONA 808.
Whit FONA808 I am going to add components needed to drive the DTR pin.
Drawing and photo is comming.
I have been in contact whit the SIMCOM and they are working on an firmware oppdate to allow auto sleep mode.
But for now we can only use DTR pin.

User avatar
Kimlorentz
 
Posts: 191
Joined: Mon Jun 23, 2014 7:11 am

Re: SIM800L sleep mode

Post by Kimlorentz »

I added an resistor and 1N4148 diode to the SIM808 pin DTR.
Image

Here is an foto for it.
Image

User avatar
Kimlorentz
 
Posts: 191
Joined: Mon Jun 23, 2014 7:11 am

Re: SIM800L sleep mode

Post by Kimlorentz »

Here is my current code. http://kimlorentz.com/adafruitfoto/FONA808.txt.

Still not working properly, but works.
The only part not working is the GSMLOC, it gives me the wrong position

User avatar
bilica
 
Posts: 28
Joined: Tue Jun 17, 2014 1:08 pm

Re: SIM800L sleep mode

Post by bilica »

That is just awesome! Thanks a lot Kimlorentz!

Now let's try to do that here :)

Kimlorentz wrote:I added an resistor and 1N4148 diode to the SIM808 pin DTR.
Image

Here is an foto for it.
Image

User avatar
haku15
 
Posts: 72
Joined: Mon Jun 25, 2012 12:45 pm

Re: SIM800L sleep mode

Post by haku15 »

Hi Kimlorentz,
nice work and thanks for sharing these useful infos.
Have you measured the current draw at sleep of the Fona808 itself, not the SIM808 only?
I measure 11mA from the battery (3.9V) attached to Fona808 and it seems too much to me.
I’m using the same Fona pins as you are (Key, Reset, TX, RX, RI, RST, PS, DTR), I’ve set AT+CSCLK=1 and DTR is pulled high. I am sure it is sleeping because I get no response from the serial connection while asleep, but I can wake it up with DTR and the Fona replies correctly. I also can call it during the sleep and it starts up.
I would expect a current draw of max 6mA during sleep from the Fona808 breakout board: 2mA (SIM808) + 3mA (board logic from Vio pin)+ 1mA (power Led, I set the NET led off).

Any feedback from anybody is much appreciated.
Thanks

User avatar
Kimlorentz
 
Posts: 191
Joined: Mon Jun 23, 2014 7:11 am

Re: SIM800L sleep mode

Post by Kimlorentz »

What controller do you use whit the FONA808?

I will reconnect my FONA808 and Arduino Micro Pro 3V and test my code and show my current draw.

User avatar
Kimlorentz
 
Posts: 191
Joined: Mon Jun 23, 2014 7:11 am

Re: SIM800L sleep mode

Post by Kimlorentz »

I tryed my code again and I am down to 1.6mA, and during GSM ping I get about 100mA. I will take a 1 hour logging to se what it used.
I be back with the current use during that hour in sleep mode.

Under here is my current code an pin config.
Go to My link to get the code. Was not able to share due banned words, dont know why that is!

LINK: http://kimlorentz.com/arduino/fona808.txt
Note: This code is set for Norwegian GSM, some modifications my be needed.

To get fona808 battery level send this command: batt
To get GPS position send this command: gps
Note: GSM Loc is not working for me but I added the code. Dont send command gsm at current code setting, the code will hang up.
To use gsm command find the void GSMLOCMode() and remove the /* and */


Current mA usage at 50ms delay readings for 30 seconds
Image

My current code has a lot of not used commands and modes. thay are only notes for me, you can remove them to save space.

User avatar
haku15
 
Posts: 72
Joined: Mon Jun 25, 2012 12:45 pm

Re: SIM800L sleep mode

Post by haku15 »

Wow, that's very kind of you, thank you very much!
I am currently using a Moteino Mega 3.3V.
I had a look at your code and I am using the same commands for the sleep as you do.
I tried also to disconnect the cables of RI, RST, Key and PStat too see if they were drawing current but that wasn't the case.
Maybe the connection to the DTR pin is wrong. Here is the picture (see file attached). I am using diode just to lower voltage @ DTR pin, because it does not accept more than 3.1V. I checked with multimeter the voltage at the DTR pin and is correct: 2.8V when I want Fona to sleep and 0V when I want to wake it.
You made a slightly different connection for the DTR pin, but I did not do the same because my cable is covering VCC EXT (2.8V) that u are using and I also wasn't sure how that circuit worked: when you put Arduino pin low, DTR discharges to ground of the Arduino pin? Anyway, I think my solution should be ok as well.
You know, when you posted the pictures of the SIM808 current draw of average 1.7mA I tought that was just the SIM808 chip outside of the Adafruit board, but it seems like you measure the current pulled from the whole Fono808 board (except the LEDs), correct?
Thanks again for your help!
Attachments
dtr_fona.JPG
dtr_fona.JPG (19.48 KiB) Viewed 1345 times

User avatar
haku15
 
Posts: 72
Joined: Mon Jun 25, 2012 12:45 pm

Re: SIM800L sleep mode

Post by haku15 »

I also wonder if a low GSM signal strenght might be the cause of higher current draw during sleep. I am using the slim sticker 3dBi antenna and the RSSI was higher than than by Adafruit suggested 5, don't remember now what was the number, but for sure the signal quality is not the best.

PS: you could not post your code because it contains the acronym of "International Mobile Station Equipment Identity", probably banned for safety reason, so that people don't post that numbers.

User avatar
haku15
 
Posts: 72
Joined: Mon Jun 25, 2012 12:45 pm

Re: SIM800L sleep mode

Post by haku15 »

I did further testing. I would exclude the signal strength as possible cause, as I have RSSI 10 (-94dBm).
Then I noticed I have the same current draw of about 12mA if the Fona is idling or if it sleeping.
I checked the current draw of all other components with the multimeter and I can confirm it is the Fona808 drawing those 11-12mA during sleep.
In the register of the slow clock I can read the correct setting for the sleep and DTR is @ 2.8V, yet the current draw does not get lower.
Based on the datasheet, that's more the current draw of idle (about 17mA) then sleep (1.7mA).
I have no more ideas what to do. Maybe the SIM808 has an other Firmware then yours and it works now differently...

Locked
Please be positive and constructive with your questions and comments.

Return to “FONA”