Cool stuff for Raspberry Pi, Arduino and all electronics hobby projects
Notifications
Clear all

wittyPi4 writing a schedule with multiple BEGIN and END pairs.

3 Posts
1 Users
0 Likes
13 Views
 speo
(@speo)
Posts: 3
Active Member
Topic starter
 

I am successfully using a wittypi with Pi4 in a remote off grid location and I would like to know if it's possible to write a schedule to turn the pi on only during the night.

Since the sunset/sunrise time changes during the year and the on/off times don't need to very accurate, I was wondering if it's possible to make a schedule that does something similar with this:

- In January, run for 14 hrs and stay off 10 hrs. Run from from 5pm to 7 am
- in Feb run for 13 hrs, from 5:30pm to 6:30am
- .......
- in July, run from 10pm to 5 am
...

I tried something like this, but it complains that it cannot find the END time, so probably it doesn't know how to handle multiple START/END in one scheule

BEGIN 2025-12-01 17:00:00
END 2025-12-02 00:00:00
ON H14 # stay ON for 14 hrs
OFF H10 # keep OFF for 12hrs

BEGIN 2024-12-02 17:30:00
END 2024-12-03 00:00:00
ON H13 # stay at ON for 13hrs
OFF H11 # keep OFF for 11hrs

Times are not exact, just to get an idea.

Any help would be appreciated.

Thanks,
speo

 
Posted : 26/12/2024 7:44 am
 speo
(@speo)
Posts: 3
Active Member
Topic starter
 

Oh, I see a bunch of mistakes in my file. 

 
Posted : 26/12/2024 7:57 am
 speo
(@speo)
Posts: 3
Active Member
Topic starter
 

I tried this: 

BEGIN 2024-12-26 02:10:00
END 2024-12-26 02:30:00
ON M4 # stay ON for 14 hrs
OFF M4 # keep OFF for 12hrs

BEGIN 2024-12-26 02:40:00
END 2024-12-27 02:55:00
ON M10 # stay ON for 14 hrs
OFF M10 # keep OFF for 12hrs

And I got this:

Running the script...
--------------- 2024-12-26 02:03:34 ---------------
Schedule next shutdown at: 2024-12-26 02:44:00
Schedule next startup at: 2024-12-26 02:48:00
---------------------------------------------------
Done 🙂

================================================================================
>>> Current temperature: 32.75°C / 90.95°F
>>> Your system time is: 2024-12-26 02:03:32 EST
>>> Your RTC time is: 2024-12-26 02:03:35 EST
>>> Vin=8.89V, Vout=5.13V, Iout=0.49A
Now you can:
1. Write system time to RTC
2. Write RTC time to system
3. Synchronize with network time
4. Schedule next shutdown [26 02:44:00]
5. Schedule next startup [26 02:48:00]

 

So, it skipped the first BEGIN/END

 
Posted : 26/12/2024 8:07 am
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.