[SOLVED] DS18B20Temp Sensor to Uno/FONA to Ubidots " No Data Avalible"

Hello
I have looked high and low, for the correct way to use a Uno/FONA, to send variables from a DS18B20 digital thermometer, to Ubidots. I have not come across a sketch that I can get to work with an IC2 One-Wire, and I have found little, to nothing in the way of help on the internet. I am hoping someone here can clear the murky waters, and compile a working sketch for using a Uno/FONA with a digital sensor attached.
I believe a working, FONA to Ubidot sketch would be a big plus for the community, I have tried the FONA mini (I have a shield) sketch found on this site, but my temp widget shows “No Avalible Data” I have been able to send SMS, and read the digital thermometer using Arduino/Adafruit sketches in the Arduino Monitor, and used the FONAs Key-14pin (gnd), making the pins state high, to place a call. All for testing hardware only. Have had no luck with getting the Ubidot sketch to send data to my Ubidot temperature widget I created. Used token and Variable ID`s in sketch.

What I hope this Sketch will do is:

  1. Have Uno read pin that has the Ic2 Sensors data running to it, and using the FONA, send it off to Ubidot.
  2. And if you could make it for a IC2 one-wire would be very helpful, as well as perhaps examples using analog, and digital for use with other types of sensors in the void senseValues() would be helpful, they could be commented out(//), for use when needed.

This is Ubidots page for FONA. http://ubidots.com/docs/devices/FONA.html

Thank you one and all. Jack

1 Like

Have not been able to get mine to send any data to Ubidots. Have posted several messages and no luck from Adafruit or Ubidots. Have you been able to send data yet?? If you have you mind please sending me code. Thanks a million.

Hi @jackson58, we have a new library to make it easier to interface the FONA with Ubidots: https://github.com/ubidots/Ubidots-FONA

Once you test it, it should be simple for you to merge it with other code you might have, such as the DS18B20 code.

Have tried new code and sill no luck with data being sent:

#include <Ubidots_FONA.h>
#include <SoftwareSerial.h> 
#include <Adafruit_FONA.h>
#define APN "epc.tmobile.com" 
#define USER ""  // if your apn doesnt have username just put ""
#define PASS ""  // if your apn doesnt have password just put ""
#define TOKEN "twG9BwrMyj23KL455VXxRQGdZ89Q06"  // Remplace it with your token
#define ID "56910c787625423044885ab2" // Remplace it with your variable ID

Ubidots client(TOKEN);  
  
void setup() {
  Serial.begin(115200);
  delay(2000);
  client.gprsNetwork(F(APN),F(USER),F(PASS));  // First set your apn data
}

void loop() {
  //float value = analogRead(A0);  // Reading analog pin A0
  float value = 90;
  
  client.flushSerial();
  client.checkFona();
  client.gprsOnFona();
  client.save_value(value, ID);  
  Serial.println(value);
  delay(600);  // 600 milliseconds 
---> AT
	<--- OK
	---> AT
	<--- OK
	---> AT
	<--- OK
	---> ATE0
	<--- OK
	---> ATE0
	<--- OK
	---> AT+CVHU=0
	<--- OK
	---> ATI
	<--- SIM800 R13.08

OK

FONA is OK
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR
	---> AT+CIPSHUT
	<--- SHUT OK
	---> AT+CGATT=1
	<--- OK
	---> AT+SAPBR=3,1,"CONTYPE","GPRS"
	<--- OK
	---> AT+SAPBR=3,1,"APN","epc.tmobile.com"
	<--- OK
	---> AT+SAPBR=3,1,"USER",""
	<--- OK
	---> AT+SAPBR=3,1,"PWD",""
	<--- OK
	---> AT+SAPBR=1,1
	<--- ERROR

Hello,

The error as seen in the SIM800 manual from Adafruit (https://www.adafruit.com/datasheets/sim800_series_at_command_manual_v1.01.pdf) is because your SIM is not being able to connect to your mobile network:

---> AT+SAPBR=1,1
	<--- ERROR

I would suggest putting the SIM card in a mobile phone, then going to “network settings”, choose “2G only” (the FONA doe not support 3G or 4G and many operators only offer those), set these same APN settings in your mobile, restart the radio, and then see if you can surf the web.

Thanks for all your help guys I finally was able to get this working properly.

Kbnetguy.

Could you please share with use what you did to get it working. Congratulations on your success.

All the best. Jack

@jackson58 are you working already with the ubidots-fona library that was suggested? https://github.com/ubidots/Ubidots-FONA the steps in their readme were very helpful.