Strange behaviour in creating Nodes



  • Hi all
    First, I use the latest v.2 beta version of MySensors, and latest development version of Domoticz.

    When I add my 3 identical Door Switches, they are created with either 1 or 2 children. All children are created with a child ID of 0 (S_LOCK ). But some of them are also created with a child ID of 255 (S_ARDUINO_NODE ).

    • What is the normal behaviour – 1 or 2 children created?

    • Should I just ignore it and delete the 255, S_ARDUINO_NODE – would there be any implications in doing this?

    • Should I contact the Domoticz forum, as this is a flaw?

    This is my 3 Nodes:
    0_1466843405797_Nodes.jpg

    Here the node are created with only 1 Child:
    0_1466843432469_1_child.jpg

    Here are a similar node created with 2 Children:
    0_1466843460717_2_child.jpg



  • You say that Your sensors are identical. What about the software You're flashing into them?
    Put the software side by side and compare.
    And You'd probably get more answers if You'd add Your firmware to Your post since Your
    problem is almost certainly software related.

    Did You use the "beta" version of MySensors for all of Your sensors?

    What's Your problem with the additional child anyway? It won't change the sensor's performance
    (some of my sensors do that, some don't, no matter!"). And seriously, one can't have too many children 😉

    Bye,
    C.



  • As I wrote, I use the latest v.2 beta version of MySensors, and latest development version of Domoticz. Both HW and SW are 100% identical on the 3 nodes. This issue was seen with other versions of Domoticz also.

    I should add that I use a serial gateway based on the RFM69 radio.


  • Hero Member

    The 255 Child is created when the node presents itself before any other childs are "born", the 255 is system (MySensors) reserved. If al goes well there should be a 255 'Child' for every node.
    I would not bother because it should not influence functionality. Maybe your node had a 'fail' with its first presentation.
    Btw the Domoticz forum is the best place to ask.. 😏



  • @AWI
    Thanks - I will try the Domoticz forum to see if I can get closer to an answer.

    Br
    Lemme



  • Still - I think this question is relevant in this forum, and maybe for a developer to answer:

    Does it matter what comes first during the ‘presentation’ (present/sendSketchInfo or the other way around)? What is the correct sequence?

    This is how I do the presentation:

    void presentation() {
      present(CHILD_ID, S_LOCK);
      sendSketchInfo("Door switch", "1.0");
    }
    

    Br
    Lemme



  • I posted this on the Domoticz site as well...

    It seems that things are partly begin to work correctly. I found out that all examples had 'sendSketchInfo' first. I also found delays in one of the examples, and I implemented that as well. This is how it looks like now:

    void presentation() {
      sendSketchInfo("Door switch", "1.0");
      wait(500);
      present(CHILD_ID, S_LOCK);
      wait(500);
    }
    

    I also updated MySensors library, there were som TransportProcess cleanup yesterday, and it seems that some of those changes included some changes to the presentation as well.

    All nodes are now created with only 1 child of 0. So I must conclude that creating child_id of 255 is wrong.

    As this seems to work now, there are now another problem. Only one of the nodes are identified correctly as an S_LOCK node. The variable V_LOCK_STATUS are identified correctly on all nodes.

    All nodes now have 1 child:
    0_1467144011175_Nodes.jpg

    This node have both S_LOCK node the variable V_LOCK_STATUS identified correctly
    0_1467144038970_1_child.jpg

    The remaining nodes are missing the S_LOCK, but the variable V_LOCK_STATUS identified correctly
    0_1467144057966_2_child.jpg

    Any clue why this is happening?

    Br
    Lemme


  • Hardware Contributor

    Hello, did you check the debug log for one of the node that doesn't have the S_LOCK type, if you have a st=fail in the presentation message ? Looks like the sendSketchInfo succeeded but not the present(), and then the node sent a status message in a V_LOCK_STATUS message type, which succeeded also, so Domoticz created the child node with the received child ID but doesn't know the type of node.



  • Hi Nca78
    I do not have the opportunity to see the debug information, as my node are on a custom PCB. But I think that you are onto something here. All the examples in the v2 development version, are presenting like this:

    void presentation() {
      sendSketchInfo("Door switch", "1.0");
      present(CHILD_ID, S_LOCK);
    }
    

    But is this the correct sequence? I would assume that present() should be initiated first, to let the controller create the node. Only then should sendSketchInfo() be sent, to fill in the 'nice to have' information. In the MySensor documentation it is stated that sendSketchInfo() is optional, so it is not needed for the controller to create the node. So I can simply not understand why the examples start with sendSketchInfo() to create the node. It should/could make some strange results in the controller.

    I would assume that this is the right sequence. The node are first presented for the controller and created. The node are the updated with the sketch info.

    void presentation() {
      present(CHILD_ID, S_LOCK);
      sendSketchInfo("Door switch", "1.0");
    }
    

    Again, maybe this is for a developer to answer. Does it matter what comes first during the ‘presentation’ - what is the correct sequence?

    Br
    Lemme


  • Hero Member

    @Lemme the sketch info is for the "node". This is created anyhow independent on if the sketch info is sent. So the order does not matter.
    But then... Some controllers may have a different implementation..



  • Yes - you are right.
    I have now done a whole series of tests, where I created nodes in different configurations, and read the debug information.

    It is not the present() is I was thinking, that creates the node in the controller. At the Domoticz forum, gizmocuz said that it does not matter what comes first - present() or sendSketchInfo().

    So the issue about creating nodes in a consistent way are not related to this. So far so good...

    Last evening I tried the stable version 1.5.4. I created ten 100% identical nodes i an row, without any errors. It could be that there are still some issues with the v2 development version, or that the new version are handled differently, and that is not implemented in Domoticz yet.

    It seems that I have to go with 1.5.4 for now, and wait until v.2 are released and these issues are sorted out between MySensors and Domoticz.

    Thanks for the feedback!

    Br
    Lemme


 

478
Online

7.9k
Users

8.7k
Topics

93.6k
Posts