Ubidots code sample won't compile on Uno WiFi Rev2

The Ubidots sample code for uploading data from a MKR WIFI 1010 is supposedly compatible with Uno wifi Rev2, but compiling fails, with the info below. I don’t yet have the experience to make heads or tails of the error message. Thanks in advance for any insight.


Arduino: 1.8.14 Hourly Build 2020/08/27 12:33 (Mac OS X), Board: “Arduino Uno WiFi Rev2, ATMEGA328”

/Users/ronsweet/Documents/Arduino/libraries/ubidots-ArduinoMKR-master/src/UbiHttp.cpp: In member function ‘double UbiHTTP::_parseServerAnswer()’:
/Users/ronsweet/Documents/Arduino/libraries/ubidots-ArduinoMKR-master/src/UbiHttp.cpp:253:18: error: ‘strtof’ was not declared in this scope
double value = strtof(_charValue, NULL);
^~~~~~
/Users/ronsweet/Documents/Arduino/libraries/ubidots-ArduinoMKR-master/src/UbiHttp.cpp:253:18: note: suggested alternative: ‘strtok’
double value = strtof(_charValue, NULL);
^~~~~~
strtok
exit status 1
Error compiling for board Arduino Uno WiFi Rev2.

Hi there, did you download the latest version of the library? At my side, it compiles properly:

I will be attentive

Thanks for the response, jotathebest…I have the version from github, which I assume is the latest version. When you compiled it successfully, was it for the UNO Wifi Rev2 or the MKR1010? Thanks again.

Ron

Your error seems related with your compiler rather than with our library, the method strtof() is a native C++ one, but from your report, your compiler does not recognize it. Including the C string library headers in your sketch

#include <string>
#include <string>

may solve the issue.

Thanks for the response. I had to put this project aside, but now revisiting. I tried your suggestion to add:

#include

Attempting to compile now fails with this error:


UbidotsTest:12:10: fatal error: string: No such file or directory
#include
^~~~~~~~
compilation terminated.
exit status 1
string: No such file or directory

I’m not sure why you suggested to add that “include” statement twice.

So I’m still having the compile failure. Reminder that I’m compiling within the Arduino IDE.

Any other suggestions?

Thanks again,

Ron

Hi…the Ubidots group made a few changes in the ConfigManager Library to execute a normal that dispatches the AP mode by basically squeezing an outside reset button.

Contingent upon the ESP8266 module you pick, you may need to appoint the reset pin utilizing this library variant. The default button settings are doled out to PIN 5; if utilizing a NodeMCU, you should associate the catch into the D1 pin.

order pcb

Dear Rsweet,
I dont know you are still having the issue or not. I was also faced the issue. The problem was with the microcontroller compatibility(ATmega4908). So i wrote a new library for Arduino Uno Wifi Rev2 support for Ubidots.
Kindly try the library by following this link : https://github.com/suhail-jr/Ubidots_Uno_Wifi