Strange behaviour in creating Nodes

Moderator: leecollings

Post Reply
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Strange behaviour in creating Nodes

Post by Lemme »

Hi all
I posted this first in the MySensors forum, but was advised to post here.

For background information, I use the latest v.2 beta version of MySensors, and latest development version of Domoticz. The 3 nodes that I have are 100% identical, both HW and SW. I use a serial gateway based on the RFM69 radio.

Here is the situation - when I add my 3 identical Door Switches, they are created randomly 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?

Below is how I do the presentation. Is there anything wrong here, should I reverse the presentation so I send the sketch info before the present? Or should there be some 'delays' to give Domoticz time to create the nodes?

Code: Select all

void presentation() {
  present(CHILD_ID, S_LOCK);
  sendSketchInfo("Door switch", "1.0"); 
}
This is my 3 Nodes:
Nodes.jpg
Nodes.jpg (88.34 KiB) Viewed 2185 times
Here the node are created with only 1 Child:
1_child.jpg
1_child.jpg (68.8 KiB) Viewed 2185 times
Here are a similar node created with 2 Children:
2_child.jpg
2_child.jpg (79 KiB) Viewed 2185 times
Best regards
Lemme
User avatar
gizmocuz
Posts: 2542
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Strange behaviour in creating Nodes

Post by gizmocuz »

255 is reserved for the node, and i suggest to have your CHILD_ID to 1 ?
It could also be that maybe some sensors are just a bit to far away ?
Also make sure you have 'accept new hardware' enabled in the settings
Quality outlives Quantity!
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Re: Strange behaviour in creating Nodes

Post by Lemme »

Hi Gizmocuz
Thanks for answering. Just to remove any doubt, my sensors were not to far away from the gateway when I made the pairing, thats for sure. And I also enabled 'accept new hardware' in the settings before the pairing.

The 'CHILD_ID' is a variable that is set to 0. The question is, would it really make a difference to set it to 1? Does Domoticz have trouble handling ChildID's of 0? I can reflash my 3 nodes, but just want to know if this is a long shot before I do so.

Br
Lemme
User avatar
gizmocuz
Posts: 2542
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Strange behaviour in creating Nodes

Post by gizmocuz »

Why would you want to start with 0 ? Was there an original mysensors.org example with a child_id of 0 that you based your sensors code on ?
Quality outlives Quantity!
User avatar
gizmocuz
Posts: 2542
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Strange behaviour in creating Nodes

Post by gizmocuz »

So how i normally work, i have a spare arduino+rf that i use to make my mockup sketch with (demo sketch), if all is working (i use the serial log to check and log things), .... then (and only then), i start adding real hardware to the sensor, one by one, test and test
Then put it on the place where it belongs, if it is working good, i make some more if needed
Quality outlives Quantity!
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Re: Strange behaviour in creating Nodes

Post by Lemme »

In most of the MySensors examples, the Child_id are created as 0. So this is definitely not an issue, at least from a MySensors perspective. And that is also why I use child_id 0 myself. If Domiticz have an issue with child_id 0, then I will bring that to the MySensors Forum, or maybe it could be solved in Domiticz?

I am far beyond testing now. I have created my nodes with components soldered on fabricated PCB's. So the HW is in a sort of 'production' mode, and work very well. The issues that I am experiencing right now are SW related. And I really want things to be reliable, consistent and functioning as expected 100% of the time. I have some other small issues, but I address these later.

As a way to solve the problem, does it matter what comes first during the ‘presentation’ (present/sendSketchInfo or the other way around)?
And should there be some sort of delay in the code, to give Domoticz time to initialise correctly?

This is how I do the presentation:

Code: Select all

void presentation() {
  present(CHILD_ID, S_LOCK);
  sendSketchInfo("Door switch", "1.0"); 
}
Br
Lemme
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Re: Strange behaviour in creating Nodes

Post by Lemme »

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:

