Manage Advantech 4G routers with Node-Red and Airtable

4G router Node-Red

In this article I will show how to use Automatic Update feature in the Firmware to manage Advantech 4G/5G routers. This setup can be used for small and large deployments as it's scalable to 1000s of units.

Automatic Update with unique IDs

Let's have a quick look at Automatic Update and how it works. In principal it is very simple and is well documented in Configuration Manual.

The router can use these servers to host configurations and firmware:

  • HTTP
  • HTTPS
  • FTP
  • FTPS

Second option to choose from is specify generic vs unique configuration name.

  • First such option is generic configuration name. For example router-group-A and configure as such number of routers. These routers will request the router-group-A.cfg file from the server.
  • Second option is MAC address of ETH0 interface. It is configured by leaving Unit ID field empty.
Our test setup

My test setup is as follows. ICR-3232 router, Raspberry Pi (with Node-Red installed), Airtable free account.

I will not show how to install Node-Red on Raspberry Pi as that is described here, nor registering for free account on Airtable. Their respective documentations provides all the information.

Airtable configuration

Let's prepare our Airtable base first, so we know have a context for the Node-Red programming. Here is a link to the base published to Airtable Universe Airtable base.

Copy the base to your account and get ready your API key. Which we will need for Node-Red part. You can find it in your account overview (image below).

Node-Red configuration

Time to get the Node-Red ready. The flow is simple and looks like this.

Node-Red flow for Router management with Airtable

The above Node-Red flow depends on the extra Airtable node. Please add it via Manage Pallet. The flow is available at Gitlab as a snippet.

You will need to configure the Airtable node with your Airtable API key and base ID. To find the Airtable Base ID go to https://airtable.com/api and select the base. The interactive API documentation window will open. Navigate to Authentification. There you will find the Airtable Base ID as a part of example command (please see screenshot).

Airtable Base ID

Router Configuration

Last step is to configure the Advantech router. In the web interface navigate to Configuration --> Automatic Update. You can refer to the screenshot for inspiration ;). In my case the RaspberryPi IP address is 192.168.1.112, where Node-Red is running on port 1880 (standard port for Node-Red).

Advantech Router Automatic Update configuration

Note: the backslash (/) at the end of the URL is omitted on purpose. This can be a reason, why it's not working.

The setting on the screenshot means it's the router will check remote server 5min. after reboot. If you do not want to wait that long you can use Postman or Curl to test

curl --location --request GET '192.168.1.112:1880/group-config-airtable/AA.BB.cfg'

In Node-Red Debug tab you should see something similar to this.

Which is output from Node-Red Debug nodes.

Conclusion

In this article we demonstrated simple way to manage Advantech 4G routers in scalable way. The way how I structured Airtable database does provide good starting point to use configuration Snippets and implement monitoring.

My article does not go into super details as I do assume some basic knowledge and will to consult documentation.

Hope this can help a few.

Next time we will replace Airtable for self-hosted Strapi installation.


Older Post


Leave a comment

Please note, comments must be approved before they are published