简体   繁体   中英

Python Sending dht22 sensor data to web page with websocket API

I'm using raspberry Pi3 device connected with dht22 sensoer that read temperature and humdity, python code send sensored data to myChannel on thingSpeak storage server and tweets information on twitter, till this my project working correctly.

But i want to send also sensored information on webPage using websocket. I've searched alot for this but i didnot find good answers, if there is away to connect Websocket with thingSpaek and get data directly or from Pi device?

Thanks,

ThingSpeak allows MQTT clients to subscribe to its telemetry. I believe MQTT over Web Sockets should also be supported (Cannot confirm).

https://www.mathworks.com/help/thingspeak/subscribetoachannelfeed.html

One way or the other, you can use a javascript MQTT client such as paho to subscribe to ThingSpeak topics on your web page

https://www.eclipse.org/paho/clients/js/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM