more G-Labs products

Author Topic: Zwave interface Port # not saving  (Read 1299 times)

April 05, 2014, 12:55:03 AM
Read 1299 times

James

  • *
  • Information
  • Newbie
  • Posts: 14
Every time I reboot My server I lose the port setting for the Z-stick ( port4 ) in my case, I can set it back up and it will work fine until I have to reboot or lose power.
I don't remember having this issue with the earlier versions so I'm wondering if maybe there is something I'm not setting up correctly?

I would like to be able to auto start after a power failure or a reboot, any1 have any Ideas what I'm missing or doing wrong? 

April 05, 2014, 01:23:54 AM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
You can check if port settings are saved by opening the text file:

/usr/local/bin/homegenie/systemconfig.xml

look nearby the end of the file

Code: [Select]
....
<Interface Domain="HomeAutomation.ZWave" IsEnabled="false">
        <Options>
          <Option Name="Port" Value="/dev/ttyUSB0" />
        </Options>
</Interface>
...

if settings are saved, then probably it means that, by the time hg starts, the serial port is not available yet.
So putting a delay before hg startup might solve the issue.

/usr/local/bin/homegenie/startup.sh
Code: [Select]
#!/bin/sh
sleep 10
if [ -f /usr/bin/mono ]
then
        MONO=/usr/bin/mono
else
        MONO=/usr/local/bin/mono
fi
cd $1 && sudo $MONO HomeGenie.exe >/dev/null  2>&1

the sleep 10 will delay the startup by 10 seconds. You will probably have to tune up this value.

g.