DynamicDevices / ming-original

Balena.io/Docker-compose repo for a containerised #MING (Mosquitto, InfluxDB, NodeRed, Grafana) stack
33 stars 20 forks source link

MING (Mosquitto, InfluxDB, NodeRed, Grafana)

MING is a containerised IoT sensor server stack in the traditions of LAMP.

We've leveraged #OpenBalena to provide a embedded Linux environment to provide:

Each of these applications is built and runs in its own container on an embedded Linux target supporting Balena.io (Docker for Embedded Systems).

Optional Components

We've added some nice applications that we think run nicely alongside the MING stack, they can be optionally enabled by uncommenting them in the docker-compose.yml file in this repo

These components are:

Home-Assistant

Open source home automation that puts local control and privacy first.

Rhasspy

Rhasspy (pronounced RAH-SPEE) is an open source, fully offline voice assistant toolkit for many languages that works well with Home Assistant, Hass.io, and Node-RED.

Wifi-Connect (AP Mode)

This is only available When using Balena. It allows you to a Wifi Access Point on a device with AP capable hardware such as a Raspberry Pi 3, simply uncomment the docker-compose SERVICE labelled "ap" and set MING_AP to a value of 1 in your Balena device variables or service variables.

Enabling these optional components

To enable Home-Assistant for example, uncomment it in docker-compose.yml

Enabled ✔

  hassio:
    restart: always
    build: ./hassio
    ports:
      - "8123:8123" 
    volumes:
      - 'hassio-data:/config'

Disabled ✖

#  hassio:
#    restart: always
#    build: ./hassio
#    ports:
#      - "8123:8123" 
#    volumes:
#      - 'hassio-data:/config'

Supported Targets

Currently tested targets are

Example command: Note the host to guest port forwarding

sudo qemu-system-x86_64 -drive file=balena-cloud-IntelNucTest-qemux86-64-2.38.0+rev1-dev-v9.15.7.img,media=disk,cache=none,format=raw -net nic,model=virtio -net user,hostfwd=tcp::5880-:1880,hostfwd=tcp::5000-:3000,hostfwd=tcp::5883-:1883,hostfwd=tcp::5884-:1884 -m 1024 -nographic -machine type=pc,accel=kvm -smp 4 -cpu host

You may need to increase the size of the qemu image download you get from Balena.io:

qemu-img resize balena-cloud-IntelNucTest-qemux86-64-2.38.0+rev1-dev-v9.15.7.img -f raw +10G

This will be picked up when the image boots and the partition/filesystem resized accordingly

Getting going

Clone this repository and follow getting started instructions at Balena.io

Either start with a Raspberry Pi 3B+, here

Or you might choose so test with a VirtualBox VM, here

Add the remote from the Balena.io dashboard to this repo and do a git push.

Balena.io will build and deploy the containers to your target.

It's that easy!

Configure via environment variables

Variable Name Value Description Default
JUPYTER_MING_PASS STRING the password Jupyter Labs will start up with mingstack
MING_AP 1 OR 0 Whether to start a Wifi AP or not, 0 = off, 1 = on 0

More detail

Here's an example of what you will see on the Balena dashboard.

You can see the individual containers running, the unique ID (UID) of the newly registered device, and it's local IP address. You can also enable a public URL to access the device remotely. By default if you enable access to port 80 you'll enable access to the Grafana server.

You can see from the above that the short form of the UID for this device is e844144.

You can change this but for now if you attempt to ping that UID you should have connectivity

$ ping e844144.local

If you run into problems just try pinging to the local IP address you see on the dashboard

$ ping 192.168.0.228

With connectivity working you can now take a look at the servers running on the target.

Maintainer / Contributors

Attribution

@see: https://github.com/balena-io-projects/balena-sense

Contributing

Please raise issues and generate PRs at

https://github.com/DynamicDevices/ming