HomeGenie Forum

General Category => Troubleshooting and Support => Topic started by: kevinvinv on January 22, 2016, 04:34:25 AM

Title: WhenModuleParameterIsChanging
Post by: kevinvinv on January 22, 2016, 04:34:25 AM
Quick question,

I thought that code in this function would only be executed when a module parameter changes but it seems to be executed like every second or so... am I crazy?   Is this how it should be?  Thanks!!   :)
Title: Re: WhenModuleParameterIsChanging
Post by: bkenobi on January 22, 2016, 07:32:23 AM
This function runs when ANY module changes.  It is possible there is something changing every second.
Title: Re: WhenModuleParameterIsChanging
Post by: kevinvinv on January 22, 2016, 03:07:37 PM
Hmmm... would I see it in the log?  I don't think I am seeing it there.

For example, the night/day calculation from your ASL code is running every second or so.

I'll dig further.
Title: Re: WhenModuleParameterIsChanging
Post by: bkenobi on January 22, 2016, 06:33:17 PM
Any time a program runs you will see an item in the Mono log.  I don't believe you will see anything in the Web log since it's more of a high level view.
Title: Re: WhenModuleParameterIsChanging
Post by: kevinvinv on January 22, 2016, 07:29:56 PM
Thanks.  And where does one find the mono log then?

Thanks again!
Title: Re: WhenModuleParameterIsChanging
Post by: bkenobi on January 22, 2016, 10:47:59 PM
By default, the mono output is dumped to /dev/null (Linux) or nowhere (Windows).  If you want to see the log, there are a couple approaches.  You can either use nlog to view the log that HG generates, you can launch HG via command line (stop the service, run HG manually from command line, or you can modify the /usr/local/bin/HomeGenie/startup.sh file to redirect the output of the mono command to a file rather than /dev/null.  If you are running Windows, the concept is the same but the commands are a little different.
Title: Re: WhenModuleParameterIsChanging
Post by: kevinvinv on January 23, 2016, 03:27:57 PM
Well, it seems like this 1-second problem has gone away...  happy to see that!   If it comes back,  at least I'll know where to find that log.

Do you keep your mono log file accumulating continuously?  Seems like it could get big but it could also be pretty useful to see from time to time.
Title: Re: WhenModuleParameterIsChanging
Post by: bkenobi on January 24, 2016, 04:43:26 PM
I do but shouldn't.  The log on RPi writes to the SD card by default.  I had configured things such that it would write to a Windows share.  When my SD died months ago, I got everything but that link set back up.  So, it's currently writing to the card all the time.  My recommendation would be to consider using nlog as the same data is apparently written to the  normal log system.  I haven't taken the time to figure that out, but there's no reason to write the same data to the card 2x and shorten the life for no real benefit.
Title: Re: WhenModuleParameterIsChanging
Post by: kevinvinv on January 24, 2016, 04:50:56 PM
Thanks.  I am using an old net book with an HDD but I am interested in the Rpi concept.  I really wish I could get HG to work on a PogoPlug...  to me that is the best and cheapest hardware for this thing  :)

Anyhow... I'll see about figuring out this nlog thing. 

Thanks again.

FYI-  I am slowly writing a beginners guide to HG to address all the issues I've had getting up and running.  Maybe it will help others.
Title: Re: WhenModuleParameterIsChanging
Post by: bkenobi on January 24, 2016, 10:38:45 PM
If you decide to get an RPi, I posted a guide that details the step-by-step commands to get you a working SD image.  I think as many full guides like this users can put together can only benefit future users!