Page 1 of 1

readKey cleans out my installation

Posted: 13 May 2016 19:23
by jstaffon
I'm running Wheezy on my Raspberry Pi along with Z-Way v2.2.2. On startup or reboot, a script in /etc/init.d called readKey is hanging and looping through a server start and server stop. Therefore, I don't get my z-way-server script to startup. If I kill the readKey process, I can manually start the z-way-server script and begin to add devices and use the system. If I reboot, the readKey process cleans out the /opt/z-way-server directories (particularly the automation/userModules directory) where I manually add javascripts.

Can someone explain what "readKey" does and why it's cleaning out my directories? Thanks in advance!

Re: readKey cleans out my installation

Posted: 16 May 2016 00:25
by jstaffon
UPDATE: I've traced the readKey problem/culprit to the GPIO Pin 4 value/variable. Pin 4 seems to be the GPCLK0. The script looks for this value to change from "0" to another value...I'm assuming "1". I modified the readKey script so while looping through I print the value out to the console, the value never changes to a nonzero value. What is suppose to make it change? As long as it stays "0", it will perform a Factory Reset and remove everything from the .../automation/storage and .../automation/userModules directories/folders...amongst other things. Can anyone help? What is suppose to make it change to a nonzero value? ... or is the script wrong? I've even tried emailing the creator of the script....no response as of yet.

Re: readKey cleans out my installation

Posted: 18 May 2016 16:20
by Moto
from /etc/init.d/readKey:

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

Re: readKey cleans out my installation

Posted: 20 May 2016 06:49
by jstaffon
Sorry my friend....that doesn't help much. I've seen the description in the script but I don't understand how the script works or what it's suppose to do. It appears as if GPIO pin 4 gets exported and then the value for /sys/class/gpio/gpio4/value is tested but never changes so it eventually performs a factory reset. I'm looking for someone to help me understand what this script was designed to do and what action changes the "value" variable to kick it out of the "if" check. Thanks.

Re: readKey cleans out my installation

Posted: 22 May 2016 02:54
by PoltoS
Please disable this script (or delete it). We have found that on some boxes it results in infinite loop of start-stop