Giter Site home page Giter Site logo

mqtt-panel's Introduction

mqtt-panel

A simple web interface which is able to subscribe to a MQTT topic and display the information.

The screenshot shows an example how to keep track on what's going in your apartment or your house. It's not about controlling, this setup is about observing various states.

screenshot

What to see mqtt-panel in action -> http://youtu.be/Qb0UJa9kf2g

The web page is using bootstrap with jQuery.

Prerequisites/Installation

Get the files

Clone the mqtt-panel repository

$ git clone [email protected]:fabaff/mqtt-panel.git

Dependencies

mqtt-panel is using the listed projects to provide its functionality:

If you are using Fedora and want to generate MQTT messages, install the paho-mqtt Python bindings.

$ sudo dnf -y install python-paho-mqtt

MQTT broker/server

A MQTT broker/server is needed to run on localhost on port 3000 and providing websocket support.

  • hbmqtt - MQTT broker with build-in websockets capabilities
  • mosca - A multi-transport MQTT broker for node.js
  • mosquitto - An Open Source MQTT v3.1 broker

Running mqtt-panel

  1. Make sure that your MQTT broker/server is running and listening. Or run ./mqtt-server.py to use mqtt-panel with hbmqtt (make sure that you installed it with pip3 install hbmqtt).
  2. Adjust var host = '127.0.0.1'; and var port = 3000; in the file index.html to match your setup.
  3. Open index.html.

Running mqtt-panel with node.js

If you are using Fedora, just use dnf to install node.

$ sudo dnf -y install node npm

then

$ npm install mqtt socket.io
  1. Launch ./runner.sh which will start the node server on port 3000 for the standard node.js example.
  2. Adjust var host = '127.0.0.1'; and var port = 3000; in the file index.html to match your setup.
  3. Open index-node.html with your browser.

Generate MQTT messages

Start the ./test-messages.py script to publish test messages if you have no other source for messages. Depending on your broker you may need to set the supported version. On line 33: protocol=mqtt.MQTTv311

For manually sending messages to your MQTT broker/server you can use mosquitto_pub from mosquitto or hbmqtt_pub.

$ mosquitto_pub -V mqttv311 -h localhost -d -t home/front/door -m "false"

To check if the messages are are ok, subscribe to the topic home/# with mosquitto_sub.

$ mosquitto_sub -V mqttv311 -h localhost -d -t home/#

Credits

mqtt-panel was inspired by the ideas of:

License

mqtt-panel licensed under MIT, for more details check LICENSE.

mqtt-panel's People

Contributors

fabaff avatar josx avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.