From: Brent D. <br...@de...> - 2000-12-12 00:26:18
|
I just had a problem with sleep being ignored as well. I ended up using the select() call, like: select(undef,undef,undef,0.50); Note that you can have less than one second resolution with this call, hence the 0.50 for 1/2 second. I even had this problem when I called a shell script that had a sleep 1 in it using "run script.sh", still no pause. Brent > -----Original Message----- > From: mis...@li... > [mailto:mis...@li...]On Behalf Of Matt > Cleland > Sent: Monday, December 11, 2000 4:54 PM > To: mis...@li... > Subject: [misterhouse-users] iButton_ws_client questions > > > > I just started using the *most excellent* Henriksen weather > server with my > Dallas 1-Wire Weather Station, and have been trying to use the > iButton_ws_client.pl module that comes with mh. The problem I'm > having is > that the event that connects to the WServer daemon is written as: > > if (time_cron '02 8,10,12,14,16,18,20 * * *') > { > run_voice_cmd 'Start the ibutton weather station client'; > run_voice_cmd 'Stop the ibutton weather station client'; > run_voice_cmd 'Speak the ibutton weather station client'; > } > > Which should be fine, except on my machine it runs this sequence > too fast, > and disconnects from the WServer before it can get valid data. WServer > appears to spew data about once per second, and sometimes takes 1 or 2 > passes to generate valid data that mh can understand. I think I > need to do > the following: > > if (time_cron '02 8,10,12,14,16,18,20 * * *') > { > run_voice_cmd 'Start the ibutton weather station client'; > sleep(5); > run_voice_cmd 'Stop the ibutton weather station client'; > run_voice_cmd 'Speak the ibutton weather station client'; > } > > > However, when I try this, it appears that mh is ignoring the sleep > call. The Start,Stop,Speak sequence happens without the 5 second delay, > and I get no data from WServer. > > What is the preferred way to execute a statement and then wait for a few > seconds? Or is there something else I should do. > > > > Matt Cleland cl...@bi... > > ________________________________________________________ > To unsubscribe from this list, go to: > http://sourceforge.net/mail/?group_id=1365 > |