offline

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
reinierdevlaam
Posts: 6
Joined: Tuesday 07 December 2021 9:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

offline

Post by reinierdevlaam »

I installed Domoticz on a pi 4B and Buster OS
Domoticz stopped all the time

After I did a chown pi.pi on the files in the Domoticz directory (as suggested in the troubleshooting guide) I could start Domoticz with

Code: Select all

sudo ./Domoticz 
and the website and dashboard appeared
So far so good

Then I stopped the service with ctl-c and started it in the normal way with

Code: Select all

sudo service Domoticz start
Now I can connect to the Domoticz node, but now it appears to be offline (#/offline)

If I stop the service

Code: Select all

sudo service Domoticz stop
And start it again with

Code: Select all

sudo ./Domoticz 
Everything works just fine

How to solve this
User avatar
waltervl
Posts: 5908
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: offline

Post by waltervl »

Are there hints when, after you started Domoticz service, you do

Code: Select all

sudo service domoticz status
Check next file for inconsistencies, it is the startup script that service is using to start Domoticz. Did you change the domoticz.sh file in the install folder?
/etc/init.d/domoticz.sh
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
HansOtten
Posts: 50
Joined: Saturday 17 April 2021 9:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Mierlo
Contact:

Re: offline

Post by HansOtten »

If you had to do a chown on pi, you were running too much of the installation as root instead of as user pi
No idea what that leaves for effects on the files everywhere.

Did you perform the installation by the book?

I would start over with a fresh buster lite (avoid the latest Raspberry Pi OS).
Raspberry Pi 4, SSD, RFlink, P1 Smart Meter. Many Zigbee devices CR2562 USB stick. Bresser via Weather Underground
Switched to Home Assistant!
reinierdevlaam
Posts: 6
Joined: Tuesday 07 December 2021 9:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: offline

Post by reinierdevlaam »

I follewed the instructions here

https://krijnermerins.nl/domoticz/domoticz-installeren/

(in Dutch, but just follow command sequence)

I did a re-install. Yes, I know to leave bullseye alone, there are many issues with that release.
I did a new install and this is the result from a status request
Somehow it stopped

The 21:14 timestamps is probabaly when I installed it, then it worked and I switched it off. Then at 22:13 I switched on the system again

sudo service domoticz status
● domoticz.service - LSB: Home Automation System
Loaded: loaded (/etc/init.d/domoticz.sh; generated)
Active: active (exited) since Tue 2021-12-07 21:14:50 CET; 1h 7min ago
Docs: man:systemd-sysv-generator(8)
Process: 449 ExecStart=/etc/init.d/domoticz.sh start (code=exited, status=0/SU

Dec 07 21:14:49 Domo systemd[1]: Starting LSB: Home Automation System...
Dec 07 21:14:50 Domo domoticz.sh[449]: 2021-12-07 21:14:50.025 Status: Domoticz
Dec 07 21:14:50 Domo domoticz.sh[449]: 2021-12-07 21:14:50.025 Status: Build Ha
Dec 07 21:14:50 Domo domoticz.sh[449]: 2021-12-07 21:14:50.025 Status: Startup
Dec 07 21:14:50 Domo domoticz.sh[449]: domoticz: Domoticz is starting up....
Dec 07 21:14:50 Domo domoticz[473]: Domoticz is starting up....
Dec 07 21:14:50 Domo domoticz[512]: Domoticz running...
Dec 07 21:14:50 Domo systemd[1]: Started LSB: Home Automation System.
Dec 07 22:13:29 Domo domoticz[512]: Domoticz stopped...
User avatar
waltervl
Posts: 5908
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: offline

Post by waltervl »

I do not understand the switching off. Domoticz is an application you will have to run always 24/7. If you mean you opened the webrowser again to logon that would make sense.

If you mean you logged on to the system with SSH it is not clear why it stopped at 22:13. While running can you check the log (menu setup - log) as that should give more info.
If the log is not visible then you could store it on the drive with the instructions on the troubleshooting page https://www.domoticz.com/wiki/Troubleshooting
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
reinierdevlaam
Posts: 6
Joined: Tuesday 07 December 2021 9:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: offline

Post by reinierdevlaam »

I'm in the construction/set-up fase, so it doesn't have to run all the time just yet
User avatar
HansOtten
Posts: 50
Joined: Saturday 17 April 2021 9:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Mierlo
Contact:

Re: offline

Post by HansOtten »

I am not going to check the whole guide you refer to, but I prefer official guides instead of well meant external guides.

The need to do a chown makes me suspect problems in the guide

This remark in the guide is complete nonsense and shows the age/quality
Domoticz automatisch opstarten
Na elke herstart van de Raspberry moet ook Domoticz handmatig gestart worden. Dit is natuurlijk niet handig, maar gelukkig is dit eenvoudig op te lossen.


And there is more nonsense in that guide!
So avoid that guide and use the official guides

- raspberry pi with official power supply
- Get a new SD and low level check it, or (better) a SSD with a working-for-boot USB-C cable
- raspberrypi.org buster lite installation via raspberry pi imager on SSD or SD
- https://www.domoticz.com/wiki/Raspberry_Pi (use the latest stable, avoid beta for production)

The process takes not much time and gives a perfect working system that after installation you leave running all the time. There is a lot happening in Domoticz in the background, housekeeping etc. Let it do its job!

So stop starting stopping it manually, only when instructed after a new plugin for example, and use the Domoticz website Setup/More Options/Restart instead of the cli.
Raspberry Pi 4, SSD, RFlink, P1 Smart Meter. Many Zigbee devices CR2562 USB stick. Bresser via Weather Underground
Switched to Home Assistant!
reinierdevlaam
Posts: 6
Joined: Tuesday 07 December 2021 9:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: offline

Post by reinierdevlaam »

I also used the guide from Domoticz, which isn't much different

I use buster-lite, with GUI, although after initialisation the pi is mounted in a headless box and I use SSH to connect to it. The GUI is just easy when troubleshooting and editing files


Now the very odd thing is that I had it working. It came up with the dashboard. So I shutdown (sudo shutdown) the pi for the night so I could continue the set-up today.
So I just started the pi and now I get "#/Offline again....

Getting frustrated :evil:
User avatar
waltervl
Posts: 5908
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: offline

Post by waltervl »

This is due to your shutdown and cold start see wiki https://www.domoticz.com/wiki/Troublesh ... _cold_boot

Next the the given solution the other solution is to not shutdown your Pi.... :)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: offline

Post by EddyG »

I think that this is all about ownership of files.
You login with user pi and changed all files to pi:pi
And can work if you start Domoticz as user pi.
But the system starts Domoticz as user root, hence a problem with ownership of files, because the domoticz.db needs write access.
You could change the rights of the domoticz.db to 0x666 then it might work.
reinierdevlaam
Posts: 6
Joined: Tuesday 07 December 2021 9:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: offline

Post by reinierdevlaam »

This is due to your shutdown and cold start see wiki https://www.domoticz.com/wiki/Troublesh ... _cold_boot

Next the the given solution the other solution is to not shutdown your Pi.... :)
ah, that's the trick most likely. Been focussing too much on the offline message, hadn't realized it only occurs after cold boot

