This code refers to the first implementation of the MPAI-AIF specification as described in https://mpai.community/wp-content/uploads/2021/10/MPAI-AIF-WD0.12.pdf. It contains a given number of AI modules (AIMs) and implements a simple use case.
The software runs on the ST IoT NODE https://www.st.com/en/evaluation-tools/b-l475e-iot01a.html
The Architecture has the following characteristics:
In order to test the architecture few tests AIMs have been implemented:
AIM Producers
AIM Consumers
Implementing the MPAI-AIF specification, the system at the boot time:
A use case for testing the MPAI-AIF implementation has been identified. We call this use case the rehabilitation UC in which specific movements need to be performed in sync with the audio clue. The system listens via the ASC AIM to the audio signal for specific patterns (i.e., a low frequency impulse coming from a metronome) and simultaneously monitor the movement patterns via the Human Activity Classification HAC AIM. An additional AIM monitors if the movement is detected as correct and executed in synchronization with the specific audio pattern.
The IOT-REV AIW ("Context-based Audio Enhancement" for "Rehabilitation Exercises Validation") is described by this JSON according with MPAI-AIF specification 1.0 and can be downloaded here:
The MPAI AIW consists of 4 AIMs:
MicPeakDataChannel
of the message storeSensorsDataChannel
of the message storeSensorsDataChannel
, to detect motion events such as start, stop etc and publish them to channel MotionDataChannel
of the message storeMotionDataChannel
and MicPeakDataChannel
, to recognize if the movement is done in a correct way. In particular, detects a stop event and waits for a volume peak at maximum for 1sec (configurable). It also quick blinks the leds to alert the error.Currently the MPAI STORE functionality is simulated via the delivery over CoAP/IP of the description of the use case in json. The corresponding AIMs are already resident on the board. A CoAP server that simulates the MPAI STORE is provided in Java. The source code can be found here or downloaded here.
In order to run it ($IP_ADDRESS is the CoAP endpoint):
java -Dmpai.store.host=$IP_ADDRESS -jar coap-server-0.0.1-SNAPSHOT.jar
130.192.212.32
zephyr/prj.conf
, setting the IP address of mpai coap server
CONFIG_COAP_SERVER_IPV4_ADDR="<IP_ADDRESS>"
#include "wifi_config.h"
char* AUTO_CONNECT_SSID = "<SSID>";
char* AUTO_CONNECT_SSID_PSK = "<PASSWORD>";
# Change directory to example
> cd iotnode_test_sensors
# Build project
> platformio run
# Upload firmware
> platformio run --target upload
# Build specific environment
> platformio run -e disco_l475vg_iot01a
# Upload firmware for the specific environment
> platformio run -e disco_l475vg_iot01a --target upload
# Clean build files
> platformio run --target clean
cd iotnode_test_sensors
# Download Zephyr and modules
> west update
# Register Zephyr
> west zephyr-export
zephyr/prj.conf
, setting the IP address of mpai coap server
CONFIG_COAP_SERVER_IPV4_ADDR="<IP_ADDRESS>"
#include "wifi_config.h"
char* AUTO_CONNECT_SSID = "<SSID>";
char* AUTO_CONNECT_SSID_PSK = "<PASSWORD>";
Run (if requested) MPAI Server CoAP. If you don't want to run your own CoAP server, we have a public server up-and-running at IP address 130.192.212.32
To build the project go to the west
subdirectory and give the command:
> west build -b disco_l475_iot1 -s .
Licence information for each components of this example is detailed in LICENCE.MD