nRF5 projects have now their own section on a dedicated Home Automation website : https://www.homesmartmesh.com/docs/microcontrollers/nrf52/
If you would like to get support, give feedback or discuss new ideas related to this project ?
It's possible to directly discuss on the forum
https://homesmartmesh.discourse.group/
- 2 Mbps (e.g. Zgibee is at 250 Kbps to have a higher range), the bitrate does not improve the range enough to get rid of repeaters, and once you need repeaters these are continuous listeners and require permanent power anyway, so the strategy is to have a repeater for every slot of the house and those repeaters can have power amplifiers and the range problem is solved with a high bitrate.
- stress tests including up to 300 packets / second were successfull.
- This configuration file contains the short id for device unique identifier (uid64) and other configurations such as the channel, the sleep time, the required function,... Note that a python script using jLink API automate the flashing process as the uid is read every time from the attached device and matches the parameters to be flashed from the config file.
- As the short id (8 bits) is flashed, there is no association process required and all sensor devices can act as a pure beacons (no listening required) which considerably increases battery life time. We can keep arguing about the need of an acknowledged protocol for sensors logging, I do not think it is required as the feedback of battery level and rssi are both logged as well so the user knows if the sensor is in a healthy position or not.
- Router = Coordinator = Repeater = Sniffer = CLI : actually, a configuration activates the repeat functionality in case someone wants a completely stealth sniffer and this config does not require a different FW. There is nothing to coordinate as the mesh is fully dynamic with a flood and time to live concept. And every dongle has a CLI in text mode to report heard packets and takes commands as text input.
- A consequence of the simplified design allows to have multiple dongles in different locations listening to the network and reporting it to mqtt which avoids any single point of failure. By design there is no id 0 privileged coordinator and end devices do not require to know any particular associated address, they just wake up, broadcast and sleep.
- As visible in the gif animations below, Open Source SW is provided for all steps, devices firmware and server python code.
Just plug a dongle and watch the serial port
cu -l /dev/ttyACM0 -s 460800
Then start a python service to turn serial to mqtt
Link to the python script nrf_mesh.py
python3 py/nrf_mesh/nrf_mesh.py
mosquitto_sub -t 'nrf/#' -v | ts
more details about the protocol on the Home Smart Mesh Website Protocol page
Home Smart Mesh with comprehensible structure, menu for different boards, mesh concept,...
Repeater and Command Line Interface : nRF52840 usb dongle
- Nordic has release a cheap usb dongle. This board does not have a serial to usb converter, rather the physical usb of the nRF52840 chip. A firmware is provided to offer a high performance interface. I must admit that it was not easy due to all required ring buffers and interrupt management.
- This dongle is multi purpose and is also used in other projects with "OpenThread" as a protocolas example #Self standing balancing robot. But the custom protocol is simpler and has a millisecond scale efficiency.
DIY nRF52 Sensor Tag
Why am I doing a custom HW ? When I started this there were no Aqara sensors on the market. The aqara weather do not measure ambient light, the motion sensor does but with unpractical sampling rate and resolution. The nRF51802 is an 8€ tag that can sense temperature and ambient light, and the aqara the humidity and pressure which for my use case do not require a high sampling rate. So this nRF52 is more as a platform to plug in any new sensor but is an optional chain in the...
Read more »
There is some overlap in the things you are doing and the experiments I did. See write-up below. I had to spent some time in getting the MQTT-SN protocol working with a MQTT broker (registering topics etc.) using the Nordic examples. Let me know if you encounter the same kind of problems.
I have OpenThread running on a few nRF52840 nodes (Nordic DK, Nordic Dongle, MakerDiary dongle).
I have a Raspberry PI with the OpenThread Border Router runing the Paho MQTT-SN -> MQTT gateway.
This gateway is talking to another RaspBerry PI running Home-Assitant and a MQTT (Mosquitto) broker.
On the nRF52840 DK, I implemented part of the MySensors protocol. It is using the MQTT-SN protocol for communication. I am using it with a BME280 sensor. I used the Segger IDE for this (free license for nRF52840 hardware). The Nordic nRF52840 DK in combination with Segger IDE is very much needed if you want to debug your code (or repair your bricked dongle :-)).
On the Home Assistant, I installed the MySensors MQTT gateway. Actually, the whole thing is working (Temperature/Pressure/Humidity available in Home Assistant). But it is just a POC with not even alpha quality code (My C knowledge about malloc/free is a bit rusty after 15 years of Java/C#).