What is Home Smart Mesh ?
As described in the Home Smart Mesh Hackaday Project, it is an IoT Mesh Framework using custom RF sensors and repeaters for Raspberry Pi. It is Open Source, and plugs with MQTT and OpenHAB2.
The mesh protocol has been designed to be simple enough so that you can understand it and debugg it by yourself in your free time, yet with a functionnal level that can be of a practical use. More details about the mesh protocol in this flood mesh project log
STM32 Hardware Support
- RF Node : already running with source code available on github STM32 RF Node Projects
- RF PIO : same in github firmware for pio servo control
STM32 Applications
- heater : a pwm control of a Solid State Relay
- sniffer : not really RF sniffer, but protocol sniffer, as it ignores the format but still has to stick to one channel, helps to see both request and acknowledge for debug.
- uart interface :
- RF dongle collecting messages broadcasted into the mesh
- Injects messages targeted to a specific node with an acknowledge. Note that the acknowledge is mesh wide from destination back to source and not point to point like the Enhenced Shockburst.
Now as we can see in the following sections the STM32 bring the possibility to use ARM mbed and all what comes with it.
Easy to use Mesh functions with ARM mbed and modern c++
Here we can find code snippets from the RF uart interface acting as an RF dongle. Complete file on github
//nRF Modules 1:Gnd, 2:3.3v, 3:ce, 4:csn, 5:sck, 6:mosi, 7:miso, 8:irq
RfMesh hsm(&rasp, PC_15, PA_4, PA_5, PA_7, PA_6, PA_0);
void rf_broadcast_catched(uint8_t *data,uint8_t size)
{
switch(data[rfi_pid])
{
case rf_pid_0xF5_alive:
...
int main()
{
hsm.init(CHANNEL);
hsm.setNodeId(NODEID);
hsm.attach(&rf_broadcast_catched,RfMesh::CallbackType::Broadcast);
...
- Provide the Channel to listen and send on. Can be changed later. And yes, currently the mesh is operating on a single channel, channels clusters and channels swapping are features yet to come depending on need.
- Attach to a mesh event, here a broadcast
Here we have a code snippet from a Node application that uses acknowledged peer to peer messages. complete file on github
void rf_message_to_me(uint8_t *data,uint8_t size)
{
if(data[rfi_pid] == rf_pid_heat)
{
heat_val = data[4];//heat_val payload : Size Pid SrcId TrgId HeatVal CRC
...
main()
{
hsm.init(CHANNEL);
hsm.setNodeId(NODEID);
hsm.attach(&rf_message_to_me,RfMesh::CallbackType::Message);
...
- The attachment is to a Message type.
- As the node id has been provided to the mesh driver, only messages with matching target node id will be provided.
- The acknowledge transmission is also handled by the mesh driver.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.