Jump to content


Photo

Sun Interval Timer Running Strangely


  • Please log in to reply
1 reply to this topic

#1 rtveg

rtveg

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 03 December 2014 - 02:07 PM

I've got a Raspberry Pi based system and I'm creating a sun interval timer.  I've run the TimerSunInterval script and when I go to the device explorer page, I see the device.  I can see the output turn on and off, but the times aren't correct.

 

Here is the command line version for how I'm building the timer (I've changed the longitude and latitude to 0 for privacy reasons):

 

run_script("Scripts/Device/Virtual/TimerSunInterval", days:"", id:"sun_timer", intervals:"5:00 to sunrise + 10*60, sunset + 10*60 to 23:00", latitude:0, longitude:0, weekdays:"")

 

Why isn't the timer working properly?


  • DarrenWado, Ekbergtum, Daniellon and 14 others like this

#2 Felix

Felix

    Member

  • Members
  • PipPip
  • 19 posts

Posted 03 December 2014 - 07:47 PM

Since you are using a Sun Interval Timer, your times can be a function of either absolute time, or sunrise and sunset.  Looking at your script, you are using all three.  If just your sunrise and sunset times are wrong, most likely your longitude and latitude values are not set properly for your location.  If all your times are wrong, then your Pi's clock may be off.

 

Raspberry Pis don't have a hardware clock, so every time they power on, they need to get the time from the internet.  If your Pi is not connected to the internet, it will take a guess at the time (which is commonly the last real time it knew).  If your Pi is not connected to the internet, it will likely have a time which is way off.  This would cause all your times to be off.  To see if the your Pi's time is correct, from a command prompt, type "date".  If the date is incorrect, make sure your Pi is connected to the internet.

 

If your Pi is connected to the internet and your timer on and off times are still wrong, it's possible that your Pi has the wrong timezone.  The raspi-config program (type "sudo raspi-config" from the prompt) has a pick for changing the timezone in the "Internationalisation Options" section.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users