HomeGenie Forum

Development => Bug reporting => Topic started by: Etienne on February 06, 2014, 07:02:32 PM

Title: Issues on Pi
Post by: Etienne on February 06, 2014, 07:02:32 PM
Hi ... in the last 4/5 days I've had to restart the homegenie service twice - this never happened in the months before. I would attribute these (due to the timeline) to the latest update (version 1.00 beta r327) as it's only after this update they this happened.

Basically - hg stops responding ... the browser never returns a page till eventually it gives up. First time this happened I restarted the Pi, 2nd time I restarted the hg service - in both cases all was back to normal.

Is there any log I can provide to help you identify if anything's wrong?
Title: Re: Issues on Pi
Post by: Gene on February 06, 2014, 07:09:48 PM
Did you notice if it starts hanging after using the Android client?
I had this issue too a couple of times. Are you using latest hgvSD card image or from a manual installation?
Title: Re: Issues on Pi
Post by: Etienne on February 06, 2014, 08:28:29 PM
Hmn .... yes actually - both cases happened after I switched to using app rather than web-interface.

As for version - I had made a clean install using HomeGenie_1_00_beta_r324_raspi-armhf-4GB - and then updated via interface.
Title: Re: Issues on Pi
Post by: jjuel15 on February 07, 2014, 08:03:27 AM
I am having the same problem, and it could as well be after using the Android app (I'll test that tomorrow).

As I see it, its only the web interface that stops working, i have some C# code writing to a log, and it continues to run after the web interface has stopped.

I saw this problem first in  r326 and on 6.2.2014 I installed r327, and had the problem shortly after.
Title: Re: Issues on Pi
Post by: Etienne on February 08, 2014, 05:39:16 PM
I can temporarily create a cron job to restart hg once a day ... but I would like it to keep the state of modules as it was before restart ... is this possible?
Title: Re: Issues on Pi
Post by: jjuel15 on February 08, 2014, 05:58:52 PM
I've done a little testing. I dont think this is coursed (directly) by the Android app. I have changed the Ip of the app to be sure i doesnt run i background. After restart of the Homegenie service the web interface functions for some time (less than an hour), within max 1½ hour it stopped responding, or actually the web in it self functions but it dont interact with the background.
Restarting service makes everything work again, but for less than 1½ hour.

Hope this will help debuging.

Configuration: Running on SD card image distributed with r327, downloaded 5-2-2014, only change is adding ftp-service (vftp).
Title: Re: Issues on Pi
Post by: Etienne on February 08, 2014, 06:02:59 PM
Mine is not that bad ... it lasts even 2 days w/o problems.

I'm not sure what's causing it ... i know it started with the latest update & after I started using the android app - but these could simply be coincidences! Before that I was using HG for months w/o ever restarting it or the rpi!
Title: Re: Issues on Pi
Post by: Gene on February 08, 2014, 06:24:20 PM
Hi guys,

I'm releasing an update for you to test in a couple of hours or so.

   - MIG: new WebServiceGateway with support for HTTPS (ssl)
   - NetHelper: added support for ssl and custom port number to MailService
   - XTenLib: added transceived house codes settings for CM15 interface
   - added fibaro rgbw app and widget (contributed by DaniMail)

it will be a tgz for manual upgrade.
Title: Re: Issues on Pi
Post by: Gene on February 08, 2014, 06:25:43 PM
What configuration are you running?

g.

I've done a little testing. I dont think this is coursed (directly) by the Android app. I have changed the Ip of the app to be sure i doesnt run i background. After restart of the Homegenie service the web interface functions for some time (less than an hour), within max 1½ hour it stopped responding, or actually the web in it self functions but it dont interact with the background.
Restarting service makes everything work again, but for less than 1½ hour.

Hope this will help debuging.
Title: Re: Issues on Pi
Post by: Gene on February 08, 2014, 10:26:45 PM
I'm attacching a partial update, though it's not completed yet.
Ssl it's not working on Raspberry Pi and I'm trying to find out the reason.

In the meanwhile, would be of great help if you can test it to see if the web hang issue is fixed.


 
Title: Re: Issues on Pi
Post by: jjuel15 on February 09, 2014, 08:43:52 AM
What configuration are you running?

g.

I've done a little testing. I dont think this is coursed (directly) by the Android app. I have changed the Ip of the app to be sure i doesnt run i background. After restart of the Homegenie service the web interface functions for some time (less than an hour), within max 1½ hour it stopped responding, or actually the web in it self functions but it dont interact with the background.
Restarting service makes everything work again, but for less than 1½ hour.

Hope this will help debuging.

Configuration: Running on SD card image distributed with r327, downloaded 5-2-2014, only change is adding ftp-service (vftp).
Title: Re: Issues on Pi
Post by: Etienne on February 09, 2014, 10:14:01 AM
I'm attacching a partial update, though it's not completed yet.
Ssl it's not working on Raspberry Pi and I'm trying to find out the reason.

In the meanwhile, would be of great help if you can test it to see if the web hang issue is fixed.

I'm assuming I just replace files on raspberry?
Title: Re: Issues on Pi
Post by: Gene on February 09, 2014, 03:28:27 PM
I decided to give up for now on this issue, since I am not able to reproduce it (it just happened once to me) and since most of users are running hg smoothly.
I also switched back the old webservice code in current development trunk. So this patch won't be available in the next release.
Btw HG source code is available to everyone, so I'm expecting that some other user able to reproduce this issue and able to dig in the source code might give us the solution =)



Title: Re: Issues on Pi
Post by: Etienne on February 09, 2014, 03:51:39 PM
I decided to give up for now on this issue, since I am not able to reproduce it (it just happened once to me) and since most of users are running hg smoothly.
I also switched back the old webservice code in current development trunk. So this patch won't be available in the next release.
Btw HG source code is available to everyone, so I'm expecting that some other user able to reproduce this issue and able to dig in the source code might give us the solution =)

Is there a way to restart hg and keep module status?
Title: Re: Issues on Pi
Post by: Gene on February 09, 2014, 04:12:59 PM
Well!!! this is really weird... I just opened the android client and the web interface hung!! =)

This is a "good" news since I could find out the possible reason for it and just applied a fix.
All http request were processed synchronously (using HttpListener.GetContext())! This was old code in MIG.WebServiceGateway.
I update it to process request asynchronously by using BeginGetContext instead.
Beside a slightly performance improvement, I am confident that the bug was caused by too close concurrent calls to the GetContext.
I will be stress testing hg web server with lot of concurrent calls and see what happen.
Anyway this fix will be present in next release.

Etienne: should be possible restart HG and keep modules status by sending a -SIGINT signal. That way HG will save status and quit gently.
Title: Re: Issues on Pi
Post by: bkenobi on February 09, 2014, 04:51:42 PM
Perhaps that is the reason HG was throwing a bunch of errors to the console when I switch a large quantity of house codes without waiting for the "wait" spinner to stop?
Title: Re: Issues on Pi
Post by: Etienne on February 09, 2014, 05:47:43 PM
Great re. finding the bug :) ... will wait for next release then!

Etienne: should be possible restart HG and keep modules status by sending a -SIGINT signal. That way HG will save status and quit gently.

I'm not quite sure about how to do this? I normally restart HG by running sudo /etc/init.d/homegenie restart ... so what should I do before this command?
Title: Re: Issues on Pi
Post by: beller on February 09, 2014, 06:18:12 PM


i had similar problems in past, that i have also today: http://sourceforge.net/p/homegenie/discussion/csharpscripting/thread/abadc8d6/

how i can schedule a reset of the board at a specific time (or more then  one) during the day ?

gene say to send SIGINT to mantain the status of HG... how ?

thanks

beller
Title: Re: Issues on Pi
Post by: Etienne on February 09, 2014, 06:26:39 PM
how i can schedule a reset of the board at a specific time (or more then  one) during the day ?

You need to read about crontab ... you'll find lots of info on many sites.

gene say to send SIGINT to mantain the status of HG... how ?

That I don't know ... yet ;)
Title: Re: Issues on Pi
Post by: Gene on February 09, 2014, 06:35:57 PM
Assuming that HG is the only mono application running in the system:

Code: [Select]

sudo killall -s SIGINT mono


if you update this in the /etc/init.d/homegenie script, then you can call

