donskytech / mqtt-custom-dashboard-node-js

A custom MQTT dashboard built using Node.js that can be used to display sensor readings from a BME280 sensor
Apache License 2.0
42 stars 30 forks source link

mqtt websocket change to mqtt #1

Open runtimevic opened 1 year ago

runtimevic commented 1 year ago

Hello @donskytech I'm trying instead of mqtt websocket with mqtt and it doesn't work for me, do you know why?

mqtt websocket: MQTT_BROKER=ws://127.0.0.1:9001/mqtt

mqtt: MQTT_BROKER=mqtt://127.0.0.1:1883

thanks you.

donskytech commented 1 year ago

Hey, if you want something like this then you can do it on the server side not on the browser side. Use mqtt.js library on your app.js.

runtimevic commented 1 year ago

Hi @donskytech Do you have any videos on YouTube or repository that can be viewed server side use mqtt.js library?

donskytech commented 1 year ago

I find this one, a good introductory for this topic https://www.emqx.com/en/blog/how-to-use-mqtt-in-nodejs