Aspdotnet core web
MISSEY opened this issue · 3 comments
I didn't understand how to use from the description, I want to use MQTT client in a controller, to fetch information from sensors and publish them on view(cshtml).
Please help me
Thank you in advance
You can't use MQTT client in a web controller directly, you can use signalR or web socket to fetch real time data from your MQTT client. HTTP request is independent, every request doesn't carry information about last one.
You can check https://github.com/rafiulgits/IotHub
I developed a IotHub, where IotHub.Agent
can help you, It's using a MQTT client and SignalR, MQTT client communicate with MQTT broker and SignalR used as a channel between a web client and MQTT client.
Sorry for late response 👍
Can you explain me the flow of your app.
My requirement is:
On a button press, I have to publish messages on different channels, on separate logic.
Thank you
@MISSEY
That's up to, how you want to design you system. Its better to have a look the MQTTnet documentation, which may help to fulfill your requirements .