I've been trying to set up a connection between my Particle device (Argon and Photon2) and Ubidots dashboard using webhooks, but I'm encountering some issues. Despite following the guides provided by Ubidots, I can't seem to get any data to show up on my dashboard.
Here's what I've done so far:
Created webhooks on Particle integration as per the instructions.
Configured the webhook URLs, request type, and JSON data.
Verified device setup on Particle and assigned variables correctly.
Created a new dashboard on Ubidots with the necessary data sources and variables.
Ensured that the Particle device is sending analog values.
However, despite all this, I'm still not seeing any data updates on my Ubidots dashboard. I even tried deleting the demo device and dashboard and starting fresh with a mini dashboard, but no luck. Since I have redo the dashboard I have to wait till ubidots receive data to have a device showned.
Has anyone else experienced similar issues with Particle-Ubidots integration? Any tips or troubleshooting steps you can suggest? I'd appreciate any help or insights you can provide!
Also here is the exemple code :
// This #include statement was automatically added by the Particle IDE.
#include <Ubidots.h>
const char *WEBHOOK_NAME = "Gyro";
Ubidots ubidots("webhook", UBI_PARTICLE);
void setup()
{
Serial.begin(115200);
ubidots.setDebug(true); // Uncomment this line for printing debug messages
}
void loop()
{
float value1 = analogRead(A0);
float value2 = analogRead(A1);
float value3 = analogRead(A2);
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(WEBHOOK_NAME, PUBLIC); // Will use particle webhooks to send data
if (bufferSent)
{
// Do something if values were sent properly
Serial.println("Values sent by the device");
}
delay(5000);
}
I tried the line of code you provided, but it didn't work. Additionally, I no longer have a demo dashboard or demo device to test with since I deleted them.
Before deleting them, I followed your instructions exactly while using the demo dashboard and device, but I still wasn't able to get my device to show up in the device tab. and finally I did use my token, not the API key.
In the ubidots tutorial it states that for the device to be displayed in the dashboard the particle device must send data. maybe we could start by checking if argon is actually sending data. (via code and in the console)
Here is the code with the line of code that you provided :
// This #include statement was automatically added by the Particle IDE.
#include <Ubidots.h>
const char *WEBHOOK_NAME = "Gyro";
Ubidots ubidots("webhook", UBI_PARTICLE);
void setup()
{
Serial.begin(115200);
ubidots.setDebug(true); // Uncomment this line for printing debug messages
}
void loop()
{
float value1 = analogRead(A0);
float value2 = analogRead(A1);
float value3 = analogRead(A2);
Particle.publish("variable_name_one", String(value1));
Particle.publish("variable_name_two", String(value2));
Particle.publish("variable_name_three", String(value3));
bool bufferSent = false;
bufferSent = ubidots.send(WEBHOOK_NAME, PUBLIC); // Will use particle webhooks to send data
if (bufferSent)
{
// Do something if values were sent properly
Serial.println("Values sent by the device");
}
delay(5000);
}
One thing I have notice is that we're using those sort of function :
You need click on INTEGRATIONS on the left side, then click on the webhook and scroll to the bottom.
Let me know whether you see red crosses or blue check marks.
Remember, if you see data in console, it only means that it has been published by your Particle device and has reached Particle Cloud. It is not a sign of whether the API on the other side received the data as expected.
This you can see oil the webhooks section as it will show you the responses from the servers as well. For now, let's focus on the Check marks or the RED Crosses
Ok, that is the issue then, your webhook is not triggering, meaning we are not triggering you webhook from your code. I have use the same tutorial, try to cope and past the code below:
// This #include statement was automatically added by the Particle IDE.
#include <Ubidots.h>
// This example sends data to a variable to
// Ubidots using Particle Webhooks.
const char *WEBHOOK_NAME = "Ubidots";
Ubidots ubidots("webhook", UBI_PARTICLE);
void setup()
{
Serial.begin(115200);
//ubidots.setDebug(true); // Uncomment this line for printing debug messages
}
void loop()
{
float value1 = analogRead(A0);
ubidots.add("Variable_Name_One", value1); // Change for your variable name
Particle.publish("Variable_Name_One", String(value1));
bool bufferSent = false;
bufferSent = ubidots.send(WEBHOOK_NAME, PUBLIC); // Will use particle webhooks to send data
if (bufferSent)
{
// Do something if values were sent properly
Particle.publish("Values sent by the device");
}
delay(30000);
}
Set up your webhook as before, please give it the name Ubidots as per the code.
Let me know if this works. You should now see the webhook pu blessing the value it is reading from A0. For now you do not have to connect anything, the pin is floating so it will take whatever reading is on the pin at that stage.
// This #include statement was automatically added by the Particle IDE.
#include <Ubidots.h>
// This example sends data to a variable to
// Ubidots using Particle Webhooks.
const char *WEBHOOK_NAME = "Ubidots";
Ubidots ubidots("webhook", UBI_PARTICLE);
void setup()
{
Serial.begin(115200);
//ubidots.setDebug(true); // Uncomment this line for printing debug messages
}
void loop()
{
float value1 = analogRead(A0);
ubidots.add("Variable_Name_One", value1); // Change for your variable name
Particle.publish("Variable_Name_One", String(value1));
bool bufferSent = false;
bufferSent = ubidots.send(WEBHOOK_NAME, PUBLIC); // Will use particle webhooks to send data
if (bufferSent)
{
// Do something if values were sent properly
Particle.publish("Values sent by the device");
}
delay(30000);
}
It is supposed to that simple. Really is easy. You do not have to create anything on Ubidots side for now, aside from the account so you can get a token.
Remember, you are not looking for the API token, but the one on the right