Autonomo GPRSBee FTP working sample?

Gentlemen,

I use the GPRSBeeGitHub library :keestux/GPRSbee.

I am using the Test_FTP sketch on my autonomo.

This sketch needs some modifications before it passes the compiler.

My code is more or less this:

#include '<GPRSbee.h>
#define APN "portalmmm.nl"

#define SERVER "XXXXXX"#define USERNAME “”
#define PASSWORD ""#define FTPPATH “XXXXXX”

digitalWrite(BEE_VCC, HIGH);
while (!SerialUSB);

SerialUSB.begin(9600);
SerialUSB.println("GPRS test!");

Serial1.begin(19200);          // Serial1 is connected to SIM900 GPRSbee

gprsbee.initAutonomoSIM800(Serial1, BEEDTR, BEE_VCC, BEECTS);
gprsbee.setDiag(SerialUSB);
gprsbee.on();

SerialUSB.println("Program start in 4 seconds");

delay(4000);

SerialUSB.println("openFTP");

if (!gprsbee.openFTP(APN, SERVER, USERNAME, PASSWORD)) {
	SerialUSB.println("GPRS open failed!");
	return;
}

The output is as follows:

Opening port
Port open
GPRS test!
on powerPin, vbatPin

AT
Port open
readLine timed out

AT
AT
OK

AT+CIURC=0
AT+CIURC=0
OK
Program start in 4 seconds
openFTP

AT
AT
OK

AT+CIURC=0
AT+CIURC=0
OK

ATE0
ATE0
OK

AT+CSQ

+CSQ: 17,0

OK

AT+CREG?

+CREG: 0,0

OK

AT

OK

AT+CREG?

+CREG: 0,0

OK

AT

OK

AT+CREG?

+CREG: 0,0

And it never comes out.

I wrote my own set of AT commands and sent them directy to the SIM800 and AT+CREG? returns +CREG: 0,1. So I have no hardware of SIM issues.

Anybody who has a working GPRS FTP autonomo Sketch?

I noticed that the Test_FTP sketch is already two years old.

Axel

A couple of questions.

Does your APN require a username or password?
Do you have the battery connected when testing this?

Hi axel

I tested it with my GPRSbee and it worked

#include <GPRSbee.h>

#define APN "apn.provider.com"
#define APN_USERNAME ""
#define APN_PASSWORD ""

#define SERVER "xxxxxxxx"
#define USERNAME "xxxxxxxxxxx"
#define PASSWORD "xxxxxxxxxxx"
#define FTPPATH ""

void setup() {

  digitalWrite(BEE_VCC, HIGH);
  while (!SerialUSB);
  
  SerialUSB.begin(9600);
  SerialUSB.println("GPRS test!");
  
  Serial1.begin(19200);          // Serial1 is connected to SIM900 GPRSbee
  
  gprsbee.initAutonomoSIM800(Serial1, BEEDTR, BEE_VCC, BEECTS);
  gprsbee.setDiag(SerialUSB);
  gprsbee.on();
  
  SerialUSB.println("Program start in 4 seconds");
  
  delay(4000);
  
  SerialUSB.println("openFTP");
  
  if (!gprsbee.openFTP(APN, SERVER, USERNAME, PASSWORD)) {
      SerialUSB.println("GPRS open failed!");
       return;
  }

}

void loop() {
  // put your main code here, to run repeatedly:

}

+CREG: 0,0 might be a hint, that the module can not register in the network. You are sure that there is no issue with the SIM PIN? By the way it would be cool if a method for SIM PIN handling was included in a futher version of the library :wink:

I got the lib from

Cheers

Chris,

You put me in the right direction: It was indeed missing the PIN code. I added one line in my code after gprsbee.on();: Serial1.println("AT+CPIN=0000"); and it is working (at least the CREG 0,0 problem. Now have to verify the FTP settings).

This leaves the following question for me: how can both sample codes work without setting the PIN?

Also it is quite confusing which libray to use: there is the Keestux one and the SodaqMoja one. Having the same name, different versions, and maybe different functionality? I was using the SodaqMoja one because somewhere I found out by verifying file dates the was the latest one.

Glad it works now!

Thanks,

Axel

I would recommend removing the pin restriction from the sim card, otherwise you will have issues with using the library and with many of the examples.

The GPRSbee library is available through the Arduino library manager. This will provide you with the latest official release (1.3.0). Alternatively you can get it from the SodaqMoja github page: https://github.com/SodaqMoja/GPRSbee
I would recommend sourcing from that repository as it contains the official release versions.

Hi Gabriel,

Thanks for your suggestions. I am not familiar with removing PIN restrictions. Can I use the GPRSBee c.q. the library for this?

Do all the SodaqMoJa libraries also work on Autonomo?

Last question is important as I spent quite a lot of time looking for the correct libraries already.

Best,

Axel

It would probably be easiest to use a phone to turn off the pin lock on the sim.
There are probably AT commands for this, but I’m not familiar them specifically.

Most of the libraries on the SodaqMoja Github will be compatible with the Autonomo. Many of these libraries will have release versions available through the Arduino library manager.

A few of the libraries work very closely with the AVR hardware and so are not available for the SAMD platform [Autonomo]. These include: Sodaq_PcInt & Sodaq_SoftSerial.