Ubidots Integration: Getting Data on Dashboard via Webhooks

Hey everyone,

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);
}

Here is the screenshots of my dashboard :

And here is a screenshot with the device sending data to ubidots :

Thanks in advance.

Hi @Nayel -

Are you sending your UBIDOTS token with the webhook data?

Under the HTTP HEADERS section you should have a field X-AUTH-TOKEN and the your token in die Data field

Regards,
Friedl.

1 Like

HI @friedl_1977,

Yes, I've done the same. Just to be sure, the token is the one in the API credential section, right?

Here is a screenshot of what I have setup :

Best regards,
Nayel

Hi @Nayel -

First thing you can try is this:

    Particle.publish("Variable_Name_One", String(value1));

As apposed to sending there integer values. Not sure if this is an issue, but in my code I send it as Strings.

The second thing, did you assign variables to your gauges in Ubidots? Please see below:

Also, you need to use the TOKEN, not API Key if I am not mistaken. Just make sure you use the right one :slight_smile:

Lastly, check whether your device is actually showing up under DEVICES tab. Coming to think of it, this should have been my first question :rofl:

Regards,
Friedl

Hi @friedl_1977,

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.

Best regards,
Nayel

Hi @Nayel -

Hmm... that is strange indeed, as I followed the same instructions to set up a new instance and the device showed up after the forst post.

There is something else we could check, but if you do not have the dashboard or device to test with, it will not be possible.

Regards,
Friedl.

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 screenshot of 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 :

Do I need to modify what's inside the arrow ? maybe this is the problerm?

Like the {{{PARTICLE_EVENT_VALUE}}} and {{{PARTICLE_DEVICE_ID}}} do I need to modify what's inside the arrow?

best regards,
Nayel

Hi -

Ok, here is where I would start, see the screen grab below:

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 :slight_smile:

Regards
Friedl

Hi @friedl_1977,

Alrighty then,

For now I have nothing :

Best regards,
Nayel

Hi -

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.

Here is a link to the app in WebIDE.

Here is my webhook setup:

1 Like

Hi-

Here is what I have on the console :

And here is what I have on the integretion Logs :

And here is my configuration for the webhook :

And as for the code :

// 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);
}

RE : My bad I have something on the logs :

Regards,
Nayel

Hi -

Change you webhook to allow all devices to use the webhook and see if that resolves the issue.

ok, click on the top one so it expands and send me a screengrab

Hi-

Sure thing :

image

Hi -

This is mind boggling. I can think only think of one of two things:

  1. Either your TOKEN is invalid
  2. Disable 'Enforce SSL' in webhook setup.

Please check these two things.

Regards

Hi -

I already deactivate the SSL thingy, for the tokent I will try to create another account, just to be sure.

Really weird this thing joy:

Regards,
Nayel

Hi Nayel -

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 :wink:

1 Like

Hi -

I did the change of the token but nothing :

I really don't understand what's going on, maybe I messed up the configuration of the webhook.

Regards
Nayel

Hi Nayel -

My next move would be to delete the webhook and redo it. I can see no reason why your setup is not working, it all seems to be in order.

Please let me know, would like to get to the bottom of this.

Regards
Friedl