Quite slow at reading variables


#1

Hi, quite new to Ubidots. I’m using a device to write 3 varables to Ubidots, and another device to read and showing them in a LCD display.
Technically speaking, everything works fine, the only issue I’m having is that reading the three variables takes about two minutes, a bit too long for me…
To retrieve the three variables I’m using a sketch running in a Wemos D1 mini board (by using Arduino IDE). The board connect to Internet by WiFi.
The library I’m using to access the variables is taken from Github (named “ubidots/ubidots-nodemcu”).
The instruction to retrieve a single variable is as simple as
float temp = client.getValue(TEMPERATURE);
(where TEMPERATURE is an alias for the Ubidots variable ID).
Of course, I’m making three separate calls, one for each variable.
In the serial window I can see the command progressing, no sign of errors, the retrieved values are correct, the only complain is about slowness…
Is it normal? Is there anything I can do to get better response time?


#2

The library you are using is based on HTTP, please use MQTT for faster answers:

Regards


#3

Thank you very much for your reply.
I tried the example included in the library, but couldn’t make it to work.

Output on serial is:

....WiFi connected IP address: 192.168.1.74 /v1.6/devices///lv Attempting MQTT connection...connected

Then I would expect some text to appear when the variable changes its value, but get nothing…
I may be doing some stupid mistake…
Any clue?


#4

… sorry the output went badly formatted in my previous post, I used a bad bracket that screwed the HTML of the text, it should read:

(some garbage…)
…WiFi connected
IP address:
192.168.1.74
/v1.6/devices/(my data source)/(my variable)/lv
Attempting MQTT connection…connected


#5

Please take a look to this tutorial, it may help you for getting data using MQTT:

Regards