more G-Labs products

Author Topic: WhenModuleParameterIsChanging  (Read 1519 times)

January 22, 2016, 04:34:25 AM
Read 1519 times

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
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!!   :)

January 22, 2016, 07:32:23 AM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
This function runs when ANY module changes.  It is possible there is something changing every second.

January 22, 2016, 03:07:37 PM
Reply #2

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
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.

January 22, 2016, 06:33:17 PM
Reply #3

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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.

January 22, 2016, 07:29:56 PM
Reply #4

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Thanks.  And where does one find the mono log then?

Thanks again!

January 22, 2016, 10:47:59 PM
Reply #5

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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.

January 23, 2016, 03:27:57 PM
Reply #6

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
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.

January 24, 2016, 04:43:26 PM
Reply #7

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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.

January 24, 2016, 04:50:56 PM
Reply #8

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
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.

January 24, 2016, 10:38:45 PM
Reply #9

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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!