top of page

Microgrid Telemetry monitoring on Google Cloud over cellular 4G

with the nodeMini IoT Gateway

Introduction

This tutorial runs through the key steps guide to building a production-ready Industrial IoT (IIoT) telemetry pipeline. We will be using the nodeMini industrial gateway to move data from a Victron Energy Microgrid system to a Google Cloud Platform (GCP) backend, concluding with a real-time dashboard in Looker Studio. The features of the nodeMini utilised is its modbus connectivity, integrated Google Cloud Platform client, cellular 4G sending capabilities & industrial CE certification.

microgrid to google cloud.png

The Edge Configuration

In our example, the data from the Victron energy system that we want to monitor is first aggregated using the Venus GX Gateway. The nodeMini acts as the industrial translator here, converting Modbus register data into JSON payloads for the cloud. At the same time, it will handle the data transmission to Google Cloud via a cellular 4G/LTE connection.  

STEP ONE: THE PHYSICAL SET UP

We begin by wiring up. ​The diagram above can be used as a guide for your schematics. Follow the specific wiring instructions in your device user manuals to complete this action. 

Next you also want to ensure the same baud rate is used across all devices. If there are differences in the baud rates we typically recommend setting it to the higher figure. 

​​​

Reference guide: How to set the baud rate on the nodeMini gateway.

Inverter monitoring setup.png

STEP TWO: MAPPING THE MODBUS DATA

The modbus RTU protocol is used to expose the system data of Victron GX devices like Cerbo GX & Colour Control GX. To flexibly map the registers of industrial devices that you want to monitor on the nodeMini gateway we will use a configuration file thats called the "iotasset.json".

Mapping your device registers with our modbus configuration reference guide.

For your reference, we've also included a sample "iotasset.json" script below that's based on the standard Victron Unit IDs:

(System = 100): 

JSON 

  "MODBUS": [ 

    { 

      "Key": "Vac", 

      "IOTMODE": "1", 

      "MODBUSTYPE": "TCP", 

      "IP": "192.168.1.15", 

      "PORT": "502", 

      "UNITID": "100", 

      "MODBUSREG": "827", 

      "DATATYPE": "UINT16", 

      "SCALEMUL": "0.1", 

      "SCALEADD": "0" 

    }, 

    { 

      "Key": "Vdc", 

      "IOTMODE": "1", 

      "MODBUSTYPE": "TCP", 

      "IP": "192.168.1.15", 

      "PORT": "502", 

      "UNITID": "100", 

      "MODBUSREG": "840", 

      "DATATYPE": "UINT16", 

      "SCALEMUL": "0.1", 

      "SCALEADD": "0" 

    }, 

    { 

      "Key": "Load_Power", 

      "IOTMODE": "1", 

      "MODBUSTYPE": "TCP", 

      "IP": "192.168.1.15", 

      "PORT": "502", 

      "UNITID": "100", 

      "MODBUSREG": "817", 

      "DATATYPE": "UINT16", 

      "SCALEMUL": "1.0", 

      "SCALEADD": "0" 

    } 

  ] 

 

Save your script as "iotasset.json" and then log in to the nodeMini web config menu to upload the file to the gateway (you can do this in the "IoT Hardwase > Assets" tab). Save the settings and then reboot your gateway.

At the same time, ensure that Modbus TCP has been enabled in the "menu > settings . services" menu for your Victron GX devices.

STEP THREE: CONFIGURING THE MQTT CLIENT

At this stage the nodeMini will be successfully collecting and storing data from the Victron energy system on to its on-board SQL database. Next we want to configure its MQTT client to be pointed to your Google Cloud Platform or MQTT bridge.

Start by signing up or logging in to your Google Cloud Platform account.

From here we will get your "Host Address". In this example we will be using the Pub/Sub method which is the native way for GCP to handle 'broker-like' messaging. In this method the host address is your global Google API endpoint.  

