restart domoticz possible by esp32?

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

Post Reply
BartSr
Posts: 347
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.3
Location: Netherlands
Contact:

restart domoticz possible by esp32?

Post by BartSr »

Due to current problem that domoticz requires a restart few times each week I wonder if it's possible to sent kind of HTTP command from esp.
Is that doable. I am looking for command something like:
http:// domoticzIP, 'sudo service domoticz.sh restart'
or do I suggest something complete idiot?
Bart
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 espeasy
MQTT
WouterO
Posts: 40
Joined: Sunday 14 May 2023 19:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: restart domoticz possible by esp32?

Post by WouterO »

You could easily make a crontab job, e.g., restarting Domoticz every day, including the command sudo systemctl restart domoticz.service

The underlying problem, though, in my opinion is something in your Domoticz setup. As far as I know there is no ‘current problem’ with Domoticz requiring a restart. At least, I am not experiencing anything wrong with the newest Domoticz version, 2024.7.
BartSr
Posts: 347
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.3
Location: Netherlands
Contact:

Re: restart domoticz possible by esp32?

Post by BartSr »

@Wouter0
A number of members als suffer from same problem. Also a github issue is there. Gizmocus has a look at it too.
I don't want a crontab solution for I want to restart once domoticz don't response.
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 espeasy
MQTT
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: restart domoticz possible by esp32?

Post by Egregius »

Use the developer tools of your browser...

Code: Select all

http://192.168.2.2:8080/json.htm?type=command&param=system_reboot
This is a script I run on the domoticz server itself:

Code: Select all

DOMOTICZ=`curl -s --connect-timeout 2 --max-time 5 "http://127.0.0.1:8080/json.htm?type=command&param=getdevices&rid=1"`
STATUS=`echo $DOMOTICZ | jq -r '.status'`
if [ $STATUS = "OK" ] ; then
	exit
else
	sleep 20
	DOMOTICZ=`curl -s --connect-timeout 2 --max-time 5 "http://127.0.0.1:8080/json.htm?type=command&param=getdevices&rid=1"`
	STATUS2=`echo $DOMOTICZ | jq -r '.status'`
	if [ $STATUS2 = "OK" ] ; then
		exit
	else
		sleep 20
		DOMOTICZ=`curl -s --connect-timeout 2 --max-time 5 "http://127.0.0.1:8080/json.htm?type=command&param=getdevices&rid=1"`
		STATUS3=`echo $DOMOTICZ | jq -r '.status'`
		if [ $STATUS3 = "OK" ] ; then
			exit
		else
			/usr/sbin/service domoticz stop
			/usr/sbin/service domoticz start
		fi
	fi
fi
WouterO
Posts: 40
Joined: Sunday 14 May 2023 19:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: restart domoticz possible by esp32?

Post by WouterO »

BartSr wrote: Friday 23 August 2024 23:44 @Wouter0
A number of members als suffer from same problem. Also a github issue is there. Gizmocus has a look at it too.
I don't want a crontab solution for I want to restart once domoticz don't response.
Yeah, I just saw the other messages. I agree that for your problem a crontab job is no solution. I hope the cause of your problem (some plug-in issue?) is soon found.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: restart domoticz possible by esp32?

Post by waltervl »

As long as your crashing issue is not fixed use the monit application to monitor Domoticz and have it restarted when Domoticz becomes unresponsive. See wiki for more information https://www.domoticz.com/wiki/Monitoring_domoticz
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests