Install on RPI, username error

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

Moderator: leecollings

Post Reply
StarWing01
Posts: 1
Joined: Thursday 16 November 2023 19:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Install on RPI, username error

Post by StarWing01 »

I'm using Domoticz for quite some time on a virtual ubuntu machine.
For my parents I'm building a new setup based on a new RPi 3. I'm new to Rpi's.

So I followed the guide and was able to start and access domoticz.
But I'm running in to a problem with the additional steps to move the log and db files to a ramdrive as described https://www.domoticz.com/wiki/Moving_Lo ... _RAM_Drive

I am able to create the ramdrive:

Code: Select all

pi@raspberrypi:~/domoticz $ df -h
Filesystem      Size  Used Avail Use% Mounted on
...
tmpfs            20M  4DOT0K   20M   1% /tmp/log
But when dooing the next step, moving the temp files to the ramdrive, for some reason I break the install. If I do this steps as described, and then start domoticz, it keeps asking for a username/pass. The default which worked in the initial install do not work. Resetting the password with the ./domoticz -nowwwpwd throws a bunch of errors, which domotictz tells me it cannot find the db.

I altered the domoticz sh file as mentioned in the howto.

Code: Select all

do_start()
{
        # Script that waits for time synchronisation before starting Domoticz to prevent a crash
        # on a cold boot when no real time clock is available.

        # Check if systemd-timesyncd is enabled and running, otherwise ignore script
        if systemctl --quiet is-enabled systemd-timesyncd && systemctl --quiet is-active systemd-timesyncd; then
            # Check if time is already synced, if so start Domoticz immediately
            if [ -f "/run/systemd/timesync/synchronized" ]; then
                printf "Time synchronized, starting Domoticz...\n"
            else
                # Check if custom time server(s) are defined
                if grep -q "^#NTP=" /etc/systemd/timesyncdDOTconf; then
                    printf "INFO: No time server(s) defined in /etc/systemd/timesyncdDOTconf, using default fallback server(s)\n"
                fi
                # Wait a maximum of 30 seconds until sync file is generated indicating successful time sync
                printf "Waiting for time synchronization before starting Domoticz"
                count=30
                while [ ! -f "/run/systemd/timesync/synchronized" ]
                do
                    count=$((count-1))
                    if [ $((count)) -lt 1 ]
                    then
                        # If failed, print error message, exit loop and start Domoticz anyway
                        printf "\nWARNING: Time synchronization failed, check network and /etc/systemd/timesyncdDOTconf\n"
                        printf "Starting Domoticz without successful time synchronization...\n"
                        break
                    fi
                    printf "."
                    sleep 1
                done
                #If the file was found in time, sync was successful and Domoticz will start immediately
                if [ -f "/run/systemd/timesync/synchronized" ]
                then
                    printf "\nTime synchronization successful, starting DomoticzDOT..\n"
                fi
            fi
        fi
       # edit to move SQLite temp files to RAM drive
       ln -sf /tmp/log/domoticzDOTdb-shm /home/pi/domoticz
       ln -sf /tmp/log/domoticzDOTdb-wal /home/pi/domoticz
       # end of edit
        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
        start-stop-daemon --chuid $USERNAME --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
                || return 1
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
                $DAEMON_ARGS \
                || return 2
}
After this step when starting the service, I am no longer able to login with the default username/pwd.
So I had the idea to reset the pwd, which gives an error that the DB cannot be found:

Code: Select all

2023-11-16 19:34:20  Status: Domoticz V2023DOT2 (c)2012-2023 GizMoCuz
2023-11-16 19:34:20  Status: Build Hash: 19efd039c, Date: 2023-07-21 17:23:44
2023-11-16 19:34:20  Status: Startup Path: /home/pi/domoticz/
2023-11-16 19:34:20  Error: SQL Query("SELECT name FROM sqlite_master WHERE type='table' AND name='DeviceStatus'") : unable to open database file
.....

What am I dooing wrong ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest