/rpi-sensorium

Configure and publish various sensor readings over MQTT. Developed for Google AIY Vision & Raspberry Pi.

Primary LanguagePython

HOWTO

Clone project including submodules

  1. git clone <GitHub URL>
  2. cd raspberrypi
  3. git submodule update --init --recursive

Set up environment

  1. pip install -r requirements.txt
  2. Install VS Code extension Remote VSCode
  3. Start extension's server
  4. Install the rcode CLI tool to work with Remote VSCode by following these steps: https://github.com/aurora/rmate
  5. Enable port forwarding: local, source port 5678, destination port localhost:5678

Install services

  1. sudo apt-get install docker-compose
  2. sudo ln -s /home/pi/raspberrypi/magic-mirror-server.service /lib/systemd/system
  3. sudo systemctl daemon-reload
  4. sudo systemctl enable magic-mirror-server.service
  5. sudo systemctl start magic-mirror-server.service
  6. sudo systemctl status magic-mirror-server.service

MQTT over Websockets

In order to configure mosquitto (MQTT broker service) to use the websockets protocol (ws://), create /etc/mosquitto/conf.d/websockets.conf:

# default listener - MQTT protocol
port 1883
bind_address 0.0.0.0

# extra listener - Websockets protocol
listener 1884
protocol websockets
bind_address 0.0.0.0