<commit_before># 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](https://raw.github.com/fabaff/mqtt-panel/master/screenshot.png)

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

The web page is using [bootstrap](http://getbootstrap.com/) with 
[jQuery](http://jquery.com/).

## Prerequisites/Installation

### Get the files
Clone the `mqtt-panel` [repository](https://github.com/fabaff/mqtt-panel)

```
$ git clone <EMAIL>:fabaff/mqtt-panel.git
```

### Dependencies
`mqtt-panel` depends on a couple of additional pieces: 

- [paho-mqtt](https://www.eclipse.org/paho/clients/python/)
- [node.js](http://www.nodejs.org/)
- [mqtt](https://github.com/adamvr/MQTT.js/)
- [socket.io](http://socket.io/)

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

```
$ 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](https://github.com/beerfactory/hbmqtt) - MQTT broker with build-in
  websockets capabilities
- [mosca](http://mcollina.github.io/mosca/) - A multi-transport MQTT broker
  for node.js
- [mosquitto](http://mosquitto.org/) - 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](https://github.com/beerfactory/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.<commit_msg>Clean-up<commit_after># 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](https://raw.github.com/fabaff/mqtt-panel/master/screenshot.png)

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

The web page is using [bootstrap](http://getbootstrap.com/) with 
[jQuery](http://jquery.com/).

## Prerequisites/Installation

### Get the files
Clone the `mqtt-panel` [repository](https://github.com/fabaff/mqtt-panel)

```
$ git clone <EMAIL>:fabaff/mqtt-panel.git
```

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

- [paho-mqtt](https://www.eclipse.org/paho/clients/python/)
- [mqtt](https://github.com/adamvr/MQTT.js/)
- [socket.io](http://socket.io/)

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](https://github.com/beerfactory/hbmqtt) - MQTT broker with build-in
  websockets capabilities
- [mosca](http://mcollina.github.io/mosca/) - A multi-transport MQTT broker
  for node.js
- [mosquitto](http://mosquitto.org/) - 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](https://github.com/beerfactory/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](http://www.nodejs.org/) example.
2. Adjust `var host = '127.0.0.1';` and `var port = 3000;` in the file
   `index.html` to match your setup.
{'fraction_non_alphanumeric': 0.13996075866579463, 'fraction_numerical': 0.017004578155657292, 'mean_word_length': 3.734778121775026, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 12, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1127842', 'n_tokens_mistral': 1683, 'n_tokens_neox': 1585, 'n_words': 513}