This is a Source plugin for MADS.
This plugin reads raw data published by a BLE peripheral device and sends it to the MADS framework. the plugin is based on the SimpleBLE, which is automatically downloaded and compiled.
This plugin has been updated for MADS v2
Currently, the supported platforms are:
- Linux
- MacOS
- Windows
Linux and MacOS:
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build -j4
sudo cmake --install buildWindows:
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build --config Release
cmake --install build --config ReleaseOn Linux, the plugin requires the following packages to be installed:
sudo apt install libdbus-1-devIn BLE, data come organized in services, each service having one or more characteristic, i.e. individual value. The settings file must specify the peripheral name and a list of characteristics (an array of UUIDs). If there are multiple characteristics under different services, this might cause issues and is not currently supported.
If the list of characteristics is empty (default), then all the characteristics are read.
It can operate in two modes, selected with the subscribe setting:
- polling: read the data published by the selected characteristics as soon as they are sent (default);
- event: get an immediate notification when a value is written by the device, typically only when it changes.
The arduino folder contains a sketch suitable for testing purposes. It runs on arduino boards with BLE capabilities (as the Arduino R4). It produces readings for analog pins A1 and A2, suitable for polling mode, and for the digital pin D2, suitable for event-based notifications.
The plugin supports the following settings in the INI file:
[ble_plugin]
peripheral = "Arduino" # The name of the peripheral device
characteristics = [] # a list of 128 bits valid UUID of the characteristics to be read
subscribe = false # subscribe to notifications (event mode)
list_uuids = false # on launch, print available UUIDsAll settings are optional; if omitted, the default values are used.
The demo connects to a BLE peripheral named "Arduino" and fetches all the available characteristics as uint32_t values.