Copy & paste this Google API endpoint into the broker host entry on the "nodeMini web config menu > cloud settings" page. Set up a relevant message topic to identify this data set and a host port it will be listening into. As a default we set the host port as '1883'. 

Setup Google Cloud Platform client.png

Next we want to obtain your credentials. Instead of individual SSL certificates for brokers, under the Pub/Sub method GCP uses "Service Account Keys". Follow the steps below to get this key:

  • Navigate to "IAM & Admin > Service Accounts"

  • Create an account and give it a role of a Pub/Sub Subscriber

  • Go to Keys > Add Key > Create New Key & select JSON

  • This JSON file will act as your certificate for authentication. You can point your application to this file using the environment variable: 

 

export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/key.json"

Upload this certificate to the nodeMini using the web config Management tab as a zipped AWS or GCP folder (this will depend on the naming convention in your nodeMini firmware version).

STEP FOUR: CONFIGURING YOUR GOOGLE CLOUD PLATFORM INFRASTRUCTURE

We will be using a "BigQuery Subscription" in Pub/Sub for a zero-code data ingestion path on Google Cloud Platform.

Firstly we will set up the storage on BigQuery with the following steps:

  1. Go to the BigQuery console and create a dataset named microgrid_victron_db

  2. Create a table named clean_inverter_telemetry with the following schema:

​​

  • key: STRING (Nullable)​

  • value: FLOAT (Nullable)

  • timestamp: TIMESTAMP (Nullable)

Next, we will set up the ingestion for Pub/Sub as follows:

  1. Topic: Create a topic named victron_telemetry

  2. Delivery Type: Select "write to BigQuery"

  3. Configurations:

​​

  • Select your 'microgrid_victron' project

  • Select the 'microgrid_victron_db' dataset

  • And the 'clean_inverter_telemetry' table

  • Check the box for 'use topic schema' if you have defined one. Otherwise ensure that your MQTT payload keys match the table column names.​

STEP FIVE: SETTING UP YOUR DATA VISUALISATION (IN LOOKER STUDIO)

Now that the data is flowing from the nodeMini into BigQuery, we can switch over to a 4G cellular network and also build your data dashboard.

To set up your 4G cellular connectivity, first insert your SIM card into the nodeMini gateway.

Then log into the "web config menu > quickstart menu" & enter the apn details of your ISP.

Save the settings & reboot your gateway.

To start building your dashboard, open Looker Studio and create a new 'blank report'.

Then select "BigQuery" as the connector, and from there navigate to your project: → microgrid_victron_db → clean_inverter_telemetry. 

You are now ready to build your charts. You can reference our settings below for your own dashboard.

​​

  • Input Voltage (guage & time series)

    • Dimension: timestamp

    • Metric: value (rename to 'Vac')

    • Filter: create a filter where key Equal to (=) Vac

  • Battery Voltage (time series)

    • Dimension: timestamp

    • Metric: value (rename to 'Vdc')

    • Filter: key = Vdc

  • Load Power (bar/area chart)​​

    • Metric: value (rename to 'W')

    • Filter: key = Load Power

Testing & Support Resources

Should you encounter a break in the data pipeline, you can deploy the following checks along the way to test the success of the set up each stage.

​​

  • Verifying data flow at the edge

    • Check the nodeMini Data Monitor to see if live Modbus values are being displayed.

  • Verifying ingestion of data by GCP

    • Check the Pub/Sub Metrics tab (Health Score) to ensure messages are being acknowledged (ack_latency).

  • Verifying storage of data by BigQuery

    • Rent a SELECT * query in the BigQuery console to confirm data points are appearing with the correct timestamps.

  • Pro tip:

    • If your timestamps are appearing in UTC, use the Looker Studio calculated field i.e. DATETIME(timestamp, "Australia/Perth") to adjust for local time zones.

Users can also reach out to our technical team for prompt support via the button below.

logo gunmetal.png

Amplified Engineering Pty Ltd  

Unit 3, 2A Brodie Hall Drive

Bentley WA 6102, Australia

ABN 44127163035

bottom of page