theolind / pymysensors

Python API for talking to a MySensors gateway
MIT License
62 stars 43 forks source link

Wrong generation of node IDs during presentation #152

Open subakun opened 6 years ago

subakun commented 6 years ago

[branch master - version 0.14.0 - Using serial gateway - NO asyncio] When presenting a new sensor node it sometimes happens (about 50% of times) that an extra Node ID is generated with all keys set to null. For example if I present a new node to an empty Json file the node ID=1 is generated with all null values and then the Node ID=2 is generated and the sensor is presented correctly. Sometimes things get even worse and a few empty nodes (3 or 4) are generated before the Node gets presented correctly. Please see attached .json file after the presentation of three sensor nodes. mysensors.json.txt

MartinHjelmare commented 6 years ago

Can you also add a debug log of the node - gateway conversation that generates the problematic persistence file?

subakun commented 6 years ago

Hi Martin, many thanks for your reply ! I will try to re-produce the problem and log the gateway debug output. I wont be able to work on it until tonight.

subakun commented 6 years ago

Martin, for the moment I cant reproduce the problem but I have noticed that sometimes the presentation of a child sensor is delayed with respect the generation of a new node ID. it could be because a presentation message get corrupted by another node sending its "set" messages . . . ?. Let's leave the issue open for now, I want to see if the problem shows up again....

flatsiedatsie commented 5 years ago

Did it show up again?