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

[Solved / Archived] Witty Pi 4: My script to sartup at 2015pm/ shutdown 0615am

10 Posts
2 Users
0 Likes
822 Views
(@graeme61)
Posts: 0
New Member Customer
Topic starter
 

The problem is when it shuts down the RPI4B at 0615am, it boots up again till 2014pm then shuts down then at 2015pm boots up the RPI4b.

I know it is my script that is wrong ,but not sure what it is.

I used the online witty-scriptgen to generate my script.

I have tried the other scripts included with WittyPi4 and they work as expected.

One thing i noticed is the included scripts in WittyPi4 are all daytime scripts except one which has a script to start up at the same time every day.

I am wondering if WittyPi4 gets confused with the times for overnight bootup of RPI4B ??

Hope someone can supply a solution ??

 

I have attached a screencapture of the script i was using .

Thank you in advance

 

 

 
Posted : 03/09/2023 11:10 am
(@admin)
Posts: 479
Member Admin
 

Maybe you encountered the firmware bug mentioned in this thread.

If you provide the content wittyPi.log file, we should be able to confirm that.

 
Posted : 03/09/2023 2:08 pm
(@graeme61)
Posts: 0
New Member Customer
Topic starter
 

Please enclosed the required wittyPI.log

 
Posted : 03/09/2023 3:11 pm
(@graeme61)
Posts: 0
New Member Customer
Topic starter
 

Converted to txt as .log was not accepted ,sorry about that

Please find eclosed file required

 
Posted : 03/09/2023 3:13 pm
(@admin)
Posts: 479
Member Admin
 

From the log I can see your Witty Pi 4 has firmware revision 0x03, which does have that firmware bug (which has been fixed in revision 0x05).

[2023-09-02 20:15:25] Pending for incoming shutdown command...
[2023-09-02 20:15:25] Schedule next shutdown at: 2023-09-03 06:15:00
[2023-09-02 20:15:26] Schedule next startup at: 2023-09-03 20:15:00
[2023-09-02 19:16:21] I2C write 0x01 0x08 58 32 failed (result=0x21), retrying 1 ...
[2023-09-03 06:15:02] Shutting down system because scheduled shutdown is due.
[2023-09-03 06:15:02] Halting all processes and then shutdown Raspberry Pi...
[xxxx-xx-xx xx:xx:xx] Witty Pi daemon (v4.13) is started.
[xxxx-xx-xx xx:xx:xx] Running on Raspberry Pi 4 Model B Rev 1.5
[xxxx-xx-xx xx:xx:xx] Seems RTC has good time, write RTC time into system
[xxxx-xx-xx xx:xx:xx] Writing RTC time to system...
[2023-09-03 06:15:28] Done 🙂
[2023-09-03 06:15:28] Firmware ID: 0x26
[2023-09-03 06:15:28] Firmware Revison: 0x03
[2023-09-03 06:15:28] Current Vout=4.95V, Iout=0.53A
[2023-09-03 06:15:28] System starts up because of the scheduled startup got delayed.
[2023-09-03 06:15:28] Maybe the scheduled startup was due when Pi was running, or Pi had been shut down but TXD stayed HIGH to prevent the power cut.

Although the startup was scheduled at 20:15, it got (incorrectly) triggered when your Pi is still ON. As a result this (incorrectly) triggered startup is recorded and will be executed immidately after the shutdown.

So it is confirmed to be the firmware bug, and you can fix it by upgrading the firmware to revision 0x05.

 

 
Posted : 03/09/2023 4:27 pm
(@graeme61)
Posts: 0
New Member Customer
Topic starter
 

Thank you very much for your reply.

You have been a great help explaining the problem and directing me to the solution.

I will upgrade the firmware tomorrow,but before that i will look at the documentation.

Although the upgrade guide is for WittyPi3 ,i assume any reference with a 3 in it i change to 4 ie WittyPi3.ino.hex to WittyPi4.ino.hex ??

 
Posted : 03/09/2023 5:16 pm
(@admin)
Posts: 479
Member Admin
 

@graeme61 yes, and you will need to download the firmware file (revision=0x05) for Witty Pi 4 here: https://github.com/uugear/Witty-Pi-4/raw/main/Firmware/WittyPi4/WittyPi4.ino.hex

The lacking information on the upgrade guide, is how to check the firmware revision. Starting from Witty Pi 4, the firmware ID (at I2C register #0) is fixed and the revision number is stored at I2C register #12. So you can use this command to check its revision number:

i2cget -y 1 8 12

 

 

 
Posted : 03/09/2023 5:27 pm
(@graeme61)
Posts: 0
New Member Customer
Topic starter
 

Thank you very much for the information.

This is a great help to me.

Kind Regards

Graeme

 
Posted : 03/09/2023 5:54 pm
(@graeme61)
Posts: 0
New Member Customer
Topic starter
 

Today just finished upgrading the WittyPi4 firmware.

Following the instructions was easy enough.

It could not find the WittyPi4.ino.hex but changing the ~ to /home/pi/WittyPi4.ino.hex solved it.

Attached WittyPi4 back onto RPI4B then used i2cget -y 1 8 12

output 0x05

 Successful upgrade

 
Posted : 05/09/2023 2:07 pm
(@admin)
Posts: 479
Member Admin
 

There is a new and detailed tutorial about how to compile and flash firmware for Witty Pi 4 (all models). https://www.uugear.com/portfolio/compile-flash-firmware-for-witty-pi-4/

 
Posted : 11/06/2024 10:11 pm
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.