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

[Solved / Archived] Witty Pi 4 L3V7 - interupting the scehduler

15 Posts
2 Users
0 Likes
194 Views
(@andrew-simpson17)
Posts: 103
Estimable Member Customer
Topic starter
 

HI,

 

I was thinking of using your scheduler.  But, I am concerned that my customer will make a mistake with it and then cannot do anythign about it until the scheduler 'kicks' in to affect further changes.  Is there a GPIO I can pull down to 'awake' the Rpi and bypass ths scehduler at all?

 
Posted : 14/11/2024 4:33 pm
(@admin)
Posts: 507
Member Admin
 

There is no built-in funtionality that does what you mentioned, however you can always implemt it by yourself. The software is written in BASH, and modification on it should be rather simple.

Maybe a better way is to write your own script/program, which monitors a GPIO and renames the "schedule.wpi" file if that GPIO is pulled down. You can put the full path of your script/program in this beforeScript.sh file, so it gets executed on boot before running the schedule script. Renaming the "schedule.wpi" file will effectly disable the schedule script.

 
Posted : 14/11/2024 4:54 pm
(@andrew-simpson17)
Posts: 103
Estimable Member Customer
Topic starter
 

@admin Hi, sorry never got notification of a reply. Thanks for the suggestion. Looks/sounds promising 🙂

 

 
Posted : 18/11/2024 2:50 pm
(@andrew-simpson17)
Posts: 103
Estimable Member Customer
Topic starter
 

@admin If the scheduler is active and has put my Rpi on standbye then any program I have running to monitor a GPIO (to delete that file) cannot be running.  Were you thinking of the scemario of when the scheduler wakes up my Rpi and THEN it looks at whether the GPIO is pulled down? If so that would not solve my UserCase.  I think that is what you mean but just wanted to make sure

 
Posted : 04/12/2024 9:47 pm
(@admin)
Posts: 507
Member Admin
 

@andrew-simpson17 I guess I misunderstood your question. I thought you want to disable the schedule script if the the script was badly written and it prevents your Raspberry Pi from normal boot on (by immediately shutting it down). In that case the user can pull down a GPIO while booting up the Pi and the program you prepared can rename the schedule script and disable it.

Back to your question:

Posted by: @andrew-simpson17

Is there a GPIO I can pull down to 'awake' the Rpi and bypass ths scehduler at all?

Yes. GPIO-4 (BCM naming) is the GPIO that does exactly the same. It is also the GPIO that directly connects to the switch onboard, as well as the "SW" pin in unpopulated header P3. Momentally short it to GND will have the same effect like tapping the button, which turns on your Pi.

 

 
Posted : 05/12/2024 8:23 am
(@andrew-simpson17)
Posts: 103
Estimable Member Customer
Topic starter
 

Now that you said it I feel stupid.  I do this in my code already to simulate a shutdown.

So sorry for taking up with your time with this. But thank you

 
Posted : 05/12/2024 8:49 am
(@andrew-simpson17)
Posts: 103
Estimable Member Customer
Topic starter
 

@admin Hi. Just been testing this.  Is there any scenario when the RPi is off/standby, the power bank is connected (and active) and the lipo battery is connected that when you press your power/toggle switch the white light comes on briefly but the Rpi does not start up?

 
Posted : 06/12/2024 3:11 pm
(@admin)
Posts: 507
Member Admin
 

@andrew-simpson17 sounds like the MCU gets reset when the button is pressed. There is a topic for that behavior on Witty Pi 3 Mini and Witty Pi 4 Mini. But I don't think Witty Pi 4 L3V7 has this issue.

 
Posted : 06/12/2024 3:26 pm
(@andrew-simpson17)
Posts: 103
Estimable Member Customer
Topic starter
 

@admin Hmm, so should not happen with L3V7 then? But it looks like it is?

 
 
Posted : 06/12/2024 3:31 pm
(@admin)
Posts: 507
Member Admin
 

@andrew-simpson17 the symptom is similar, but the reason may be different.

If your power source can not deliver required peak current, the MCU may also get reset.

 
Posted : 07/12/2024 12:43 pm
(@andrew-simpson17)
Posts: 103
Estimable Member Customer
Topic starter
 

Thanks but the power source is fine and monitored

 
Posted : 07/12/2024 12:50 pm
(@andrew-simpson17)
Posts: 103
Estimable Member Customer
Topic starter
 

@admin Hi. How do I know if the MCU has been reset?

 
Posted : 07/12/2024 8:21 pm
(@admin)
Posts: 507
Member Admin
 

@andrew-simpson17 there is not direct indicator for MCU reset, and you can only judge according to its behavior. If it has an action going on and suddenly stop doing it, most probably it is due to MCU reset.

If the MCU may be reset by low voltage/incapable power source, you may monitor the 3.3V rails with oscilloscope. A sharp wave trough usuallly leads to an MCU reset.

 
Posted : 08/12/2024 9:59 am
(@andrew-simpson17)
Posts: 103
Estimable Member Customer
Topic starter
 

@admin Hi.OK I understand that. 

I think I found the issue.  I noticed that when the Rpi is shutdown the red light is still on the Witty board which I assume means that it has not shutdown properly. So, removing the shceduling code I just tested switch it on and off using a button. The red light stays on and I cannot turn the Rpi on via the switch.  If I shutdown via a button on my app it all works. So, it looks ike pulling the GPIO4 down does not give enough time for my app to exit gracefully?  I have set the 'Power cut delay after shutdown' to 25.0 seconds but that did not make amy difference. 

Any suggestions? 🙂

 
Posted : 08/12/2024 10:44 am
(@andrew-simpson17)
Posts: 103
Estimable Member Customer
Topic starter
 

Ignore last message. It seems every now and then a background task is not finishing and as such the rpi has not properly shutdown - hence the red light. Thanks for the support but this looks like my error 🙁

 

 
Posted : 08/12/2024 3:55 pm
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.