Needing a hard reset after certain z-way-server crashes

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
cdogg76
Posts: 49
Joined: 28 Sep 2014 23:13

Needing a hard reset after certain z-way-server crashes

Post by cdogg76 »

Hello,

I have an issue that occurs every now and then (could be weeks or months between instances) but is fairly annoying. I have a cron job set up to restart z-way-server every minute, as I found in the past that it will occasionally crash. This usually helps to keep things running.

However, there is something that happens where, for certain crashes, upon restart, the z-wave binding fails and the log fills with lines such as this:

Code: Select all

[2018-03-19 14:51:23.236] [E] [HTTP] Callback execution error: ReferenceError: zway is not defined
    at OpenRemote (automation/modules/OpenRemoteHelpers/index.js:166:24)
    at WebServer.document_root (automation/Webserver.js:35:11)
What I believe may be interesting logs prior to that are these:

Code: Select all

[2018-03-19 10:54:15.043] [D] [zway] Initialization done
[2018-03-19 10:54:15.043] [D] [zway] Job 0x07 (Get controller info and supported
 function classes): success
[2018-03-19 10:54:15.043] [C] [zway] Device is not compatible. Terminating...
[2018-03-19 10:54:15.043] [I] [zway] Removing job: Get controller info and suppo
rted function classes
[2018-03-19 10:54:15.054] [D] [zway] Worker thread exit point
[2018-03-19 10:54:15.054] [D] [zway] Worker thread successfully finished
[2018-03-19 10:54:15.055] [I] [core] Terminating Z-Wave binding
This repeats, it retries:

Code: Select all

[2018-03-19 10:54:15.111] [I] [core] Trying to restart Z-Wave binding (zway) in 10 seconds
I believe when it's in this state, issuing a "shutdown -r now" does NOT resolve the problem. I actually need to shut down, kill power to the Raspberry Pi (and the Razberry, I'm assuming is the key) to fully reset the device.

I suspect (pure speculation) that the problem is that the Razberry needs some sort of reset. I'm wondering if there's any commands that I can issue to the Razberry to avoid having to actually do a hard reset. It'd be much more convenient if I could automate this process.

As of now, I have to put the RPi on a Wemo switched outlet so that it is possible for me to revive things while away from the device, but this requires a lot of manual intervention and the system is down until I actually notice it.

Any thoughts?

Thanks!
enbemokel
Posts: 482
Joined: 08 Aug 2016 17:36

Re: Needing a hard reset after certain z-way-server crashes

Post by enbemokel »

Hi, are you really restarting the z-wave service every minute? Seems very often to me.
Sorry, can´t help you out with your real question, but maybe there are some task not done and you start again to early.
Once a day should be enough, I have to systems that I restart once a month while testing or updating.
cdogg76
Posts: 49
Joined: 28 Sep 2014 23:13

Re: Needing a hard reset after certain z-way-server crashes

Post by cdogg76 »

Hello,

I tested it and the start appears to be a no-op if the service is already running. So, it just attempts to start the service every minute, but if it's already running, it doesn't affect the running service.

My intention isn't to restart the service to clean up memory leaks or anything. It's to quickly restart the service in the case that it crashes, which does happen occasionally. If I only restart once a day, then the service could be down for a number of hours (or until I notice and then manually start it).

That said, it is during some of these service crashes that it's somehow leaving the Razberry in a bad state that the service can't recover from. Hence my question as to whether there's a programmatic way to reset the device instead of having to power cycle.
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Needing a hard reset after certain z-way-server crashes

Post by PoltoS »

This is because the chip is answering some crap. May be because it was left in some undermined step.

You can reset it via and echo command (same as hard reboot).

echo -ne "\x01\x03\x00\x08\xf4" > /dev/ttyAMA0
Post Reply