Code: Select all

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:
Nodes.jpg
Nodes.jpg (82.17 KiB) Viewed 2108 times
This node have both S_LOCK node the variable V_LOCK_STATUS identified correctly
1_child.jpg
1_child.jpg (59.81 KiB) Viewed 2108 times
The remaining nodes are missing the S_LOCK, but the variable V_LOCK_STATUS identified correctly
2_child.jpg
2_child.jpg (60.58 KiB) Viewed 2108 times
Any clue why this is happening?

Br
Lemme
User avatar
gizmocuz
Posts: 2542
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Strange behaviour in creating Nodes

Post by gizmocuz »

As explained, start with an virtual example, then implement your changes
Yes, it is important to send your sketchinfo, and sensor type's
Quality outlives Quantity!
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Re: Strange behaviour in creating Nodes

Post by Lemme »

Hi Gizmocuz
OK - I will go back to test on the Arduino board and my mockup sketch.

But I need a correct starting point. Can you be precise on what the preferred way of presenting MySensors nodes to Domoticz are?

Is it this way?

Code: Select all

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

Code: Select all

void presentation() {
  sendSketchInfo("Door switch", "1.0");
  present(CHILD_ID, S_LOCK);
}
This is at least the first way to start. I would assume that the node are first presented for the controller and created. The node are the updated with the sketch info.

Br
Flemming
User avatar
gizmocuz
Posts: 2542
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Strange behaviour in creating Nodes

Post by gizmocuz »

Preferred are the examples , it does actually not matter as the two things are totally not related to each other, as long as you first present, and then update a value
Quality outlives Quantity!
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Re: Strange behaviour in creating Nodes

Post by Lemme »

Reading your answer makes me a little confused...

You wrote:
'Preferred are the examples , it does actually not matter as the two things are totally not related to each other'.

This is how the examples are constructed. The very first time a node are presented to Domiticz, Domoticz recieves first 'sendSketchInfo' and then 'present', and according to your statement that is OK as the two things are totally not related to each other.

Example A

Code: Select all

void presentation() {
  sendSketchInfo("Door switch", "1.0");
  present(CHILD_ID, S_LOCK);
}
But then you write:
'as long as you first present, and then update a value'.

That statement indicates that the sequence are actually important. And that would mean that below example would be right. First the node are presented/created, and then the value are updated. Here the values are text strings - "Door switch" and "1.0".

Example B

Code: Select all

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


Does these comments makes any sense?

Sorry to be a pain about this...but I really need such a basic thing to be handled correct. Getting inconsistent results when creating the nodes drives me crazy. So - based on my comments, should I use example A or B?

Br
Lemme
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Re: Strange behaviour in creating Nodes

Post by Lemme »

I have now done a bunch of tests with virtual nodes as you suggested. And you are right, it makes no difference what comes first.
That leaves me to the conclusion that the issue is with the v.2 development version of MySensors. I did some testing last night with the stable 1.5.4 version, and here all the nodes were created correctely.

It could be that when the MySensors v.2.0 are released, there will be some adjustments to Domoticz.

Best regards
Lemme
tlpeter
Posts: 191
Joined: Wednesday 26 November 2014 18:43
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Strange behaviour in creating Nodes

Post by tlpeter »

Lemme, i have the same issue.
I changed my two nodes to 2.0.0 and the info is correct with child id 0 and child id 255 for the node and it shows the version.
Now i made a new node and it only shows the child id 0 and not the 255 anymore.
Somehow i cannot get this showed up in Domoticz anymore
trixwood

Re: Strange behaviour in creating Nodes

Post by trixwood »

Not sure if this helps but I use

https://github.com/mysensors/MySensors/ ... Config.ino

To get a clean eeprom. Just to make sure no traces are left from my experimenting.
Maybe in your case there are traces of older mysensors nodes stuff in the eeprom?
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Re: Strange behaviour in creating Nodes

Post by Lemme »

Hi Trixwood
In my case i erased the node every time. So that can not be it.

Br
Lemme
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest