GW with MY_RFM69_ENABLE_ENCRYPTION in Domoticz?



  • Hello,

    I am setting up a new GW with Domoticz.

    The RF version of GW sketch contains:

    // Enable and select radio type attached
    #define MY_RADIO_RFM69
    #define MY_RFM69_NEW_DRIVER
    #define MY_RFM69_ATC_MODE_DISABLED
    //#define MY_DEBUG_VERBOSE_RFM69
    #define MY_RFM69_FREQUENCY RFM69_868MHZ
    #define MY_PARENT_NODE_IS_STATIC
    #define MY_PARENT_NODE_ID 0
    #define MY_RFM69_NETWORKID 90
    #define MY_NODE_ID 2
    #define MY_RFM69_ENABLE_ENCRYPTION
    

    However, despite Domoticz is seeing the GW, it fails to see the node. The node does contain

    #define MY_RFM69_ENABLE_ENCRYPTION
    

    and I have used the same AES key.
    In the Serial monitor I can see that both the sensor and the GW are talking, but the controller cannot understand it.

    Any ideas please?



  • If the clip above is from the Gateway, you are defining MY_NODE_ID 2. Usually the gateway Node ID is 0.

    Do you see anything in the Domoticz log? If you reset the gateway, the domoticz log should show the gateway version and say gateway ready (if you are using the default gateway sketch). If you don't see that, investigate the connection to the gateway.
    If Domoticz sees the gateway, does it see the node present itself when the node is turned on? Should show up in the Domiticz log.


  • Mod

    The messages will be decrypted by the gateway before they are sent to the controller (Domoticz) so encryption should not affect Domoticz.

    What does the Hardware -> (the mysensors gateway) -> setup page look like?
    What does the devices page look like?
    As already mentioned, what does the domoticz log say?
    What does the gateway log say?

    And yes, the rest of nagelc's questions are also valid 🙂



  • @nagelc No, this code is from a node.

    I do not see GW READY message as this is an ethernet GW. Domoticz though does recognise the GW and I can ping the GW's IP.



  • @mfalkvidd Let's put it this way, everything works smoothly without encryption. However, as soon as I upload the same GW sketch with encryption (both GW and the node have the same AES key). GW is seen by Domoticz and the node just becomes invisible. I can see there is a successful communication between the node and the GW (sadly I did not save the log). Something fails at the GW level, but you gave me a hint:

    he messages will be decrypted by the gateway before they are sent to the controller
    

  • Contest Winner

    @alexsh1 watch your ram usage. Enabling features cost ram, and that may cause stack corruption because the ram usage could grow into the stack on Arduinos. And that may result in unexpected behavior. So you gw might act up and that may interfere with controller communication in one form or another.



  • Encryption Is Pure RFM69 job. So no additional RAM or flash usage. Only initial pconfiguration of RFM.


  • Contest Winner

    @kimot not entirely true. There is some additional code needed to provision the AES key. Granted, it is limited but not nonexistent. What is definite is that controller has no knowledge about node-gw encryption.



  • I have abandoned an encryption idea for now as I do not have too much time to troubleshoot it.


 

380
Online

8.0k
Users

8.8k
Topics

94.3k
Posts