Page 1 of 1

problems reconnecting to slave

Posted: Thursday 13 May 2021 9:32
by jamarcusking
Dunno where to post this.

I have a setup with a master and slave raspeberry pi, both running domoticz 4.9700, For some reason the slave pi hangs now and then and the only solution is a reboot by power toggle. So I set up an AC-swith on the slaves power adapter. The switch is controlled by the master. On the master I set up an event that toggles the power of the switch when the slave pi has been down for ten minutes (I use thepinger to check that). After reboot the slave comes up as it should and I can access it directly if I want, but the master never reconnects to the slave. I have to enter setup -> hardware and chose the slave and press [update] to reconnect. How can I make it do that automatically?

I would like to be able to do the same as a command in the event handler.

Thanks for any help!

Re: problems reconnecting to slave

Posted: Thursday 13 May 2021 9:37
by psubiaco
I believe it's better you solve the hang-up problem. It's not safe to turn off power supply to a linux machine with filesystem monted in read-write mode!
Linux must not crash: check the logs and connect a monitor to the HDMI output to understand why it crashes.

This is my raspberry, with hundreds of sensors and switches, 59 days uptime (because I manually switchoff it for maintenance 2 months ago).
root@casa:~# uptime
09:35:28 up 59 days, 13:06, 1 user, load average: 0,14, 0,27, 0,31

Paolo

Re: problems reconnecting to slave

Posted: Thursday 13 May 2021 12:44
by waaren
jamarcusking wrote: Thursday 13 May 2021 9:32 I would like to be able to do the same as a command in the event handler.
If you enable the developer window in your browser before you press the update button you will see the JSON/API that is send from the GUI to domoticz in the network tab.

For me it is something like

Code: Select all

http://<dz IP: dz port>/json.htm?type=command&param=updatehardware&htype=3&loglevel=0&address=192.168.192.65&port=6144&username=PI&password=obscured&extra=&name=Synology&enabled=true&idx=17&datatimeout=0&Mode1=&Mode2=0&Mode3=0&Mode4=0&Mode5=0&Mode6=0
If you send the url you copied from the network tab from your script it will update / reconnect.