GPRSbee and time lib not working on the Seeeduino Stalker

I have problems to run the GPRSbee with the RTC lib. As hardware I’m using the latest GPRSbee with a Seeeduino Stalker v2.3 as board. This basic example sketch is working without including


After including the initialization of wire the sketch sends out one httpget request but after this the GPRSbee led is fast flashing and no second or ongoing gprsbee.doHTTPGET is done. I have tried the initial Seeeduino Stalker lib, but also the Sodaq_DS3231 lib.

What is wrong with the GPRSbee lib and the RTC lib? Why are there conflicts and what kind of? I have an data logging sketch with a RFM69 module wake up triggered by an RTC IRQ and sleep mode in between. I had expected I can switch to the GPRSbee easily but something is going wrong. Why does the RTC mess up the GPRSbee communication / code?

// GSM / GPRSbee
#include <GPRSbee.h>

// fill in your own APN here
#define APN ""

static const uint8_t BEEDTR = 18;
static const uint8_t BEECTS = 19;

// RTC 
#include <Wire.h>    // I2C (for RTC)
//old/other Seeeduino Stalker RTC lib 
//#include <DS3231.h>  // RTC itself 
#include <Sodaq_DS3231.h>  // RTC itself 

//needed for old/other Seeeduino Stalker RTC lib 
//DS3231 RTC;                     // create RTC object for DS3231

// we need some variable as char to pass it to payload easily 
char timestampChar[20];  // should handle yyyy/mm/dd hh:mm:ss and null terminator 

void setup() { 
  // Serial for GPRSbee 

  // pin 5 is a fake pin, we do not need it but the lib requires it 
  // use an unused pin for this!
  gprsbee.initAutonomoSIM800(Serial, BEEDTR, 5, BEECTS);
  // make sure the GPRSbee is switched off to begin with;

  // rtc, irq 
  Wire.begin(); //  <- with this included the sektch is working no more !!

void loop() {
  char buffer[200];
  memset(buffer, 0, sizeof(buffer));
  gprsbee.doHTTPGET(APN, "", buffer, sizeof(buffer));;

Not an immediate answer to your problem, but …

Prototype of initAutonomoSIM800 is:

  void initAutonomoSIM800(Stream &stream, int vcc33Pin, int onoffPin, int statusPin,
      int bufferSize=SIM900_DEFAULT_BUFFER_SIZE);

If you are sure that you don’t need the onoffPin you should pass it as -1.

From your description (I don’t know anything about Seeduino Stalker) it sounds like there is a problem with the RTC. By leaving out Wire.begin() it probably does not activate the RTC.

The GPRSbee doesn’t use Wire at all, and thus no RTC either. There shouldn’t be any conflict. We have lots of sketches that use both GPRSbee and Sodaq_DS3231.

Have you tried a sketch that only uses the RTC?

Yes, I have tried several sketches with RTC code and all is working as expected (in case I do not use GPRSbee in parallel): setting time, fetch time, also wakeup via IRQ is working. But to cut down complexity I tried to add the problematic code step by step. I think also the I2C/wire lib itself will not cause the problem but the RTC code.

As described, the first attempt is always successful an gprsbee.doHTTPGET is working, but only for the first time. saw some wdt_reset code in the GPRS lib but have no idea if this can cause the problem.

Sometimes I got a second successful result but the reported date (other code as in the first posting) is something like 2000/01/23 00:00:80 and after some–in the most times 3 to 4–updates I got on the server the sketch doesn’t go on.

Just to be sure to have no mismatch in the variable order, I found in

void GPRSbeeClass::initAutonomoSIM800(Stream &stream, int pwrkeyPin, int vbatPin, int statusPin,
    int bufferSize)

and I think it is correct because it is working on my side. Is your code an older example or is there vcc33Pin and onoffPin interchanged?

Btw this is the debug information I get for the sketch in the initial posting. I get two times “off powerPin
off vbatPin”, without the RTC code I got it ony once

It seems that the connection / GPRSbee is not correct switched off. About “>> AT+SAPBR=1,1 > ERROR” some wrote also that it could be because a connection was already made:

But what does it have to do with the RTC??


>> AT+HTTPPARA="URL",",63.303,59.4,14.5,65.5,3.3,4.1"



+HTTPACTION: 0,200,68



off powerPin
off vbatPin
off powerPin
off vbatPin
>> AT


>> ATE0


+CSQ: 18,0


+CREG: 0,1


>> AT+SAPBR=3,1,"APN",""

>> AT+SAPBR=1,1

>> AT+SAPBR=1,1

>> AT+SAPBR=1,1

>> AT+SAPBR=1,1

>> AT+SAPBR=1,1

doHTTPGET failed!
off powerPin
off vbatPin
off powerPin
off vbatPin

Yeah, sorry. You’re right.
I have a newer version which has many changes only to make it more compatible with Sodaq_3Gbee.
I probably should publish my new version, so that everyone can enjoy :slight_smile:

I get two times “off powerPin off vbatPin”, without the RTC code I got it ony once

That reason for that is that doHTTPGET is also doing an off()

I guess it shouldn’t, but I’m not sure. Perhaps you can try to disable it.
We only have sketches with enabled watchdog.

I have now only included in the head
#include <Wire.h> // I2C (for RTC)

and in setup

I commented out all RTC stuff
//#include <Sodaq_DS3231.h> // RTC itself

and the problem still exists. So … I’m feeling a bit stupid now because I used
BEEDTR = 18;
BEECTS = 19;

This is A4, A5 on the Pro Mini and SDA and SCL for I2C ! Here you are “conflict”. Sometimes the human factor is really crazy especially if you are the one …

Thanks for your patience!

Ah, OK. Thanks for letting us know