Page 1 of 1
Readings not updating in Tuya app
Posted: 2024年 Feb 18日 18:07
by intelligadgets
Hello,
I created a product using Arduino Pro Mini and Tuya WRB3 WiFi and Bluetooth module..
Imam using BME680 environmental sensor.
I am able to add the device in Tuya app and when I add it, I can see all the readings in the Custom Console which I created.
However, the readings are not getting updated.
I used the Tuya Debugging Assistant software and found that I am getting the readings only once.
Please see attached image
I have the below in my code already
Code: Select all
void dp_update_all(void)
{
// Update all DPs with current LED state
my_device.mcu_dp_update(DPID_BME680_Hum, humidity, 1);
my_device.mcu_dp_update(DPID_BME680_Temp, temperature, 1);
my_device.mcu_dp_update(DPID_BME680_Press, atmpress, 1);
my_device.mcu_dp_update(DPID_BME680_Gas, voc, 1);
// Update other DPs as needed
}
Any clue what could be wrong?
Re: Readings not updating in Tuya app
Posted: 2024年 Feb 18日 18:40
by chenyisong
The dp_update_all() function is only used to report all dp data after the device is powered on again. To report other data, call the my_device.mcu_dp_update() function at the required location.
Re: Readings not updating in Tuya app
Posted: 2024年 Feb 18日 20:14
by intelligadgets
Thank you..
I added the below in loop and the readings are getting updated in the Tuya Debugging Assistant software..
Code: Select all
temperature = bme.readTemperature();
humidity = bme.readHumidity();
atmpress = bme.readPressure()/100;
voc = bme.readGas()/1000;
my_device.mcu_dp_update(DPID_BME680_Temp, temperature, 1);
my_device.mcu_dp_update(DPID_BME680_Hum, humidity, 1);
my_device.mcu_dp_update(DPID_BME680_Press, atmpress, 1);
my_device.mcu_dp_update(DPID_BME680_Gas, voc, 1);
But it is not getting updated in the app..
any idea what could be wrong?
Re: Readings not updating in Tuya app
Posted: 2024年 Feb 19日 09:33
by yangjie
You can only report when the report value has changed by calling the mcu_dp_update interface. You also need to ensure that the size of the data you report is within the range set on the tuya iot platform. You can print out the reported data and have a look at it.
Re: Readings not updating in Tuya app
Posted: 2024年 Feb 19日 11:33
by intelligadgets
Thanks for your response..
Is there any link or document where I can find more details about data size in reporting and settings in tuya iot platform?
Re: Readings not updating in Tuya app
Posted: 2024年 Feb 19日 11:46
by yangjie
Open the product you want to develop:
click edit:
This means: -100.0 to 100.0.