logo elektroda
logo elektroda
X
logo elektroda

How to Implement Tasmesh Feature from Tasmota to OpenBeken for ESP32 and ESP8266

ferbulous 2190 2
ADVERTISEMENT
  • #1 21103779
    ferbulous
    Level 18  
    Hi, there's a mesh feature on tasmota called Tasmesh which allows for esp devices to connect directly with ESPNOW

    https://github.com/arendst/Tasmota/blob/development/info/xdrv_57_tasmesh.md

    Requirement:

    1) ESP32 - As broker
    2) ESP8266 - As node

    Add these lines to compile

    // -- ESP-NOW -------------------------------------
    #define USE_TASMESH                              // Enable Tasmota Mesh using ESP-NOW (+11k code)
    #define USE_TASMESH_HEARTBEAT                    // If enabled, the broker will detect when nodes come online and offline and send Birth and LWT messages over MQTT correspondingly
    #define TASMESH_OFFLINE_DELAY  3                 // Maximum number of seconds since the last heartbeat before the broker considers a node to be offline


    Usage (enable in console or simply append to rule)

    For broker (esp32/switch)
    MeshBroker


    For nodes (esp8266/lights)
    MeshNode AA:BB:CC:DD:EE:FF


    Right now I'm using it to control the lights with buttons detached from the relay, even if the router is offline with these rules enabled (example)

    Rule1
    on Power1#state do publish cmnd/lightbulb_group1/Power %value%
    


    I was wondering if this can be implemented to openbeken?
  • ADVERTISEMENT
  • #2 21107626
    p.kaczmarek2
    Moderator Smart Home
    That's a very interesting feature, I had to check their readme to figure out how it's working:
    Quote:

    TASMESH
    This driver provides the ability to move TASMOTA-devices out of the WLAN by using ESP-NOW to communicate bidirectional with an internal protocol.

    Thus the workload for the WLAN-router is reduced and with the reduced overhead the local 2.4-GHz-band will be freed of some traffic. Power consumption of the nodes will be reduced significantly allowing better battery powered projects with TASMOTA. Automatic payload encryption is applied using the WiFi-password1 as the key. A maximum of 32 bytes of this password is used for the ChaCha20Poly1305 authenticated encryption as the key.

    As ACK/NACK messages seem to be not reliable on both ESP-platforms, the method "send-and-pray" is used.

    Working principle
    An ESP32 is needed as gateway/broker to connect the nodes (typically an ESP8266) to the WLAN. The ESP32 will receive the MQTT-topic of every node and subscribe to it as a proxy. If a MQTT-message in the form of 'cmnd/node_topic/...' is received, the broker will automatically send this to the referring node via ESP-NOW. The broker will automatically send time messages to all nodes.

    The nodes will send their MQTT-messages back to the broker via ESP-NOW.

    I will need to look into that. Does it really bring advantages?
    Helpful post? Buy me a coffee.
  • #3 21107706
    ferbulous
    Level 18  
    >>21107626

    It leverages on espnow support introduced for esp8266 & esp32 although i’m not sure if beken has similar feature it

    I find it particularly useful especially with my house under renovation. Router could get accidentally turned off during electrical work when the breakers are turned off. With this feature, i have all the lights (nodes) connected to switch (broker) and retain all functions like toggle/dimming/color temp change.

    It’s done by simply publishing mqtt commands triggered by buttons press specified in tasmota rules. And it’s great for WAF (no more complaints from the wife)
ADVERTISEMENT