Code: [Select]

sudo /etc/init.d/homegenie stop


I am updating this in the homegenie script too, so that will terminate gently.


Title: Re: Issues on Pi
Post by: Gene on February 11, 2014, 12:08:56 PM
Please update to r329 and let me know if the issue is fixed. I am confident that it is.

Cheers,
g.
Title: Re: Issues on Pi
Post by: Etienne on February 13, 2014, 08:48:17 AM
Please update to r329 and let me know if the issue is fixed. I am confident that it is.

Cheers,
g.

So ... been on 329 since launch... no issues till now. So as you say seems fixed! :)

Will let you know should it come back!
Title: Re: Issues on Pi
Post by: Gene on February 13, 2014, 12:42:24 PM
I'm sorry to say... that the bug is still haunting r329  :-
So I revised the WebServiceGateway again and found a stackoverflow post that gave the right hint for fixing.
Well off course I won't be saying it's fixed unless I do see HG running on raspi for a couple of months flawlessly  :)

Cheers,
g.
Title: Re: Issues on Pi
Post by: Etienne on February 13, 2014, 12:44:17 PM
so this fix will be present on next official update?
Title: Re: Issues on Pi
Post by: Gene on February 13, 2014, 01:00:30 PM
Yes, I'm testing it since yesterday. I'll let it run for a week before considering it fixed.
If some of you want to help beta-testing this I'll attach the MIG.dll here.

Cheers,
g.
Title: Re: Issues on Pi
Post by: Etienne on February 13, 2014, 01:01:34 PM
yeah sure ... no problem for me ...

do i just replace dll on pi and restart?
Title: Re: Issues on Pi
Post by: Gene on February 13, 2014, 01:07:37 PM
Stop hg, replace MIG.dll and restart.
Here it is.

Cheers,
g.

Title: Re: Issues on Pi
Post by: lancebooth on February 13, 2014, 05:03:56 PM
I am going to test the fix. Currently, I am having to stop and restart the HomeGenie service a couple of times a day.

My configuration is r329 on a Raspberry Pi with an Aeon USB Z-Wave controller.

I'll let you know how the fix is working for me. The HomeGenie service only seems to hang when controlling devices. I am also running r329 as windows service in a development environment, without an Aeon controller, and it has never crashed.

Lance
Title: Re: Issues on Pi
Post by: lancebooth on February 14, 2014, 03:50:40 PM
I had to stop and restart the HG service this morning to get it to respond. It was not completely hung up, just really, really sluggish and not responding to every command.

L
Title: Re: Issues on Pi
Post by: Gene on February 14, 2014, 06:02:11 PM
This is a different behavior from the one covered here.
Just a question: are you using z-wave polling?
The problem may be connected to it. If so try disabling and using nodes reporting facility in place of it.

Cheers,
g.
Title: Re: Issues on Pi
Post by: Etienne on February 15, 2014, 11:07:51 AM
Stop hg, replace MIG.dll and restart.
Here it is.

Cheers,
g.

.... got the failure again just now! I replaced the MIG.dll file when you posted it (13th) and worked fine right up till a few mins ago. Tried to connect from android app or browser - nothing.

:(
Title: Re: Issues on Pi
Post by: Etienne on February 22, 2014, 09:28:08 AM
Assuming that HG is the only mono application running in the system:

Code: [Select]

sudo killall -s SIGINT mono


if you update this in the /etc/init.d/homegenie script, then you can call

Code: [Select]

sudo /etc/init.d/homegenie stop


I am updating this in the homegenie script too, so that will terminate gently.

Hi ... was this feature (keeping status of stuff on restart) implemented in the latest version? Or should I modify the homegenie script?
Title: Re: Issues on Pi
Post by: Gene on February 22, 2014, 02:34:52 PM
Hi,

no it was not that. The status of the modules is reset at startup by HG itself as shown in the code:

http://sourceforge.net/p/homegenie/code/HEAD/tree/trunk/HomeGenie/Service/HomeGenieService.cs#l1827

That was done to prevent scripts to fire up at startup from previously stored parameter values that in most cases is not a wanted behavior.
I will be adding a flag in the maintenance menu, so the user can select the wanted behavior.

Cheers,
g.
Title: Re: Issues on Pi
Post by: RichieC on March 14, 2014, 12:50:05 AM
I have Homegenie running on a raspberry (v345) and everything appears to work well, except after a leaving the PI running for a hour or so without using it, it locks up. When this happens i am unable to connect to it over the network via the web interface and the android app is no longer able to connect to the PI .. although i can still ping it's IP address and get a response.

I have an X10 interface (CM15) and a Z-wave usb adapter connected, if that makes any difference...

Any idea what could be causing this?

Rich
Title: Re: Issues on Pi
Post by: RichieC on March 16, 2014, 12:47:05 AM
I have noticed something else that might explain the hanging of hg ..

Since i have upgraded from 345 to 350, the android client no longer works, but the web interface is fine. It does not appear to lock up anymore so im wondering if it was the Android client that was causing the server to hang?
Title: Re: Issues on Pi
Post by: Gene on March 17, 2014, 02:15:38 PM
In r351 I've been trying to figure out what the problem could possibly be and made some optimization.
Let me know if this release is working any better.

g.
Title: Re: Issues on Pi
Post by: RichieC on March 17, 2014, 09:30:39 PM
I have upgraded to 351 and the updated version of the android app. Everything now appears to be working well, so it looks like you might have solved the issue..

I'll keep an eye on the web service to see if it stops working again, but it's looking good so far! :-)

Thanks gene
Title: Re: Issues on Pi
Post by: RichieC on March 18, 2014, 02:15:21 PM
Well..  r351 is much better, but it still hasn't completely solved the issue ...

With 350 my web service would stop working after about an hour or so. Now with 351 it appears to say up much longer (several hours at least), but when i attempted to connect to the web service this morning (after it being inactive overnight) it had stopped again. I can ssh into the raspberry pi and restart the service, so it is only the web service that is affected.
Title: Re: Issues on Pi
Post by: miket on March 18, 2014, 10:57:00 PM
Are you able to check the log file?  I wonder if this is related to the sgen-os-posix.c issue

Title: Re: Issues on Pi
Post by: RichieC on March 19, 2014, 03:29:29 AM
Where is the log file located?

After a bit more use of r351, i've notied that the web service does still stop responding after a while, although it's usually more like 3 or 4 hours rather than 1 or 1.5 hours with r350, but it is a little different. When r351 fails the android client will no longer connect, but the web interface does sometimes still respond, but pages are incomplete, e.g. you can get to the main menu, but the "Control" page appears but has no controls on it!
Title: Re: Issues on Pi
Post by: bkenobi on March 19, 2014, 05:14:41 AM
Are you sure that's not just the browser caching content?  I found that mine would do that sometimes when I was switching between a different HA software and HG.  It would load the wrong page unless I hit refresh after the wrong page loaded.  I believe there is a setting in Firefox that can override this, but I haven't tested to verify it actually keeps this from happening.
Title: Re: Issues on Pi
Post by: RichieC on March 19, 2014, 03:05:00 PM
It's not the browser caching the pages..

It's just happened again - failed after about 2 hours. I can still get to the web interface and this time the control page loads and has all of the controls on it, but nothing works!

The android client is unable to connect to the server.

Restarting homegenie service from ssh gets everything working again. Seems to last about 2 hours now before it fails again.
Title: Re: Issues on Pi
Post by: RichieC on March 19, 2014, 05:10:40 PM
Another 2 hours (almost exactly).. and it's down again.

This time web service is still running and i can get to the main menu but the control option is greyed out. The android client wont connect at all. I can get to the configure/ groups and modules screen, but no modules displayed.

Restarted the server and everything back to normal again...

It looks as though there is some kind of issue with the web service but it doesn't always cause it to stop completely..
Title: Re: Issues on Pi
Post by: Gene on March 19, 2014, 07:06:23 PM
What is the reported revision number in the about popup?

g.
Title: Re: Issues on Pi
Post by: RichieC on March 20, 2014, 02:55:11 PM
Gene,

The version reported in the about popup is 1.00 Beta r351
Title: Re: Issues on Pi
Post by: RichieC on March 26, 2014, 05:01:11 PM
I believe that I may have solved this issue!

I was using a 5v 1A PSU to power the raspberry Pi and a friend of mine suggested that it might not be quite enough power to run the Pi with the Z-Stick and X10 adapters connected, so I have replaced it with a 5v 2A USB PSU and it hasn't locked up since!

Homegenie r351 has now been running for 24 hours and hasn't hung or stopped responding once ..

Rich
Title: Re: Issues on Pi
Post by: Gene on March 29, 2014, 05:55:26 PM
Hi,

today I experienced the problem again after unplugging the 5V power supply from the USB switch.
But also found out that unplugging and replugging the z-wave controller after 10 seconds, the web interface started suddenly to work again.
So I am assuming that there's something in the z-wave driver that cause this (or at least that can be optimized to detect this kind of failure).
Can any of you confirm that?

Cheers,
g.
Title: Re: Issues on Pi
Post by: Gene on March 29, 2014, 06:32:48 PM
well... well... after that hg was kind of lagged. So I ain't convinced anymore that has any connection with the usb switch, since after stopping and restarting hg everything started to work again.

Title: Re: Issues on Pi
Post by: Etienne on August 02, 2014, 06:42:50 PM
Hi,

no it was not that. The status of the modules is reset at startup by HG itself as shown in the code:

[url]http://sourceforge.net/p/homegenie/code/HEAD/tree/trunk/HomeGenie/Service/HomeGenieService.cs#l1827[/url] ([url]http://sourceforge.net/p/homegenie/code/HEAD/tree/trunk/HomeGenie/Service/HomeGenieService.cs#l1827[/url])

That was done to prevent scripts to fire up at startup from previously stored parameter values that in most cases is not a wanted behavior.
I will be adding a flag in the maintenance menu, so the user can select the wanted behavior.

Cheers,
g.


Hello again ... wanted to ask again - was this ever implemented? I.E. keeping last x10 status between restart? I really would appreciate this as a optional config or something?

Also - I'm in the process of migrating from the Pi to a debian wheezy server (which i currently use for other purposes) ... carried out the install (gdebi) ... but HG is not saving all the module info - for example I add an X10 module, give it a name and set it to a 'light' - i then go out of modules and back in and the info is all lost - it still knows it's X10 A1 but won't work as when I go to control it say that config is incomplete. I've also just noticed that a lot of options under configure/automation are missing!? Confused!
Title: Re: Issues on Pi
Post by: Gene on August 03, 2014, 12:12:31 PM
Hi Etienne,

what mono version are you running?

Code: [Select]
mono --version

g.
Title: Re: Issues on Pi
Post by: Etienne on August 03, 2014, 12:20:52 PM
hmn .... on the rPi it's v3.2.8 ... on my debian box it's  v2.10.8.1 .... i guess i should update that?

edit - mono was installed automatically when i installed hg with gdebi .... which packages should i update?
Title: Re: Issues on Pi
Post by: Gene on August 03, 2014, 04:37:16 PM
- remove automatically installed mono packages (optional)
- install mono 3.x from a backport or ppa

I suggest trying this:

http://stackoverflow.com/questions/13365158/installing-mono-3-x-3-0-x-and-or-3-2-x (http://stackoverflow.com/questions/13365158/installing-mono-3-x-3-0-x-and-or-3-2-x)

g.
Title: Re: Issues on Pi
Post by: Etienne on August 03, 2014, 07:33:21 PM
- remove automatically installed mono packages (optional)
- install mono 3.x from a backport or ppa

I suggest trying this:

[url]http://stackoverflow.com/questions/13365158/installing-mono-3-x-3-0-x-and-or-3-2-x[/url] ([url]http://stackoverflow.com/questions/13365158/installing-mono-3-x-3-0-x-and-or-3-2-x[/url])

g.


I'll give that a go later on ... and will update.

In the meanwhile (& sorry for asking again) is there a way (even if I write my own script) to keep x10 statuses between HG restarts ... i had tried that think you mentioned about killing mono & then starting HG ... but no luck!
Title: Re: Issues on Pi
Post by: Gene on August 04, 2014, 04:18:30 PM
Hi Eitienne,

to make HG keep modules' status, use the restart option from the maintenance section. It will make HG do a snapshot of current configuration before restarting.
Still seems to be a bug when using /etc/init.d/homegenie restart/stop that is preventing current configuration from being saved.

g.
Title: Re: Issues on Pi
Post by: Etienne on August 04, 2014, 07:50:40 PM
Thank you for your reply ... but unfortunately that's no use for me as I need to restart using cron!

Hi Eitienne,

to make HG keep modules' status, use the restart option from the maintenance section. It will make HG do a snapshot of current configuration before restarting.
Still seems to be a bug when using /etc/init.d/homegenie restart/stop that is preventing current configuration from being saved.

g.
Title: Re: Issues on Pi
Post by: bkenobi on August 04, 2014, 08:42:18 PM
So restarting using "sudo service homegenie restart" (restarts HG not Raspi) will not keep the status?  We should use the restart option from maintenance?  Got it, I'll keep that in mind.
Title: Re: Issues on Pi
Post by: Etienne on August 07, 2014, 03:15:12 PM
- remove automatically installed mono packages (optional)
- install mono 3.x from a backport or ppa

I suggest trying this:

[url]http://stackoverflow.com/questions/13365158/installing-mono-3-x-3-0-x-and-or-3-2-x[/url] ([url]http://stackoverflow.com/questions/13365158/installing-mono-3-x-3-0-x-and-or-3-2-x[/url])

g.


Hi Gene,

I installed mono 3.2.8 ...

Code: [Select]
Mono JIT compiler version 3.2.8 (tarball Tue Aug  5 17:12:41 CEST 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. [url=http://www.mono-project.com]www.mono-project.com[/url]
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

... but i still have problems - basically HG seems to not be installed properly even thou' I reinstalled from scratch using gdebi homegenie-beta_1.00.r403_all.deb

Some things seem to be missing - for example under Configure/Automation/Energy-Management there are no options ... when i add a new module i don't get all the usual options, and once I save the config is lost!

Have a look at the screenshots & let me know if you need any more info.

Help appreciated!
Title: Re: Issues on Pi
Post by: Etienne on August 11, 2014, 02:09:49 PM
bump ??  ;D
Title: Re: Issues on Pi
Post by: Gene on August 11, 2014, 03:30:38 PM
Your X10 hardware seems not to be detected.
Btw did you try with r408?

Cheers,
g.
Title: Re: Issues on Pi
Post by: Etienne on August 11, 2014, 05:21:11 PM
I'm on r403 ... is there an r408?

So - originally I had the cm15pro connected (thou' only after HG was already installed) ... but they i realized I had mono 2.x installed .... so as not to compromise by debian build I started playing around with a VM - which is were those screenshots come from. I installed compile mono 3 on that but no x10 hardware was actually connected - I just 'told' HG I had a cm15pro connected!

The thing is I got the same exact symptoms I had on the actual machine with mono 2 - which is strange.

So - does the cm15pro have to be connected before installing HG?

Can you post the correct procedure to install on debian, assuming mono 3.x is already installed? Pre-requisites .... and stuff like that?

Also - i'm considering moving to Z-Wave .... is HG more/same/less stable when compared to x10 on HG?

Title: Re: Issues on Pi
Post by: celloweb on August 16, 2014, 05:22:18 AM
Using the last HG, still freezing after a couple of hours.
Title: Re: Issues on Pi
Post by: celloweb on August 18, 2014, 05:16:05 AM
Last version on Pi stucked after some time. All ok after a reboot, but it's very annoying procedure.
Title: Re: Issues on Pi
Post by: dani on October 21, 2014, 10:16:01 AM
Hi Celloweb,

I got same issue before, but since Gene told me to invalidate UPnP, my RP doesn't freeze anymore, and these until 4 weeks.
Actually I don't need UPnp functionality.
Thank's Gene

Cheers
Dani
Title: Re: Issues on Pi
Post by: Bitcraze on August 30, 2016, 09:21:09 AM
Hi, Marnic

I am wanting to do what you managed to get wrong:

"only individuals color dimmers (on/off and level for each single color)"

I would like to use the Fibaro RGBW to dim LED's in four different rooms, so I would need 4 seperate. How would I accomplish this?