[SOLVED] ESP8266 (Adafruit Huzzah) GPS coordinate problem


Hi Guys, brand new here

I want to send sensor data in context with GPS coordinates to Ubidots. As “simulator”, I am hooking up a ESP8266 and while I can send sensor data just fine, the GPS context formatting is not working for me.
I follow this example and my code looks like the one below. I also tried this, no success.


#define TOKEN  "XX"  // Put here your Ubidots TOKEN
#define WIFISSID "XCXC" // Put here your Wi-Fi SSID
#define PASSWORD "CCC" // Put here your Wi-Fi password

Ubidots client(TOKEN);

void setup(){
    client.wifiConnection(WIFISSID, PASSWORD);

void loop(){
    float humid = random(0,30);
    char context[25];
    sprintf(context, "lat=53.2734$lng=-75.5812"); //Sends latitude and longitude for watching position in a map
    client.add("humidity", humid, context);

The serial output is


In the context of my device, I see

and no display into the map.

It would be awesome if someone could just help with with the syntax of that sprintf line, I think that is where the issue lies - not sure why the guthub example doesn’t work…


Hi @osca

Please go inside the “UbidotsMicroESP8266.h” file and replace the following line:
#define SERVER “translate.ubidots.com to #define SERVER "industrial.api.ubidots.com"

This change is due inside the library the URL is set to send data to our Educational platform.

After you make this change, to reflect the location in your map you have to make sure that you are selecting the variable in which you are sending the data location, in the case of the example would be the variable humidity, as shown in the below image.

All the best,


Thanks Isabel!

I managed to get it to work in the end but I think its worth noting that Arduinos (and ESP8266) do not allow float values in the sprintf function. The example you give on github may work with static values but putting GPS lat/lng into variables needs another step. Apparently there are a few ways to do this, I chose dtostrf() and that works well enough.

So for now, thanks for your help, this is [solved].