Can't access z-wave after power cycling

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
otverber
Posts: 78
Joined: 28 Mar 2018 20:17

Can't access z-wave after power cycling

Post by otverber »

Hello

Due to some electrical work my raspi were cycled uncontrolled a few times.
Now I cant access the zwave trough zboxweb or local ipadress due to "Remote access not possible or wrong password"
I can access the pi trough putty and have restarted zwave.

any command trough putty that can solve the access denied problem?
Please help...
seattleneil
Posts: 203
Joined: 02 Mar 2020 22:41

Re: Can't access z-wave after power cycling

Post by seattleneil »

If you're not able to log onto Z-Way, there's a good chance 1 or more files needed by Z-Way have been corrupted.

Ideally, you enabled Z-Way to create cloud backups or you made a recent local backup and you just need to do a restore from the UI (Settings->Backup & Restore). As a suggestion, before you do anything, preserve the current Z-Way directory as a tar file named "z-way-server.tar", run: cd /opt; tar cvf z-way-server.tar z-way-server

If you're unable to login, this forum post should help: https://forum.z-wave.me/viewtopic.php?f ... 65&p=89360. Basically, you need to stop Z-Way, carefully edit the configjson-*.json file in /opt/z-way-server/automation/storage (search for admin and delete the password value that's between the double-quotes), save the file and then start Z-Way. Before you edit the file, confirm you've really stopped Z-Way by checking if the z-way-process exists (run: ps -ef | grep z-way).

If you don't have a cloud or local backup, try looking at the Z-Way log file (by default, /var/log/z-way-server.log) for an explanation.

From what you wrote, a plausible explanation is that the configjson-*.json file in /opt/z-way-server/automation/storage has a problem (that's the file where Z-Way passwords are stored).
otverber
Posts: 78
Joined: 28 Mar 2018 20:17

Re: Can't access z-wave after power cycling

Post by otverber »

Managed to delete the very long password. But cannot access anyway.
Should I insert the password in the file instead of leaving it blank ?
seattleneil
Posts: 203
Joined: 02 Mar 2020 22:41

Re: Can't access z-wave after power cycling

Post by seattleneil »

Please edit your config file to look like the following which uses password 123456:

Code: Select all

"login":"admin","password":"wrPCmELDoCUuwoEKwrM+w7rDtVU9LiAFw7zCj0DDoiHDk8OWw4A0w4UFw53CkMK6w6V6XMOTMVtYaHx8NlwNwrIpVEgcVxfDmsOkasK8wpwxw5vDgsKLwoA0wrsX","name":"Administrator"
otverber
Posts: 78
Joined: 28 Mar 2018 20:17

Re: Can't access z-wave after power cycling

Post by otverber »

managed to blank the whole json file

what do i do then?

how do I reinstall z wave with minimum hazle?
otverber
Posts: 78
Joined: 28 Mar 2018 20:17

Re: Can't access z-wave after power cycling

Post by otverber »

from log file
[2024-12-14 11:42:18.432] [core] Executing script: /*** Z-Way Home Automation Engine main executable ***************************** ...
[2024-12-14 11:42:18.541] [core] Executing script: // Comon utilities and functions ...
[2024-12-14 11:42:18.607] [core] Executing script: // This script transforms old formats to new ...
[2024-12-14 11:42:18.701] [E] [core] result: Error: SyntaxError: Unexpected end of input
at automation/updateBackendConfig.js:7:11
at automation/updateBackendConfig.js:680:3
at automation/main.js:23:1
[2024-12-14 11:42:18.704] [E] [core] result: Error: Error: Uncaught SyntaxError: Unexpected end of input
at Error (native)
at automation/main.js:23:1
[2024-12-14 11:49:36.851] [core] Executing script: exit()
seattleneil
Posts: 203
Joined: 02 Mar 2020 22:41

Re: Can't access z-wave after power cycling

Post by seattleneil »

Did you preserve the current Z-Way directory as a tar file named "z-way-server.tar"? If so, to restore your non-blanked config file, run the following command with z-way-server stopped:

cd /opt; tar xvf z-way-server.tar z-way-server/automation/storage/configjson*

Note that restoring the non-blanked config file using the tar command is just a first step - it gets you back to having a corrupt config file instead of a blank file.

The approach I would try to fix the config file is to use a json file validator tool. One tool is provided in the jsonlint package. You can install the package as follows:
sudo apt install jsonlint

To use the tool, stop z-way-server and run:
cd /opt/z-way-server/automation/storage
jsonlint-php configjson*

Assuming you're able to log back onto your Z-Way system after fixing the json file so that's it can be parsed by Z-Way, I suggest restoring the config file from either a cloud backup or a local backup since the fixed json file could have other errors.

On a tangent, @PoltoS might consider a feature enhancement where the configjson file maintains a week's worth of backups (e.g., Mon-configjson*, Tue-configjson*, Wed-configjson*, Thu-configjson*, Fri-configjson*, Sat-configjson*, Sun-configjson*) so that a user can easily revert to a backup. Alternatively, a user could create a cron job as user root that copies the configjson file each day. Something like the following:
1 0 * * * /usr/bin/cp /opt/z-way-server/automation/storage/configjson-[0-9a-f]*.json /opt/`/usr/bin/date '+%a'`-configjson.json
otverber
Posts: 78
Joined: 28 Mar 2018 20:17

Re: Can't access z-wave after power cycling

Post by otverber »

Back in business now. Complete reinstall and a not to old backup restore gave me a slow start. Had to reinvent all automations including mqtt subscriber setup. Works great after some days.
Created a new backup.
lanbrown
Posts: 354
Joined: 01 Jun 2021 08:06

Re: Can't access z-wave after power cycling

Post by lanbrown »

Once a month you should do a backup, see if there are updates and if anyone had any issues with them. Sometimes waiting 4 to 6 week before updating to a newer Z-Way version allows others to uncover bugs. If you add a new Z-Wave device, create a backup after you add it. Going to update Z-Way, do a backup, update Z-Way, do another backup.
Post Reply