インストール

node-red

MOSQUITTO (MQTT Broker)

  • インストール
    参考:Downloads | Mosquitto

    $ sudo apt-get install software-properties-common
    $ sudo add-apt-repository ppa:mosquitto-dev/mosquitto-ppa
    $ sudo apt-get update
    $ sudo apt-get install mosquitto

  • MQTT over websocket
    参考:http://tomowatanabe.hatenablog.com/entry/2016/01/21/095007

    $ cat >> /etc/mosquitto/mosquitto.conf
    listener 1883

    listener 9090 127.0.0.1
    protocol websockets
    $ sudo service mosquitto restart

Nginx (HTTP Server)

$ sudo apt-get install nginx

サンプルコード

$ git clone https://github.com/nuubou/iotlt-hiroshima-1.git
$ sudo ln -s $PWD/iotlt-hiroshima-1/iot-device/ /usr/share/nginx/html

参考: