ASAC_CPM is a Cluster Power Manager solution, to be used for testing purposes or extensive fault injection campaigns involving a cluster of devices. It can be easily adapted to be used with other kinds of board composing the cluster, like Arduino, Raspberry-Pi, others.
The overall setup requires low-cost components only and can be easily adapted and scaled based on necessity. To manage the power supply of the cluster nodes (ON/OFF) a set of relay switches is controlled by a NodeMCU Lua Lolin V3 Module, implementing a user interface accessible through USB-serial connection. Here below is the general scheme of the hardware setup:
Here below the details about the NodeMCU module pin usage:
Note: an additional VCC >= 5V is needed to power the relay switches (!= Relay Ctrl). As can be seen in the HW Setup general scheme, the PS line could be used for this purpose.
Here below a photo of an ASAC_CPM istance, as it has been mounted in ASAC Laboratory @ DAUIN, Politecnico di Torino:
Note: in this model/setup, 8x TUL PYNQ-Z2 MPSoC Development boards have been used to compose the cluster. To edit each FTDI device serial name, and thus be able to manage all the boards singularly, refer to ftdi-serial-flasher repository, by @EdwarDu.
To initialize the CPM, MicroPython firmware has to be flashed on the NodeMCU module, together with some source code implementing the control interface.
-
Install CH340 Driver: from this link.
-
Installing MicroPython firmware: follow this guide
docs/ESP8266_uPy_guide.pdf
. -
Uploading the uPy source files enabling control interface
2.1) Install adafruit-ampy on your local machine, to upload/update source files stored in the ESP8266's flash memory.
pip install adafruit-ampy
2.2)
ampy
can now be used to upload, download, list files and create directories inside the on-board flash memory. To upload the source files for the control interface (find them in/NodeMCUv3_uPy_src
folder), execute the following commands in a terminal:PORT="/dev/ttyUSB0" ampy -p $PORT put main.py ampy -p $PORT put boot.py ampy -p $PORT mkdir lib ampy -p $PORT put lib/cmd.mpy ampy -p $PORT ls
-
Use the control interface
Once all is set up, you can use the CPM control interface by opening a serial connection (115200-8N1) with the NodeMCU module. If everything is good, a prompt '#' should appear. Here below are the available commands.
Command Description s
Returns the current ON/OFF state of the cluster nodes. y ([1-8] | all)
Power ON the device [1-8] or all the devices. k ([1-8] | all)
Power OFF the device [1-8] or all the devices. r ([1-8] | all)
Power-cycle (OFF - 1sec - ON) the device [1-8] or all the devices.
Here below are some Commercial-Off-The-Shelf alternatives/similar products available on the market (in July 2023):
- Crowd Supply Programmable USB Hubs (202.50$)
- Microchip EVB-USB5734 (536.20€)
- Cluster Triple for Raspberry Pi Compute Modules (49.00$)
The total implementation cost (in July 2023) of the ASAC_CPM is around 20€ (~12.50€ for the 8x Relay Module + ~7.50€ for the NodeMCU V3 Module).