Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. How does the mesh network work with MySensors ?

How does the mesh network work with MySensors ?

Scheduled Pinned Locked Moved Development
5 Posts 3 Posters 2.4k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jmdJ Offline
    jmdJ Offline
    jmd
    wrote on last edited by jmd
    #1

    Hi,

    I didn't use MySensors yet, but I'm trying to understand how it works, especially the mesh network auto-linking.
    I tried to find answers in the source code of the version 2.0, but finding answers isn't easy.

    Could someone explain me the message exchanges allowing the mesh network to exist ?
    I found few things:

    • DISCOVERY
    • PING
    • FIND_PARENT

    And specific questions:

    • How are circular links avoided ?
    • How the nearest repeater is chosen as a parent ?
    • Does it works if two gateways are nearby (for example, my neighbor and I are both using MySensors)
    • How does the sensor find the shortest way to the gateway ?

    Thanks !

    JM

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      Mesh is probably the wrong word. I would rather say if forms a mesh tree.

      Simplified:
      When a node is losing "connection" with its parent (that is, doesn't receive any inter-node-ack when sending a message) it will send out a broadcast message that will be picked up by all repeaters and the gateway in range.

      The repeater/gateway will answer the request, including how many hops it has to the gateway. So it's not physical distance we're talking about here. The NRF radio does not provide any RSSI value either so it is impossible to take that into account. RFM69 on the other hand does have RSSI so we might use that in the future to determine best path when the number of hops are the same.

      So you must include enough repeaters to avoid "islands" in the radio network (without any path to the gateway). Circular links won't happen because of the rules of choosing parent.

      More info

      If you and your neighbour is using MySensors, one of you would have to change channel or base radio id. The same applies when you have multiple gateways.

      1 Reply Last reply
      1
      • jmdJ Offline
        jmdJ Offline
        jmd
        wrote on last edited by
        #3

        Thank you for your answer.
        Do you have any documentation on the messages exchanges to determine the parent ? The number of hops ?

        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

          Unfortunately, no.

          But the state machine code has inlined comments here:
          https://github.com/mysensors/MySensors/blob/development/core/MyTransport.cpp

          1 Reply Last reply
          0
          • mfalkviddM Offline
            mfalkviddM Offline
            mfalkvidd
            Mod
            wrote on last edited by
            #5

            A conceptual drawing of the network is available at https://www.mysensors.org/about/network in case you haven't found it already.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            19

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • MySensors
            • OpenHardware.io
            • Categories
            • Recent
            • Tags
            • Popular