Send Temp Data Using Adafruit Fona GSM Module on Arduino

Hi There,

Using the example code provided UbidotsSaveValue I have filled out my network settings and the Token and ID for my Ubidots data source. However when I upload and run the code it brings up this in the serial monitor. Any ideas on what I am doing wrong?

"Opening port
Port open
Response of GPRS:

Response of GPRS:

Error with AT+CSQ
Response of GPRS:

No HTTP to close
{“value”:157.000}
Response of GPRS:

Error with AT+HTTPINIT. Reset the Arduino, will you?
09RSjgqLlcawZ67BO4L0rkRjijHUnP
Response of GPRS:

Error with AT+HTTPARA URL
Response of GPRS:

No HTTP to close
Response of GPRS:"

@StevieG are you using this guide? https://github.com/ubidots/ubidots-arduino-gprs

I was using this guide here; http://ubidots.com/docs/devices/FONA.html#adafruit-fona-minigsm

I’ve had a look at this guide https://github.com/ubidots/ubidots-arduino-gprs but when I try to comiple the sketch I just get a load of errors about having not defined values

What board are you using? FONA or GPRS shield?

Im using the Fona

did you do this step? “Before running our examples please, downolad Adafruit_FONA library and run FONAtest example”

yes i have done that step and i get a signal and have tested turning on the gprs using this sketch example

@StevieG i will update the library, it is an error that happens somethimes. I will give you an answer with the new version as soon as possible.

thank you very much! any idea how long that will take?

I may take about 12 hours for all iterations but i will try to do a sample from about 2 or 3 hours

thanks. I’ll wait for the full version with all iterations to be released. Good luck with updating the library!

did you manage to update the library and if so do you have the link to download it?

Hello @StevieG This is the link of branch that i uploaded, please change pin connection and try this new version:

Vio –> 5V (or 3V, if your Arduino has 3V logic)
GND –> GND
FONA_RX –> Pin 2
FONA_TX –> Pin 3
FONA_RST –> Pin 4
FONA_KEY –> GND

https://github.com/ubidots/Ubidots-FONA/tree/metavix/fixing_problems

The new example to send variables is this:


#include <UbidotsFONA.h>
#include <SoftwareSerial.h>


#define APN  ""  // The APN of your operator
#define USER ""  // if your apn doesnt have username just leave it ""
#define PASS ""  // if your apn doesnt have password just leave it ""
#define TOKEN "Your_token_here"  // Replace it with your Ubidots token

Ubidots client(TOKEN);  
  
void setup() {
  Serial.begin(115200);
  delay(2000);
  while(!client.setApn(APN, USER, PASS));
}

void loop() {
  float value = analogRead(A0);
  client.add("Variable_Label", value);
  client.sendAll();
}

Hi Metavix. I’m having the same trouble using Ubidots with the FONA 808. I’m using an arduino mega. I wanted to alert you that with the new library modifications the example code is no longer compiling. Please look into it.

I haven’t got round to testing the new library on the arduino uno and the Fona 800. I will try and get back to you when im at work tomorrow and have tried it out.

Hi Metavix, I have tried the new library and it wont compile. It is coming up with this error.

Compiling debug version of ‘Ubidots’ for ‘Arduino/Genuino Uno’
UbidotsFONA.cpp:389:26: error: no ‘void Ubidots::flushInput()’ member function declared in class 'Ubidots
void Ubidots*:flushInput() {
Error compiling libraries`

@StevieG i fixed it, try again please
@sarosdst old examples or new examples?

Remember to delete the old version of library and after that add the new version, or it won’t compile

Hey, thanks for the update. Now when I compile and upload the code I get this error.

Error with AT+CIPMUX
FONA/2.0|POST|09RSjgqLlcawZ67BO4L0rkRjijHUnP|FONA=>Variable_Label:148.00|end

This is the full serial output I get with the errors.

Attempting to open comm with ATs
Response of FONA:
CJCJCBg”þ
Error
Response of FONA:
AT
OK

Call Ready

SMS Ready

Response of FONA:
ATE0
OK

Response of FONA:
OK

Response of FONA:
OK

Response of FONA:
+CREG: 0,1

OK

Response of FONA:
+CSQ: 8,0

OK

Response of FONA:
+CGATT: 1

OK

Response of FONA:
OK

Response of FONA:
OK

Response of FONA:
OK

Response of FONA:
OK

Response of FONA:
OK

Response of FONA:
+SAPBR: 1,1,"10.22.159.21
FONA/2.0|POST|5790bd4f7625427703cf8edf|FONA=>Variable_Label:149.00|end
Response of FONA:
OK

Response of FONA:
STATE: PDP DEACT

CONþ
Error with AT+CIPSTART
FONA/2.0|POST|5790bd4f7625427703cf8edf|FONA=>Variable_Label:149.00|end
Response of FONA:
ERROR

Error with AT+CIPMUX
FONA/2.0|POST|5790bd4f7625427703cf8edf|FONA=>Variable_Label:148.00|end
Response of FONA:
ERROR"