GPRSBee issue - serial port gone when attached and GPRS sketch uploaded

Dear all,

HAPPY NEW YEAR TO ALL AND MAY YOU HAVE SUCCESSFUL MAKER PROJECTS IN 2016!

After left packaged for 4 weeks, I finally had some time to tinker with my Autonomo. It works great, I love it!

In my KickStarter pledge I also added a GPRSBee (rev. 6). Here, interfacing with it, I was faced with some more difficulties. First and foreost, when I add it to the socket (with and without wiring power to it) and loading the sketch below, I completely lost the serial port connection from the Arduino IDE. Resrarting the Autonomo, the Arduino IDE - nothing rsolved it. After removing it from the socket, reflashing it with a sketch not inferacting with the GPRSBee (like a simple ‘blink’ sketch), it continues to function normally (also when afterwards re-attching the GPRSBee).

My suspicion is that the sketch I uploaded, kills the serial connection.

The sketch I used was a modified sketch I found online for ‘beer is cold’-notification by SMS and it is listed below. I simply downloaded the ‘GPRSBee modified’ library (renamed the folder to GPRSBee), copied it into the ‘library folder’ and used it (compiler compiles it in correctly).

Thanks for your help or sharing an alternative test-sketch for sending a test-SMS using the Autonomo and the GRPSBee Rev. 6b.

Regards, Sebas

#include <GPRSbee.h>

bool sent_sms = false;
bool smsSent = false;
void setup()

{
  SerialUSB.begin(9600);
  
  SerialUSB.println("Switching off..");
  bool retval2 = gprsbee.off();
  SerialUSB.println("done... retval =");
}
/*--(end setup )---*/
void loop()
/*----( LOOP: RUNS CONSTANTLY )----*/
{
 
  if (sent_sms == false)
  {
    sent_sms = true;
    SerialUSB.println("Switching on..");
    bool retval = gprsbee.on();
    SerialUSB.println("...done. Retval = ");
    SerialUSB.println(retval);
   
    SerialUSB.println("Sending SMS");
    smsSent = gprsbee.sendSMS("+49172xxx", "Testing 123");
    // phone number including country code
    if (smsSent){
      SerialUSB.println("SMS sent!");
   } else {
      SerialUSB.println("SMS NOT SENT!");
    }
  }
}

Hello there.

I don’t know if that has something to do with your problem, but the way the USB Serial port should be used is different:

while ((!SerialUSB) && (millis()<10000));

is what I use in the setup() method of my sketch. No need for a SerialUSB.begin(). Also, no need to setup a baud rate for this port. This line of code actually waits for a USB serial port connection to come up at startup. If there is no USB serial connection found during startup, after 10 seconds this line times out and continues with the rest of the sketch.

After this line, just use SerialUSB as normal:
SerialUSB.println("some stuff");

Another thing: I don’t see you issuing
digitalWrite(BEE_VCC, HIGH);
to switch on the VCC for the Bee socket

nor issuing
gprsbee.init(Serial1, CTS, DTR);
to initialize the GPRSBee to the serial port of the autonomo…

These are used in the Gprsbee github examples

I did not go for this approach however, I used a slightly modified sim800Client library for GPRS/SMS communications.

good luck.

Hi Ceebas,

The SerialUSB does not require an initialisation (begin()) with a baudrate, however, it doesn’t have any negative effect either.

You can also choose to add the start delay as suggested by BelgoTrack, but this mainly just ensures that you don’t miss any of the initial output.

There is an updated initialisation method in the GPRSbee library. It is designed to specifically work with the switching requirements of the Autonomo:

gprsbee.initAutonomoSIM800(Serial1, BEEDTR, BEE_VCC, BEECTS);

Using the above method removes the requirement for you to manually control BEE_VCC.

Additionally it may be useful to debug what is going on with the GPRSbee:

gprsbee.setDiag(SerialUSB);

Sorry for the late reply. I am glad to report I have got the GPRSBee working! Thanks.