Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Remote API » TcMenu and MQTT

Author: mjd
14/11/2022 01:43:01
Hi Dave,

Been working with TcMenu and wanted to know your plans and thoughts on implementing MQTT for remote control? My interest is strictly with ESP32 and 8266.

I've got the wifioled example running with encoder and it is works very well. My issue is that i need to communicate with remote nodes who run servos. It's all coordinated through nodered via mqtt messaging.

i'm not sure of the right way to even think about adding MQTT capability as you have already tackled so much such as the wifi, tagval protocol, connection handling, remote menu items and so on.

Please let me know your thoughts on how this might best fit into TcMenu.

Best,

Mike

Author: davetcc
15/11/2022 23:12:52
I imagine it would be relatively [edit] trivial to integrate Tc menu with MQTT. There is a longer term plan to try and build plugins for third party IoT solutions that are supported out the box

But even without that there are people out there that have integrated libraries themselves. All the building blocks are there.

Author: davetcc
17/11/2022 08:58:27
Sorry busy week this week. In terms of the how.

You’d probably start a task manager task that watches for items being updated and sends to your endpoint. You can use the menu item remote change flags to determine that. Take a look at MenuItem.h in the library.

For incoming state changes you’d just change the value of the menu item. You can determine the item then apply the change. All the value setters have an optional silent flag that prevents the callback if needed.

Author: davetcc
17/11/2022 08:59:50
Simplest example to look at for this would probably be the simhub example packaged with the library.

Author: mjd
19/11/2022 22:38:40
Dave,

Thank you very much for the insights. I will take a look at the simhub example.

Mike




Register / Login  |  Desktop view  |  Jump to top of page