8:14 am

January 21, 2019

Hi,I am publishing the Wireless Temperature sensor data to Thingspeak using its MQTT API. The data is publishing successfully, even I am getting MQTT to publish status in thingspeak. However, the value is not updated in the chart. When I am checking the export data the fields are getting null values.
String strx(rms_x,DEC);
String stry(rms_y,DEC);
String dataString = String("field1="+ strx + "&field2=" + stry + "&field3=" + String(cTemp,DEC));
Serial.println(mqttCli.publish(topicBuffer,dataString.c_str())? "published" : "published failed");
Wireless Temperature Sensor : https://store.ncd.io/product/industrial-iot-wireless-temperature-humidity-sensor/
Suggestions on this will be a great help
4:02 pm


Moderators
March 7, 2017

Can you try hard coding a string that you know should work?
String dataString = String("field1=123");
Also can you show the topic string you are using? It should have the form:
channels//publish/
https://www.mathworks.com/help/thingspeak/publishtoachannelfeed.html
2:04 am

January 21, 2019

6:55 am


Moderators
March 7, 2017

Can you clarify
"The data is publishing successfully, even I am getting MQTT to publish status in thingspeak" ?
Are you seeing the number of entries increase on your channel, but not able to see data on your field charts?
Can you export the data (use the export button on the first tab -for the private view of your channel. Then you can see the raw data.
Are you able to publish via MQTT using a desktop based MQTT client, such as MQTT.fx?
The MQTT documentation has links to download MQTT.fx in the examples section.
https://www.mathworks.com/help/thingspeak/mqtt-api.html
There is also a troublehsooting section:
https://www.mathworks.com/help/thingspeak/troubleshoot-MQTT-publish.html
We have seen may devices with libraries that have MQTT buffer sizes too small to complete the request. You may have to increase the buffer size.
Most Users Ever Online: 166
Currently Online:
22 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
rw950431: 272
Vinod: 240
piajola: 95
turgo: 70
vespapierre: 63
Adarsh_Murthy: 62
Member Stats:
Guest Posters: 1
Members: 8665
Moderators: 1
Admins: 2
Forum Stats:
Groups: 3
Forums: 14
Topics: 1600
Posts: 5760
Newest Members:
huldacormier, bogart, estebanmateo93, mikewrite, onlinebusiness, winzy99Moderators: cstapels: 460
Administrators: Hans: 405, lee: 457