I am ECONNREFUSED

Hi,

I am running MING on a pi3B.

I can see all my containers are running.

I open a Influxdb terminal and created a USER, DATABASE and test data.

Start my Node-red in a browser using the local IP.

Created a basic flow to interact with my Influxdb.

Set my server credentials up as per the user I created.

What did I miss out to get my Node-Red to connect to my InluxDB?

image
Thank you

Hello @Koos_vRB first of all welcome to the balena community!

Could you please share more details of the nodeRED configuration of the nodes?

Thanks!

Hi,

This is my flow

[{"id":"067ceef3c68f22a2","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"bb60b34fc81ad1f8","type":"debug","z":"067ceef3c68f22a2","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":580,"y":180,"wires":[]},{"id":"d7eee45e432eaf49","type":"influxdb in","z":"067ceef3c68f22a2","influxdb":"c646284503ed83e0","name":"","query":"","rawOutput":false,"precision":"","retentionPolicy":"","org":"organisation","x":380,"y":180,"wires":[["bb60b34fc81ad1f8"]]},{"id":"a418e072886144df","type":"inject","z":"067ceef3c68f22a2","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":60,"wires":[["9a79233caee4780a","f3218c843fcc3365"]]},{"id":"9a79233caee4780a","type":"influxdb out","z":"067ceef3c68f22a2","influxdb":"c646284503ed83e0","name":"","measurement":"balena","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":400,"y":60,"wires":[]},{"id":"1a26bc0a36460538","type":"inject","z":"067ceef3c68f22a2","name":"","props":[{"p":"query","v":"SELECT * FROM balena","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":150,"y":180,"wires":[["d7eee45e432eaf49","57c60f0483f90bf0"]]},{"id":"f3218c843fcc3365","type":"debug","z":"067ceef3c68f22a2","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":320,"y":100,"wires":[]},{"id":"57c60f0483f90bf0","type":"debug","z":"067ceef3c68f22a2","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":320,"y":240,"wires":[]},{"id":"c646284503ed83e0","type":"influxdb","hostname":"localhost","port":"8086","protocol":"http","database":"balena","name":"","usetls":false,"tls":"","influxdbVersion":"1.x","url":"http://localhost:8086","rejectUnauthorized":true,"credentials":{}}]

image

Thanks

@Koos_vRB could you please confirm what application was deployed on your fleet?

@mpous Application?
Are you referinf to the Git repository? That would be yours, with no changes.

Thanks

Morning,

Have any one pushed or queried data from a node-red container to Influxdb container?

I have looked again and can’t see why these two containers are not talking to each other.

I have actual delete everything and recreated everything (deleted all devices, all releases, re-flashed the SD, pulled the release from GitHub - mpous/ming, recreated the Influxdb database and user)

version: '2.4'
volumes:
  grafana-data: {}
  influxdb-etc: {}
  influxdb-data: {}
  node-red-data: {}
services:
  mqtt:
    image: eclipse-mosquitto
    ports:
      - '1883:1883'
    restart: always
    network_mode: host
  grafana:
    image: bh.cr/balenalabs/dashboard
    ports:
      - '8080:80'
    restart: unless-stopped
    volumes:
      - 'grafana-data:/data'
    container_name: grafana
  influxdb:
    image: 'influxdb:1.7.11'
    restart: unless-stopped
    volumes:
      - 'influxdb-data:/var/lib/influxdb'
      - 'influxdb-etc:/etc/influxdb'
    container_name: influxdb
  node-red:
    image: bh.cr/balenalabs/balena-node-red
    ports:
      - '80:80'
    labels:
      io.balena.features.dbus: '1'
      io.balena.features.sysfs: '1'
      io.balena.features.balena-api: '1'
      io.balena.features.supervisor-api: '1'
    cap_add:
      - SYS_RAWIO
    devices:
      - '/dev/mem:/dev/mem'
      - '/dev/gpiomem:/dev/gpiomem'
      - '/dev/i2c-1:/dev/i2c-1'
    restart: unless-stopped
    volumes:
      - 'node-red-data:/data'
    privileged: true
    environment:
      PORT: '80'
      PASSWORD: balena
      USERNAME: balena
      ENCRIPTION_KEY: balena
    container_name: node-red
  wifi-connect:
    image: bh.cr/balenalabs/wifi-connect-rpi
    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'
    network_mode: host
    container_name: wifi-connect

I can connect the Grafana and Influxdb containers.

Thank you.

1 Like

What is the change done @Koos_vRB ?

Hi @mpous, I thought that during the initial deployment something might have gone wrong, that is why I deleted every thing and redeployed.

I still cant read/wright from node-red to influx.

Thank you

I will try to reproduce this @Koos_vRB

i will keep you updated!

1 Like

Thank you

1 Like

Hello @Koos_vRB deploy the newest version of the MING stack and it should work.

To access to the containers from nodeRED use mqtt or influxdb with the usual ports. Let me know if you have any issue!

Let’s stay connected!

@mpous Thank you.

Are your Influxdb ports not suppose to be specified?

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

@mpous please give me a lesson in how to connect Influxdb 1.7.11 via MQTT to Node-Red

1 Like

Sure @Koos_vRB find below more information :point_down: :point_down: :point_down:

This is my balenaCloud services running the MING stack on a Raspberry Pi 4:

Captura de pantalla 2023-07-27 a les 12.55.53

Now, here the nodeRED flow that i used for test purposes.

This is the MQTT broker node definition on nodeRED. As you can see on balenaCloud, the name of the service is called mqtt, so we use the same name here.

And here the influxDB configuration node. We use the service name influxdb.

On Grafana, configure the influxDB data source as this:

Let me know if this works for you!

Let’s stay connected

Marc

Thank you @mpous, the missing piece of the puzzle

1 Like

A question I should most probably start a new topic.

Can I log into Node-Red or Grafana via the public IP?

image

And what would be the Username and Password?

@Koos_vRB it depends on your router. However this is why we created the Public Device URL. This URL will allow you to access to the port 80 (NodeRED) and 8080 (Grafana).

Let me know if this works for you!

@mpous , with node-red you use the url under the settings tab, works great.

Or just hit this button.

image

How do you change the Public Device URL to access Grafana?

Use http instead of https and add :8080 at the end of the public device URL.

El ds., 29 de jul. 2023, 15:20, Koos via balenaForums <notifications@balena.discoursemail.com> va escriure:

1 Like

Thank you