Server in an endless Start/Stop loop.

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
jstaffon
Posts: 80
Joined: 29 May 2015 04:47

Server in an endless Start/Stop loop.

Post by jstaffon »

I'm running Wheezy on my Raspberry-Pi and the v2.2.2 of the Z-Way server. There have been a number of posts about an endless Starting Server/Stopping Server loop message following a reboot after an upgrade to v2.2.2. The endless looping is actually coming from a script in /etc/init.d called "readKey". The description from the script is below:

Description: Read key on RaZberry plate. 0.5 sec press = activate webif, 5 sec press = factory reset

In looking at /etc/init.d, I see three scripts that are associated with Z-Way. readKey, z-way-server, and zbw_connect. I'm also noticing the sequence in /etc/rc#.d for the startup of z-way-server and mongoose (the webserver the UIs use). It looks like z-way-server is starting before mongoose. I have two questions:

1. Can anyone tell me the sequence in which the readKey, z-way-server, zbw_connect and mongoose should start or does it make any difference?
2. What is a more detailed description for "readKey" which apparently isn't completing properly?

I still have a broken system and am currently focusing on the startup scripts. Any help would be much appreciated.
jstaffon
Posts: 80
Joined: 29 May 2015 04:47

Re: Server in an endless Start/Stop loop.

Post by jstaffon »

UPDATE: I seem to be getting closer to a functional system. In order for the z-way-server script to start and allow me to add devices, I have to first "kill" the "readKey" autostart script that runs on startup and reboots. That script is hanging and stopping and restarting the server. After I kill/stop that script, the endless looping stops and I can manually run the /etc/init.d/z-way-server script to start the server with the sudo command.

I would like to understand what is failing in the readKey script so I can have this server automatically startup.

Thanks in advance!
jstaffon
Posts: 80
Joined: 29 May 2015 04:47

Re: Server in an endless Start/Stop loop.

Post by jstaffon »

UPDATE: My looping problem with starting and stopping the z-way-server is a result of a script called "readKey" that gets automatically started on startup or reboot. For some reason, a variable in the script continues to increment until it calls a few routines that resets the z-way-server folder back to factory. It's actually labeled "Factory Reset" in the script. I removed that script from the autostart folder (/etc/init.d) and the z-way-server starts normally. Everything seems to work but that script must have some function. I've posted a couple posts in different areas to find out the purpose and normal, intended operations but no one has replied yet. Contact me if you want more details. Thanks.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Server in an endless Start/Stop loop.

Post by pz1 »

FYI
Zway Issue #105 has been raised on the developers github.
jstaffon
Posts: 80
Joined: 29 May 2015 04:47

Re: Server in an endless Start/Stop loop.

Post by jstaffon »

Thanks pz1.... What I found is that Issue 105 may be somewhat misleading. The "readKey" script first performs an "echo 4 > /sys/class/gpio/unexport" command on line 16 of my script. The error message is normal because Pin 4 hasn't been exported yet..I believe. The next command is the export command (echo 4 > /sys/class/gpio/export) which is successful. The problem is that the "value" (/sys/class/gpio/gpio4/value) for that pin after it's been exported never changes to a non-zero value. That causes a Factory Reset about every 5 seconds. I've been trying to find out what in the RPi or Razberry board is suppose to change that value to nonzero.
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Server in an endless Start/Stop loop.

Post by PoltoS »

Please remove the /etc/init.d/readKey script until we fix it
Post Reply