From: David N. <dno...@ya...> - 2006-10-11 02:01:42
|
Would you set the debug ini parameter to "trigger"? I suspect trigger_set is getting run at :05 and :35 for some reason. If this doesn't shed any light, then you should add debug messages to the other subroutines like trigger_write_code. David ----- Original Message ----- From: "Jim Duda" <ji...@du...> To: <mis...@li...> Sent: Tuesday, October 10, 2006 5:54 PM Subject: Re: [mh] What's up with triggers.pl ? > Matt, > > It's more than just adding new triggers. Every 5 minutes after the hour > or half hour, I see the same call to read_code. Look at my logs ... > > I added a debug "entered read_code" statement in bin/mh. The "5" > indicates the call comes from trigger.pl > > This is happening to me all the time. Each time, all my timers are > getting reset. I have dozens of other examples. I can force the issue > immediately by adding a trigger (scheduling a pvr_record from the web TV > interface). They also happen automatically (example below) 5 minutes > after the hour or half hour, but not every single time. > > I haven't been able to figure out why. > > I can understand the reload of code, however, why do we have to call > restore_object_states along the way. > > I have a similar thread which I posted a few days ago with a timer > snipet which helps show the issue. > > 10/10/06 07:05:00 PM Running trigger code for: get AP news > 10/10/06 07:05:00 PM Running: Get AP breaking news > 10/10/06 07:05:00 PM Finished running trigger code for: get AP news > 10/10/06 07:05:00 PM Running trigger code for: get internet conditions > 10/10/06 07:05:00 PM Running: Get the Internet weather conditions > 10/10/06 07:05:00 PM Finished running trigger code for: get internet > conditions > 10/10/06 07:05:00 PM Running trigger code for: read chance of rain > 10/10/06 07:05:00 PM Running: Read the forecasted chance of rain or snow > 10/10/06 07:05:00 PM Finished running trigger code for: read chance of > rain > 10/10/06 07:05:00 PM timer_test: remaining minutes = 0.3 > > ---> CALL TO READ_CODE HERE > > 10/10/06 07:05:00 PM entered read_code: 5 > 10/10/06 07:05:00 PM Re-reading > /home/misterhouse/mh.private.ini,/home/misterhouse/mh.local.private.ini > and mh.ini > Read parameter files: ./mh.ini ./mh.private.ini > /home/misterhouse/mh.private.ini /home/misterhouse/mh.local.private.ini > Voice names: us1_mbrola, us2_mbrola, us3_mbrola > 10/10/06 07:05:00 PM Reading 1 .mht table files: x10_items.mht > Reading code_dirs: /home/misterhouse/code ./../code/common > 10/10/06 07:05:00 PM Re-reading 64 code files > Duplicate file. > - Used: /home/misterhouse/code/audrey_control2.pl > - Skipped: ./../code/common/audrey_control2.pl > > Duplicate file. > - Used: /home/misterhouse/code/audreyspeak.pl > - Skipped: ./../code/common/audreyspeak.pl > > File skipped due to -noload: callerid.pl > File skipped due to -noload: gphoto2.pl > File skipped due to -noload: halloween.pl > File skipped due to -noload: modem.pl > Duplicate file. > - Used: /home/misterhouse/code/proxy_client_server.pl > - Skipped: ./../code/common/proxy_client_server.pl > > File skipped due to -noload: sphinx2_control.pl > Duplicate file. > - Used: /home/misterhouse/code/tv_grid.pl > - Skipped: ./../code/common/tv_grid.pl > > Duplicate file. > - Used: /home/misterhouse/code/tv_info.pl > - Skipped: ./../code/common/tv_info.pl > > File skipped due to -noload: ur17a.pl > File skipped due to -noload: viavoice_control.pl > File skipped due to -noload: weather.pl > Duplicate file. > - Used: /home/misterhouse/code/weather_iB_OWW_client.pl > - Skipped: ./../code/common/weather_iB_OWW_client.pl > > File skipped due to -noload: webcam.pl > 10/10/06 07:05:00 PM 0 files deleted, 1 file changed: triggers.mhp > 10/10/06 07:05:00 PM: Saving object states ... done > 10/10/06 07:05:00 PM Reevaluating user code > 10/10/06 07:05:00 PM office, audrey1 > > 10/10/06 07:05:00 PM bedroom, audrey2 > > 10/10/06 07:05:00 PM My list of Audreys all,office,bedroom > > 10/10/06 07:05:00 PM mp3_playlists called > > Reading /media/music/playlists for m3u files > > Good code saved > running: aplay -q /home/misterhouse/sounds/sound_click1.wav > > ---->>>> THIS CALL IS RESTARTING MY TIMERS > > Restoring object states > Object states restored > Activating voice commands > > Jim > > Matthew Williams wrote: >> Jim Duda wrote: >>> Can anyone explain to me why read_code should be called from >>> triggers.pl? Shouldn't read_code only be called on startup or a "reload >>> code" request? >>> >> >>>From my understanding of triggers, we need to reload the user code >>>because >> the trigger logic has been implemented as a self updating code file in >> the >> user code directory. Whenever a trigger is modified, the code file is >> updated and &read_code is run to ensure that the new code gets integrated >> correctly into the user loop. >> >> I'm not sure why you are seeing a different behaviour than before but it >> may >> have to do with the much increased use of triggers in the common code >> modules. >> >> Which triggers are being modified often enough that this is causing >> issues >> for you? If they are in common code files, then triggers are likely the >> wrong mechanism for "triggering" code and we need to change the code. >> >> Perhaps the right solution is to figure out a way to properly >> save/restore >> timer states during reloads. I have a similar problem with bathroom fans >> that don't get switched off if I'm playing with the server (i.e. >> reloading/restarting mh). >> >> For those that aren't aware, a trigger is really just a managed way of >> writing code snippets that look like this: >> >> if ((something happens) and (I still care)) { >> do something; >> } >> >> The nice thing is that you can delete and modify triggers easily by just >> referencing their names. The bad thing is that this implies a >> modification >> to a user code file and requires a reload. >> >> Matt >> __________________________________________________ >> Do You Yahoo!? >> Tired of spam? Yahoo! Mail has the best spam protection around >> http://mail.yahoo.com >> >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share >> your >> opinions on IT & business topics through brief surveys -- and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> ________________________________________________________ >> To unsubscribe from this list, go to: >> http://sourceforge.net/mail/?group_id=1365 >> >> > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ________________________________________________________ > To unsubscribe from this list, go to: > http://sourceforge.net/mail/?group_id=1365 > |