# MING project (MQTT, InfluxDB, NodeRED and Grafana)

**URL:** <https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355>\
**Category:** Project help\
**Created:** [November 6, 2022, 9:06am UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355 "2022-11-06T09:06:23Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [November 28, 2022, 1:13pm UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/30 "2022-11-28T13:13:48Z")

</div>

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

I would love to see this Application for fish tanks on the [balenaHub](https://hub.balena.io). Let me know if you need any help!

BTW look at this @ajlennon 🙂

---

<div class="post-metadata">

**Author:** ![ajlennon](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ajlennon/32/63_2.png) [@ajlennon](https://forums.balena.io/u/ajlennon)\
**Post date:** [November 29, 2022, 10:33am UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/31 "2022-11-29T10:33:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![alexcorvis84](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alexcorvis84/32/8534_2.png) [@alexcorvis84](https://forums.balena.io/u/alexcorvis84)\
**Post date:** [January 28, 2023, 6:33pm UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/33 "2023-01-28T18:33:57Z")

</div>

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:

```auto
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](https://docs.balena.io/learn/develop/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!

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [February 8, 2023, 10:15am UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/34 "2023-02-08T10:15:40Z")

</div>

This is awesome @alexcorvis84

BTW how are you trying to access to thingsboard? local ip address to which port?

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [February 8, 2023, 10:59am UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/35 "2023-02-08T10:59:20Z")

</div>

@alexcorvis84 just tested on my side and it worked using the port `9090` with my local ip address!

 ![Captura de pantalla 2023-02-08 a les 11.58.27](https://global.discourse-cdn.com/balena/original/2X/7/749d5c99660cf1d2f6a71c1fb468dd00bbbdc23d.png)

Could you please confirm if this works on your side?

In case that you might need the Public Device URL, my recommendation is to redirect the port 9090 to 8080 or 443 as they are the only ports available (plus the 80 which is being used by NodeRED now).

---

<div class="post-metadata">

**Author:** ![alexcorvis84](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alexcorvis84/32/8534_2.png) [@alexcorvis84](https://forums.balena.io/u/alexcorvis84)\
**Post date:** [February 8, 2023, 11:27am UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/36 "2023-02-08T11:27:35Z")

</div>

> [@alexcorvis84](#):
>
> I’ve setup my device as [Local Mode](https://docs.balena.io/learn/develop/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.

Hi @mpous ,

I was not able to test it again as I had issues as per above. The first time I did the balena push command I checked that the Thingsboard service tried to built but failed. Then the following attempts I tried to push the code with balena push it did not work and I couldn’t see any logs pointing to the service.

Q: Working in local mode, what is the best way to ‘clean’ the services to re-install the project? Or is it automatically cleaned (removed containers and images) with every new push? 🤔 This part is not clear to me.

I might need to delete the device and load again de imageOS into SD, due not sure what’s happening…

Anyway, will give you feedback when I’ll be at home and try it again.

Thank you in advance! 😉

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [February 8, 2023, 11:41am UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/37 "2023-02-08T11:41:43Z")

</div>

mmmm that’s weird! could you please share more logs next time @alexcorvis84 ?

---

<div class="post-metadata">

**Author:** ![alexcorvis84](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alexcorvis84/32/8534_2.png) [@alexcorvis84](https://forums.balena.io/u/alexcorvis84)\
**Post date:** [March 28, 2023, 3:25pm UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/38 "2023-03-28T15:25:16Z")

</div>

Finally I deleted the device and started again, burnt the SD, pushed the release…and **it’s working now**.

Just to note **!!!** , I had issues to connect the RPI via WiFi to balena due:

1. I had to change the WiFi channel below 12 ([even working](https://docs.balena.io/faq/troubleshooting/troubleshooting/raspberrypi3/#wifi-connection-problems-on-rpi3) with a RPi 4!)
2. I had to change manually the WiFi password on SD, as it included a ‘#’ character and it wasn’t saved correctly

---

<div class="post-metadata">

**Author:** ![alexcorvis84](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alexcorvis84/32/8534_2.png) [@alexcorvis84](https://forums.balena.io/u/alexcorvis84)\
**Post date:** [April 25, 2023, 8:57pm UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/39 "2023-04-25T20:57:05Z")

</div>

Hi @mpous

I’m working in a modified version of this project.

Here is my [docker-compose.yml](https://gist.github.com/alexcorvis84/d1dc1ab3093d83c56602689893f8dc75)

Services starts ok and everything works fine BUT after some days, I can’t access to the URLs provided by the different services (yet I can see in the Logs window they’re running).

Device is connected to a 2.4GHz WiFi and I checked that inside Host Os it has IP on wlan0.

What could be happening? What can I check?

Thank you in advance

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [April 26, 2023, 8:06am UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/40 "2023-04-26T08:06:27Z")

</div>

Thanks for sharing! I will test this today @alexcorvis84

@alanb128 did you have this behaviour before?

---

<div class="post-metadata">

**Author:** ![alexcorvis84](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alexcorvis84/32/8534_2.png) [@alexcorvis84](https://forums.balena.io/u/alexcorvis84)\
**Post date:** [May 16, 2023, 8:57am UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/43 "2023-05-16T08:57:37Z")

</div>

I think we should 📌 the fabulous Blog Tutorial @mpous has published as reference! 😉

📌 🔗 [Use the MING stack to accelerate your IoT application development](https://blog.balena.io/ming-stack-mqtt-influxdb-nodered-grafana-balena/)

Thanks a lot for your work! Let’s continue promoting the MING stack!

---

<div class="post-metadata">

**Author:** ![rojasyal](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/rojasyal/32/9712_2.png) [@rojasyal](https://forums.balena.io/u/rojasyal)\
**Post date:** [October 9, 2024, 9:08pm UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/44 "2024-10-09T21:08:55Z")

</div>

Hello, is there a way to update, for example, the version of Nodejs in Node Red from Balena, or the version of Grafana or Influx? In node red there are some nodes that the v16 version of node js is not supported

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [October 15, 2024, 10:11am UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/45 "2024-10-15T10:11:13Z")

</div>

Hello @rojasyal

did you try to change the version of the nodeJS from these Dockerfile templates?

> <https://github.com/balena-labs-projects/balena-node-red/blob/master/node-red/Dockerfile.raspberrypi4-64>

Let me know if you try to update the version from here and test!

---

<div class="post-metadata">

**Author:** ![rojasyal](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/rojasyal/32/9712_2.png) [@rojasyal](https://forums.balena.io/u/rojasyal)\
**Post date:** [October 22, 2024, 2:32am UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/46 "2024-10-22T02:32:06Z")

</div>

hello @mpous Yes it worked for me.

grafana is not saving the changes, that is, I create a dashboard and after entering the changes, the changes are not saved. I think it is due to the volume. The path is fine.

 ![grafana](https://global.discourse-cdn.com/balena/original/2X/8/89f4bfa7b982f21fe17303102f655965670ba823.jpeg)

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [October 22, 2024, 12:54pm UTC](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355/47 "2024-10-22T12:54:29Z")

</div>

@rojasyal yes! i also suffered from this in the past…

maybe you get inspired by this project with the Grafana dashboards being copied in the filesystem → [balena-weather/dashboard/Dockerfile at master · hferentschik/balena-weather · GitHub](https://github.com/hferentschik/balena-weather/blob/master/dashboard/Dockerfile)

[Previous page](https://forums.balena.io/t/ming-project-mqtt-influxdb-nodered-and-grafana/365355.md?page=1)
