Conflicts with neighbour's gateways ?

  • Hi,
    A neighbour is about to build its own MySensors network.. and I already have mine.. Reading the main documenttation, I can't understand if there's a risk of conflict between sensors.
    For instance, I read that on one network, there can be only one gateway. However, I also read that if you use NRF24 sensors, you can use different radio channels.
    So, how should we manage the various MySensors networks appearing with neighbours ? For instance, during "presentation" phase, the sensor gets a unique nodeID, but is there a risk it asks the gateway from neighbour and get an ID already existing in my own network ?
    Later on, how a sensor can send info to a specific gateway ? (here, my guess is that unless we introduce the security options, then all gateways coul read the sensors).
    On the opposite, if a sensor is requesting info from controller (requesting time or any other setting), how do we make sure that it asks from correct gateway ? Is it only by setting up different radio channels (and thus ask your neighbour to use a differetnh channel than yours?)


  • Mod

    You have many channels to use so hopefully you will not use the same (change the default one of course) and also you can use encryption just to play safe

  • Admin


    Besides channel, you can also change the MY_RF24_BASE_RADIO_ID for nrf24. This will give you the possibility of a huge number of networks on the same frequency if the traffic is low.

  • Hardware Contributor

    You can also use the security features of mysensors so that your node doesn't connect to your neighbors gateway even if it uses the same channel. Using a different channel would be easier though i guess.

  • Hi,
    Thanks for these hints.
    Changing the frequency is probably easy, but does it prevent a new Node to ask for a NodeID from another gateway ?

    Regarding the solution with base Node ID, I don't understand how to use that setting. Documentation states :

     * @def MY_RF24_BASE_RADIO_ID
     * @brief RF24 radio network identifier.
     * This acts as base value for sensor nodeId addresses. Change this (or channel) if you have more
     * than one sensor network.
    #ifndef MY_RF24_BASE_RADIO_ID
    #define MY_RF24_BASE_RADIO_ID 0x00,0xFC,0xE1,0xA8,0xA8

    but I don't understand how to use that.. I searched the forum and the internet, but I could not find examples. What mean "0x00,0xFC,0xE1,0xA8,0xA8" ? Are they random values I can decide by myself (and then use the same for each of my sensors) ? Like I could state:
    #define MY_RF24_BASE_RADIO_ID 0x01,0x02,0x03,0x04,0xFF

    Is there a downside of using that setting compared to changing radio frequency ? (it still looks much more simple than using the security.. I couldn't find a tutorial that I can understand.. but I admit I didn't spend hours on investigating security yet. That's on my mid-term to-do-list)


  • Mod

    I'd go with another channel to avoid interference and use cryptography to add some security to your network

  • I understand everyone prefers using different radio channels, but no one knows how to use the MY_RF24_BASE_RADIO_ID setting and what are the pros/cons ?

  • Admin


    From the NRF24 datasheet:
    0_1518649573473_Screen Shot 2018-02-15 at 00.05.12.png

    So, you should probably choose address a bit careful.

    To change base address just add a define in your sketch like this (before including MySensors.h):

    #define MY_RF24_BASE_RADIO_ID 0x00,0xFC,0xE1,0xA8,0xA8