MING project (MQTT, InfluxDB, NodeRED and Grafana)

@diverjoe this is an amazing use case using the MING stack! Good job it’s beautiful :slight_smile:

I would love to see this Application for fish tanks on the balenaHub. Let me know if you need any help!

BTW look at this @ajlennon :slight_smile:

1 Like

Who that’s fantastic @diverjoe !!! Great work !!! From Diver Alex :wink:

1 Like

Hi @marc, let’s see if you can help me…

I’ve added a new service (Thigsboard) to the project. My docker-compose file is as below:

version: '2'

volumes:
  node-red-data:
  grafana-data:
  influxdb-data:
  influxdb-etc:
  mytb-data:
  mytb-logs:

services:

  # ------------------------------------------------------------------------------------
  # BalenaLabs WiFi-Connect
  # ------------------------------------------------------------------------------------
  # wifi-connect:
  #   image: bh.cr/balenalabs/wifi-connect-rpi
  #   container_name: wifi-connect
  #   network_mode: "host"
  #   labels:
  #       io.balena.features.dbus: '1'
  #       io.balena.features.firmware: '1'
  #   cap_add:
  #       - NET_ADMIN
  #   environment:
  #       DBUS_SYSTEM_BUS_ADDRESS: "unix:path=/host/run/dbus/system_bus_socket"

  # ------------------------------------------------------------------------------------
  # Node-RED
  # ------------------------------------------------------------------------------------
  node-red:
    image: bh.cr/balenalabs/balena-node-red
    container_name: node-red
    privileged: true
    restart: unless-stopped
    volumes:
        - 'node-red-data:/data'
    labels:
        io.balena.features.dbus: '1'
        io.balena.features.sysfs: '1'
        io.balena.features.supervisor-api: '1'
        io.balena.features.balena-api: '1'
    ports:
        - 80:80
    environment:
        PORT: 80
        USERNAME: "balena"
        PASSWORD: "balena"
        ENCRIPTION_KEY: "balena"        
    cap_add:
        - SYS_RAWIO
    devices:
        - "/dev/mem:/dev/mem"
        - "/dev/gpiomem:/dev/gpiomem"
        - "/dev/i2c-1:/dev/i2c-1"

  # ------------------------------------------------------------------------------------
  # Influxdb
  # ------------------------------------------------------------------------------------
  influxdb:
    image: influxdb:1.8.10
    container_name: influxdb
    restart: unless-stopped
    volumes:
        - influxdb-data:/var/lib/influxdb
        - influxdb-etc:/etc/influxdb

  # ------------------------------------------------------------------------------------
  # Grafana
  # ------------------------------------------------------------------------------------
  grafana:
    image: bh.cr/balenalabs/dashboard
    container_name: grafana
    restart: unless-stopped
    ports:
        - "8080:80"
    volumes:
        - "grafana-data:/data"

  # ------------------------------------------------------------------------------------
  # MQTT
  # ------------------------------------------------------------------------------------
  mqtt:
    image: eclipse-mosquitto
    network_mode: host
    ports:
      - "1883:1883"
    restart: always

  # ------------------------------------------------------------------------------------
  # Thingsboard
  # ------------------------------------------------------------------------------------
  thingsboard:
    image: thingsboard/tb-postgres:latest
    container_name: thingsboard
    restart: unless-stopped
    ports:
      - "9090:9090"
      - "1884:1883"
      - "7070:7070"
      - "5683-5688:5683-5688/udp"
    environment:
      TB_QUEUE_TYPE: in-memory
    volumes:
      - mytb-data:/data
      - mytb-logs:/var/log/thingsboard

I’ve setup my device as Local Mode. Then I pushed the changes through Balena CLI with balena push Device_IP_address.

The first time the services built and I could see the logs, but due some config missing (I guess) the Thingsboard service did not brought up.

Now, issuing the same command (with docker-compose.yml attached), the build works, but I can´t see the Thingsboard service.

I’m missing something? Some configuration is wrong? Thanks in advance!