Wireless Communication - kobeylake/ares-red GitHub Wiki
Network Topology
The system operates on a star topology with the Base Node (nRF52840DK) at the centre, coordinating communication between:
- Mobile Node (Thingy:52): Sensor source
- Actuator Node (nRF52840DK + CRICKIT): Vent control
- PC (Grafana + InfluxDB): Visualisation and logging over USB UART
All embedded nodes communicate wirelessly via Bluetooth Low Energy (BLE), while the base node communicates with the PC via serial UART over USB. The system uses a combination of BLE GATT connections and advertising packets, depending on the role.
Communication Protocol
The project uses Bluetooth Low Energy (BLE) in both connected (GATT-based) and advertising-based modes to support sensor reporting, control commands, and alert forwarding.
BLE GATT Structure
The communication is structured around custom BLE GATT services and characteristics:
Direction | Source → Destination | Mode |
---|---|---|
Thingy:52 → Base Node | BLE GATT Notify | Push periodic temperature, humidity, and CO₂ readings |
Base Node → Actuator Node | BLE GATT Write | Send control signals to open/close vents |
Base Node → PC | UART Serial | Send structured JSON for all readings, events, and control actions |
PC → Viewer (M5 Core2) | BLE Advertise | Send alerts or status messages for local display |
Mobile Node (Thingy:52)
- Acts as a BLE Peripheral.
- Periodically sends sensor data (temperature, humidity, eCO₂/TVOC) to the base node via GATT notifications.
- Operates on I²C internally to interface with onboard sensors.
Base Node (nRF52840)
- Acts as both a BLE Central (to receive from Thingy:52) and BLE Peripheral (to send to the actuator node).
- Performs data fusion and control logic based on temperature, gas, and door state inputs.
- Sends processed control packets to the actuator node using BLE GATT Write.
- Forwards all sensor and event data over UART serial to the PC, formatted in JSON (for use in InfluxDB and Grafana).
- Sends alerts or system states to the viewer (either via BLE or serial passthrough).
Actuator Node (nRF52840 + CRICKIT)
- Acts as a BLE Peripheral, receiving commands from the base node.
- Executes control commands for servo motor actuation (open/close vents).
- Feedback or acknowledgements may be supported via BLE Notify if required.
Viewer Node (M5 Core2)
- Passively receives alerts or states from the base node (via BLE or serial).
- Displays real-time messages or status alerts for greenhouse personnel.