At startup not using specified port

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

Moderator: leecollings

Post Reply
altaphista
Posts: 12
Joined: Tuesday 05 April 2022 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: NL
Contact:

At startup not using specified port

Post by altaphista »

Since my Raspberry reboot my Domoticz is refusing to startup after reboot, especially refusing to start from my specified port.
Until now I had it running on port 8888 where it was working fine next to deCONZ (using 80 thus 8080).

My /home/user/domoticz/domoticz.sh file and /etc/init.d/domoticz.sh file both have "DAEMON_ARGS="$DAEMON_ARGS -www 8888"".
When I start domoticz via $ sudo ./domoticz it gives this as feedback:

Code: Select all

2023-10-20 10:57:18.770  Active notification Subsystems: pushover (1/13)
2023-10-20 10:57:18.773  Status: WebServer(HTTP) started on address: :: with port 8080
2023-10-20 10:57:18.783  Status: WebServer(SSL) started on address: :: with port 443
2023-10-20 10:57:18.786  Starting shared server on: :::6144
no idea what i'm doing wrong. Updated my Pi and domoticz both but no luck...
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: At startup not using specified port

Post by waltervl »

The /etc/init.d/domoticz.sh should be used when domoticz starts automatically after reboot.
You can try to set logging to a file in /etc/init.d/domoticz.sh to see why domoticz fails to start.
See wiki for instructions: 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
altaphista
Posts: 12
Joined: Tuesday 05 April 2022 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: NL
Contact:

Re: At startup not using specified port

Post by altaphista »

thnx for your reply, but the whole problem is that I can't discover if /etc/init.d/domoticz.sh is running on startup. Well, domoticz isn't running on 8080 or (my defined) 8888 ports.... :?

When I manually start domoticz by running 'sudo ./domoticz', it isn't even looking at the port in the .sh file.... only when i start it with 'sudo ./domoticz -www 8888' it wil use that port. What is going on?
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: At startup not using specified port

Post by waltervl »

what is the output of

Code: Select all

sudo service domoticz status
That should show if domoticz is running as a service and started.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
altaphista
Posts: 12
Joined: Tuesday 05 April 2022 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: NL
Contact:

Re: At startup not using specified port

Post by altaphista »

this is the output after a reboot, with an unreachable domoticz web interface.
Really no idea why the config in /etc/init.d/domoticz.sh is not loaded... beats me. :roll:

Code: Select all

altaphista@raspberrypi:~ $ sudo service domoticz status
● domoticz.service - LSB: Home Automation System
     Loaded: loaded (/etc/init.d/domoticz.sh; generated)
     Active: active (exited) since Fri 2023-10-20 17:03:13 CEST; 22s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 645 ExecStart=/etc/init.d/domoticz.sh start (code=exited, status=0/SUCCESS)
        CPU: 9ms

Oct 20 17:03:13 raspberrypi systemd[1]: Starting LSB: Home Automation System...
Oct 20 17:03:13 raspberrypi systemd[1]: Started LSB: Home Automation System.
and this is the output after manual start on port 8888:

Code: Select all

altaphista@raspberrypi:~ $ sudo service domoticz status
● domoticz.service - LSB: Home Automation System
     Loaded: loaded (/etc/init.d/domoticz.sh; generated)
     Active: active (exited) since Fri 2023-10-20 17:03:13 CEST; 2min 32s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 645 ExecStart=/etc/init.d/domoticz.sh start (code=exited, status=0/SU>
        CPU: 9ms

Oct 20 17:03:13 raspberrypi systemd[1]: Starting LSB: Home Automation System...
Oct 20 17:03:13 raspberrypi systemd[1]: Started LSB: Home Automation System.
lines 1-9/9 (END)
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: At startup not using specified port

Post by waltervl »

That domoticz does not start after reboot is a known issue. Mostly due to network or time not available yet. See the same wiki and look at the cold boot section.
Please enable logging to a file to be sure so you can read why the webserver does not start correctly.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
altaphista
Posts: 12
Joined: Tuesday 05 April 2022 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: NL
Contact:

Re: At startup not using specified port

Post by altaphista »

waltervl wrote: Friday 20 October 2023 17:24 That domoticz does not start after reboot is a known issue. Mostly due to network or time not available yet. See the same wiki and look at the cold boot section.
Please enable logging to a file to be sure so you can read why the webserver does not start correctly.
It's not the issue that it won't start, but the issue is that the port is not loaded. Another service (DeCONZ) is blocking port 8080, so I specified port 8888 for use in the domoticz.sh file, and the logfile says it is using '/etc/init.d/domoticz.sh' but is doesn't use the port that is specified in that file!!! How is that possible.
To make it even stranger, until this previous boot it all worked fine, I didn't change anything. And now it's broken :lol:
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: At startup not using specified port

Post by waltervl »

From the status output it shows that it is using init-d/domoticz.sh setup. Sou again please also enable logging to the OS the see why it is not using port 8888
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: Bing [Bot] and 1 guest