Mulitple Gatways and NodeID0



  • Hi All,
    I have two Gateways connected to one Controller and I want to attach on each Gateway, which have different Radios, a sensor. I know always NodeID 0 is assigned to a sensor attached to the Gateways.
    Is there any chance to give a sensor attached to the Gateway another NodeID?
    Thanks

    Markus



  • I'm not sure whether this is problem of the MySensors serial API or more a controller specific topic.
    Didn't test that in depth, but at least FHEM seems not to destinguish between Children on different gw's.
    How are experiences with other controller solutions?


  • Mod

    @markus no there isnโ€™t. But your controller should distinguish them anyway. If it doesnโ€™t, you would have problems when adding for example a rfm gw and a nrf gw and the same node id is used for a node on each network.

    I have not tried other controllers, but Domoticz handles multiple MySensors networks.



  • @mfalkvidd The Problem imo is that as far as I understood, sensors attached directly to the gw will be reported under NodeID 0 - regardless if one tries to assign a different one.

    At least FHEM then will mix up these infos from different gw's and build a "virtual" Node 0 combining the infos sent from each gw.

    For other nodes, this can be avoided, as one can assing a really individual ID (and in FHEM assign the right path in filesystem to the corresponding gw to make sure communication works as expected).

    So from FHEM's point of view, it would be desirable to distinct between real gw functionality (that has to use ID "0") and the "other" part ("ordinary sensor functionality) allowing to handle that as a seperate unit and address this under a seperate ID (in case if needed).

    (Hard to explain, hope, you got my idea).


  • Mod

    @rejoe2 so with FHEM you need to manually keep track and make sure you never assign the same node id to two nodes, regardless of how many gateways you have, which radios (or rs485) they use and which frequencies? And you can never have more than 254 nodes in your home?

    I'd say get a better controller if that's the case ๐Ÿ™‚



  • @mfalkvidd Your conclusion with the max of 254 nodes to be handled by FHEM seems to be right ๐Ÿ˜ ! But as I like to combine sensors, most likely this will not be a practical limitation to my personal use cases.

    Wrt "better controller": FHEM seems to have other advantages - starting with the small but important point that to some extend I personally understand how to use it ๐Ÿ˜† . And it is able to handle properly and direct the most of the commercial hw I use (Homematic - afaik there does not exist any comparable solution wrt this hw).

    So how about possibilities to split up gw and node reports? Misunderstood from my side? Possible, but hard work? Small change in code?


  • Mod

    @rejoe2 my guess is "quite hard, with more problems than we can anticipate". but maybe it is not that hard. Hack away on the code and see what your impression is.



  • @mfalkvidd said in Mulitple Gatways and NodeID0:

    Hack away on the code and see what your impression is.

    To be honest: It's already hard work to me to get a more or less clear picture how all these parts of the "big puzzle" fit together... But doing this type of coding most likely is far beyond my knowledge ๐Ÿ˜ง .

    As a side note wrt controller capabilities: I don't really believe this "limitations" are only affecting FHEM - this seems to be have its roots in the times MySensors was "only" using nRF24 as transport. Then, having multiple gw's was not "on the list" of most of the implementations.

    Just in case I really dare to digg into that: Do you have a hint for a starting point in the code to look at?


  • Mod

    @rejoe2 there could still be multiple nrf gateways on different radio channels, so the assumtion would still be bad for nrf-only networks.

    The quick and dirty way, that might or might not break seemingly unrelated things, is to change

    message.sender = getNodeId();
    

    to

    message.sender = 42; // or whatever number you fancy
    

    here: https://github.com/mysensors/MySensors/blob/af3452f91c15b60cc7666b6225fa7342f08a6f52/core/MySensorsCore.cpp#L309

    Note that with this change it will not be possible to send any messages to the node.



  • @mfalkvidd Thx for the "quick and dirty" way. This at least is a starting point, but most things around that seem really to be hard coded (MySensorsCore.h: L77: GW Address is 0 is the point where the getNodeId() finally leads to).
    But if that really works there might be a way to wrap around that - but indeed this seems to be quite complicated.

    And indeed, you are right that having multiple nRF-GW's was possible ever since MySensors existed.


Log in to reply
 

Suggested Topics

  • 4
  • 15
  • 9
  • 9
  • 2
  • 20

59
Online

11.4k
Users

11.1k
Topics

112.7k
Posts