PINE A64, Node.js, Balena, PM2 and ResinOS (Part 2) …

I’m starting here from a new design that will use both PINE A64, Raspberry Pi 3 and OrangePi Zero cards…

with these technical specifications:





As usual, I use Etcher to flash OS images on these cards :


I will use Debian Stretch as OS for these cards via Armbian :

and DietPi, a extremely lightweight Debian OS :



To do this you have to start after you flash the images on the cards to scan your network to find the IP addresses provided with the DHCP :

and I can see the characteristics of these boards :

I take this opportunity to install a Docker CE engine again:

and I can initiate a cluster via Docker Swarm Mode very quickly:

Orange Pi Zero card serves as the master node here:

with a local overlay network:

I can tag these nodes of this cluster to differentiate them according to their respective hardware architecture:



I can then test the Portainer installation to graphically visualize the cluster characteristics:





After this first test, I slightly modify the previous design to replace a PINE A64 card by an OrangePi Zero card:

And I can recreate a Docker Swarm Mode cluster where the RPi3 card is used here as the master node:



Here again I differentiate the cluster nodes according to their hardware characteristics (ARMv7 32 Bits or ARMv8 64 Bits):


with as usual the FranceConnect Particulier demonstrator test in ARMv7 :


or in ARMv8 :


I can use Traefik multi-architecture binaries as Docker images to get a global endpoint for my cluster:


Launch of Traefik in the cluster:

and launch of the FranceConnect Particulier demonstrators :

They appear in Traefik’s dashboard with two endpoints specific to ARMv7 and ARMv8 architectures :



And to allow external access to these locally running maps, Ngrok can be used again:



or with the OpenFaaS stack to test functions on demand in Serverless mode :


with its specific command line :

or graphically :


And if I want an alternative to using the Docker engine, once again Keymetrics PM2 can work with these boards :


and PM2 Plus offers a dashboard:

You can imitate a “Capistrano” deployment mode like Rubyists with a configuration file that will exploit SSH connections to these devices :


Here I deploy the FC Agent demonstrator directly from the sources on Github with PM2 :

and PM2 cluster mode is active :


with metrics in an APM logic with PM2 Plus and its dashboard :


or more classically to the old formula offered by Keymetrics :


Using a utility dedicated to Reverse Proxy via the NPM register allows me to get a single local endpoint pointing to the different local endpoints provided by PM2 to access the FC Agent demonstrator:


Again NGROK allows external access to this local reverse proxy :

and another alternative to NGROK is SERVEO as seen in the previous article :



Finally with all these operations, the CPU/memory consumption remained relatively correct…

To close with the previous article, we could find here the logic of Edge Computing:

By the way I’m testing here the Azure IoT Hub service from Microsoft :

I can install the Azure IoT Edge runtime on the RPi3 board which will use the Docker CE engine again:


One can take into account the fact that this Edge node could be used to locally analyze data with Azure Stream Analytics on IoT Edge (via a Docker container using Machine Learning bricks) to send only some useful data to Azure IoT Hub (for the moment this is limited to 32-bit ARMv7 devices: https://hub.docker.com/r/microsoft/azureiotedge-azure-stream-analytics/):


and I can connect all these boards to Azure IoT Hub:

with the first lifts:

Using the Azure IoT Node.js SDK on each board:


and these examples: here, simulated sensor data are fed back to these devices using the MQTT protocol


by inserting the connection string for each device:

and the data is uploaded:

Please note that the free plan is limited to 8000 messages per day…



Finally, I can also use the cloud monitoring service dedicated to IoT provided by Datadog by compiling on these devices the sources of its dedicated agent :

generating these graphs in dashboards :



These cards could be used to build proximity micro datacenters, as Picocluster and its various designs explain:
An area to watch as Edge computing is a new battleground for the Cloud computing giants …
