GprsBEE last rev with Mbili rev 6b ON/OFF Method

In the library of grpsBee read me …

We can not understand which methods to always set the gprsbee module ON or OFF.

For init gprs Bee and send a url uin GET we use this code that works:

#define APN “mobile.vodafone.it”

#define APN_USERNAME “”

#define APN_PASSWORD “”

#include “GPRSbee.h”

void setup()
{
//Wait until the serial monitor is ready/open
while(!Serial);

// USB serial
Serial.begin(57600);
Serial.println(“TEST GprsBEE GET every 10 sec”);

// GprsBEE serial
Serial1.begin(9600);
gprsbee.initAutonomoSIM800(Serial1, -1, BEEDTR, BEECTS);

gprsbee.setDiag(Serial);

}

void loop()
{
char buffer[512];

memset(buffer, ‘\0’, sizeof(buffer));
Serial.println(“Invio il GET…”);
bool retval = gprsbee.doHTTPGET(APN, APN_USERNAME, APN_PASSWORD,
http://httpbin.org/get”, buffer, sizeof(buffer));

Serial.println(retval);
Serial.println("GET result: ");

//Lets be safe in case result length > 247
for (int i=0; i<strlen(buffer); i++) {
Serial.print(buffer[i]);
}
delay(10000);
}

But the the gprsbee power on only when send a get url, then switch OFF.

we would like it to always remain on ON from setup and decide when to switch OFF by the code.

Please send a sketch for mbili rev6b.
Our power connection is this http://support.sodaq.com/wp-content/uploads/2016/02/gprs-wiring-1.jpg

but mbili rev 6b dont have connector JP2 !!!

Thanks

The GPRSbee library is specifically designed with power saving in mind.

For this purpose it defaults to being powered off when not in use. When a specific action is required, it powers up the device, runs through the initialisation and connection sequences, performs the requested action and then powers down. The TCP functionality allows you to keep the connection open and perform additional tasks, however, I don’t believe the HTTP functions support this.

You could try passing -1 as the third parameter during initialisation as this is the pin which is used for toggling the power:

gprsbee.initAutonomoSIM800(Serial1, -1, -1, BEECTS);

This will prevent the GPRSbee library from switching the device off (or on). You should then be able to switch the GPRSbee on or off by setting the level of BEEDTR (HIGH is on).

Note: Some of the old switching methods, as mentioned in the readme, are no longer supported.

Thanks i try in this mode.

thanks Gabriel i try this code:

#include "GPRSbee.h"

void setup()
{
  //Wait until the serial monitor is ready/open
  while (!Serial);

  Serial.begin(57600);
  Serial.println("TEST GprsBEE ON and OFF with delay 20 sec");

  // GprsBEE serial
  Serial1.begin(9600);

  // init GPRSbee by Gabriel
  gprsbee.initAutonomoSIM800(Serial1, -1, -1, BEECTS);  

  //show AT on serial
  gprsbee.setDiag(Serial);

  // set pin BEEDTR to LOW no power at gprBEE module
  pinMode(BEEDTR , OUTPUT);
  digitalWrite(BEEDTR , LOW);
  
  // assure that the AT comand are off
  gprsbee.off();

}

void loop()
{
  Serial.println("GPRSbee ON...");
  
      // ON 1 of 3 
      digitalWrite(BEEDTR , HIGH);
      // ON 2 of 3 
      delay(5000);
       // ON 3 of 3 
      gprsbee.on();
      
  Serial.println("waiting 20 sec...");
  delay(20000);
  Serial.println("GPRSbee OFF");
  
      // OFF 1 of 2
      gprsbee.off();
       // OFF 2 of 2
      digitalWrite(BEEDTR , LOW);
      
  Serial.println("waiting 20 sec...");
  delay(20000);

}

Works FINE !

Thanks!