An open API service indexing awesome lists of open source software.

https://github.com/araobp/device-simulator

HTML5/CSS3/AngularJS-based device simulator
https://github.com/araobp/device-simulator

angularjs html5 mosquitto mqtt websocket

Last synced: 3 months ago
JSON representation

HTML5/CSS3/AngularJS-based device simulator

Awesome Lists containing this project

README

          

# Device simulator based on HTML5 and AngularJS

## Prerequisite

- [mosquitto](https://mosquitto.org) is runnig somewhere, for example, on RasPi.
- The mosquitto has been made(compiled) with WebSockets option enabled.
- angular.min.js and browserMqtt.js is accesible from a simulator.

Refer to the following links for mosquitto and browserMqtt.js:
- [obtaining mosquitto with WebSockets enabled](https://xperimentia.com/2015/08/20/installing-mosquitto-mqtt-broker-on-raspberry-pi-with-websockets/)
- [building browserMqtt.js](https://github.com/mqttjs/MQTT.js/)

## Architecture

```
HTTP GET to download the HTML5 page
+ - - - - - - - - - - - - - -[HTTP server]
|
v
[Device simulator]---mqtt/WebSocket---[mosquitto]---mqtt---[mqtt client as remote controller]
(HTML5)
```

### Hello World

[sample](./index.html)

### Display

[display](./display.html)

### Image

[image](./display.html)

### Video

[video](./video.html)

### Elevator

[elavator](./elevator.html)

## Working with one-liner HTTP server

Assuming that mosquitto is running on RasPi and all the files above are also on RasPi, use one-liner HTTP server to use the simulator on another PC.

Installation
```
$ npm install -g http-server
```

Usage
```
$ http-server
```