I have some RTCs lying around, must see if I can find some place in the box to mount one...
Or use one of the other options

thanks
User avatar
HansOtten
Posts: 50
Joined: Saturday 17 April 2021 9:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Mierlo
Contact:

Re: offline

Post by HansOtten »

Buster lite with GUI? Harmless for Domoticz afaik, but takes SD and memory though, so that is not a clean install of Buster Lite.
I have more than enough control via SSH CLI, even editing with nano is fine. Rarely need it also.

What else did you configure on this Pi? Did you install a clean Buster on an empty SD or kept on experimenting with the troublesome system?

Why the RTC? Your Pi is networked and needs to be, or else you cannot control it with the Domoticz interface from phone or PC.
So the Pi OS will pick up the correct time on boot from the internet. I would not bother with RTC's therefore, complicating things again.

Installing and keeping things standard will make your system stable.

Your replies give the impression your problems arise from changing/adding a lot and do not tell us all you did.
Raspberry Pi 4, SSD, RFlink, P1 Smart Meter. Many Zigbee devices CR2562 USB stick. Bresser via Weather Underground
Switched to Home Assistant!
reinierdevlaam
Posts: 6
Joined: Tuesday 07 December 2021 9:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: offline

Post by reinierdevlaam »

It is a 32G card, so space enough. As said, if there are serious issues I'd like to use the GUI for editting and vieuwing files.

Yes I made a completely clean set-up. Nothing else is there, only Domoticz. Initially I also tried to install Grafana, but I left that path for now so made a new clean buster installation. I heard about too many issues with bullseye so will not use that

The RTC would be to avoid having to restart Domoticz each time, as explained in a previous reply, the cold boot is the issue and the time it takes to connect to the net and fetch the time

https://www.domoticz.com/wiki/Troublesh ... _cold_boot

and a RTC can solve that. So in the experimental phase I'm in now that could be a solution. I will see what I will do when I have time again.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: offline

Post by EddyG »

Initially you talked about difference between starting Domoticz on the command line or as a service.
That has nothing to do with 'coldboot'
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest