Hello everybody,
I followed the introductional tutorial and took the path down to a tutorial that wants to show how to use ubidots with an ESP32
the tutorial shows most steps but some parts are missing which lead to a compiler-error when I tried to compile the sourcecode
The code has two constants
const char* DEVICE_LABEL_TO_RETRIEVE_VALUES_FROM = "DEV_LABEL"; // Replace with your device label
const char* VARIABLE_LABEL_TO_RETRIEVE_VALUES_FROM = "VAR_LABEL"; // Replace with your variable label
But the tutorial says nothing about how to setup these constants.
I did some searching on the ubidots website but with no success.
To me the userguides section and the developer-guide section looks like a messed up collection of randomly chosen examples of pretty particular customer projects.
So where can I find a tutorial on how to setup these two constants
const char* DEVICE_LABEL_TO_RETRIEVE_VALUES_FROM = “DEV_LABEL”; // Replace with your device label
const char* VARIABLE_LABEL_TO_RETRIEVE_VALUES_FROM = “VAR_LABEL”; // Replace with your variable label
from this example-code
/****************************************
* Include Libraries
****************************************/
#include "Ubidots.h"
/****************************************
* Define Instances and Constants
****************************************/
const char* UBIDOTS_TOKEN = "..."; // Put here your Ubidots TOKEN
const char* WIFI_SSID = "..."; // Put here your Wi-Fi SSID
const char* WIFI_PASS = "..."; // Put here your Wi-Fi password
Ubidots ubidots(UBIDOTS_TOKEN, UBI_HTTP);
// Ubidots ubidots(UBIDOTS_TOKEN, UBI_TCP); // Uncomment to use TCP
// Ubidots ubidots(UBIDOTS_TOKEN, UBI_UDP); // Uncomment to use UDP
/****************************************
* Auxiliar Functions
****************************************/
// Put here your auxiliar functions
/****************************************
* Main Functions
****************************************/
void setup() {
Serial.begin(115200);
ubidots.wifiConnect(WIFI_SSID, WIFI_PASS);
// ubidots.setDebug(true); // Uncomment this line for printing debug messages
}
void loop() {
float value1 = random(0, 9) * 10;
float value2 = random(0, 9) * 100;
float value3 = random(0, 9) * 1000;
ubidots.add("Variable_Name_One", value1); // Change for your variable name
ubidots.add("Variable_Name_Two", value2);
ubidots.add("Variable_Name_Three", value3);
bool bufferSent = false;
bufferSent = ubidots.send(); // Will send data to a device label that matches the device Id
if (bufferSent) {
// Do something if values were sent properly
Serial.println("Values sent by the device");
}
delay(5000);
}
to make the code compile and successfully interact with the ubidots-server
best regards Stefan