简体   繁体   中英

Connecting AWS MQTT via websocket

I am trying to connect a sensor to an AWS MQTT Broker to a database that will send it to a webserver so that it can be easily accessible. Right now the only way people in our lab can have access to our sensor data is through contacting me directly and having me connect to the Node Red dashboard. Would there be any way for everyone to have access to the data via WebSocket, or at least a couple of people?

I've searched for hours on end and have had no success regarding the ease of accessibility.

From what I've researched there is this a java based client called MQTT.Cool that can connect multiple brokers and have data published via WebSocket using JavaScript. However there is literally no data available except the ones provided by the company. So combining it it with my project has not been an easy task.

Also, I've thought about allowing my node red dashboard to be accessed out of my local ip-address, but due to security reasons it has been recommended not to be done.

AWS IoT provides an SDK that you can use in your browser: https://github.com/aws/aws-iot-device-sdk-js#browser

You can write a web application and view the contents returned by the database after logging in If you need to browse in real-time, you can use mqtt.js to subscribe to some topics: https://www.emqx.com/en/blog/connect-to-mqtt-broker-with-websocket

Or use MQTTX, a client tool, to connect directly to the MQTT broker and subscribe to topic

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