Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domoticz Device Removal Issue #1102

Closed
sghazagh opened this issue Jan 4, 2017 · 6 comments
Closed

Domoticz Device Removal Issue #1102

sghazagh opened this issue Jan 4, 2017 · 6 comments

Comments

@sghazagh
Copy link

sghazagh commented Jan 4, 2017

Hi,
I am experiencing device remove issue on Domoticz running on Raspberry Pi.(Domoticz Version 3.5877)

Sometimes when I delete a Node from the list of available Nodes in WiFI Gateway device/node list, Domoticz says that the item is removed and its not showing that in the list, so its fine!

However, I realized that its actually keep the record of that NodeID somewhere as after that it does not allow to register the device with same NodeID again.

It forces me to remove the specific NodeID from the code that I want (for example remove #define MY_NODE_ID 11) and it then add it not to the same NodeID I was deleted but into the new NodeID for instance '13'.

It shows that the NodeID 11 is not available to register on so it uses the new available NodeId which in my case is 13.
But that does not seems correct as I assume after deleting the NodeID, it should be the next available NodeID in sequence to register as default and not skip that.

Please advise if I understood it correctly and see why it's happening...
Thanks,

@gizmocuz
Copy link
Contributor

gizmocuz commented Jan 4, 2017

could you post some screenshots ?

@sghazagh
Copy link
Author

sghazagh commented Jan 4, 2017

Hi,
Here is snapshot of my Devices listed under my WiFi Gateway (IDX11).
As you can see the 'Alarm Siren' is registered on NodeID 13.
It had happened as I couldn't re-register it on NodeID 11 after removing the NodID 11 from the list and all it's sensors at device list.

It forced me to remove my reserved NodeID in my code and let the Domoticz decide on registering and assigning the NodeID. And it registered it on NodeID 13!

Hope you find why its happening!
I have been experiencing this for some other Nodes registration on and off...
1
2

@sghazagh
Copy link
Author

sghazagh commented Jan 4, 2017

Hi again,
I dug into the domoticz.db and as I expected, have found that the record of NodID 11 still has kept in the database in table "MySensorsChild":
db

As you know, the red rectangle row in fact is REPEATER child id which has not been deleted after removal of NodeID 11.
By the way, the last two row then have registered fine as the NodeID was changed to 13.

Hope you can help...

@gizmocuz
Copy link
Contributor

gizmocuz commented Jan 5, 2017

Thank you for the screenshots

Strange as when you delete a node, it calls

void MySensorsBase::RemoveNode(const int nodeID)
{
	m_sql.safe_query("DELETE FROM MySensors WHERE (HardwareID==%d) AND (ID==%d)", m_HwdID, nodeID);
	m_sql.safe_query("DELETE FROM MySensorsChilds WHERE (HardwareID==%d) AND (NodeID=='%d')",m_HwdID, nodeID);
}

when a child was not found in the system, it adds it to this table

What i could expect is that when you deleted it, you directly received a value for it ?

It would also recommend to assign fixed node id's to your sketches

@sghazagh
Copy link
Author

sghazagh commented Jan 5, 2017

It would also recommend to assign fixed node id's to your sketches

That's exactly when my problem happens.
If I set the static NodID in my sketch I cannot add it to NodeID 11 which I want. Other Node ID like for example 14,15,... should be fine I believe.

@gizmocuz
Copy link
Contributor

gizmocuz commented Feb 4, 2017

I can not replicate this.
If you can , or can submit a pull request to solve the issue, please open this issue again

@gizmocuz gizmocuz closed this as completed Feb 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants