Close

STM32 is now Home Smart Mesh Compatible

A project log for STM32 Blue pill IoT expansion boards

Expansion boards are designed to be easy to use in DIY IoT projects, low cost, reliable, saves the pain of cabling bread boards

wassimWassim 10/21/2017 at 09:020 Comments

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

STM32 Applications

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);
... 

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);
...

Discussions