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.
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 examplerouter-group-A
and configure as such number of routers. These routers will request therouter-group-A.cfg
file from the server. - Second option is
MAC
address of ETH0 interface. It is configured by leavingUnit ID
field empty.
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.
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).
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).
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.