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?
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.
@admin Hi, sorry never got notification of a reply. Thanks for the suggestion. Looks/sounds promising 🙂
@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
@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:
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.
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
@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?
@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.
@admin Hmm, so should not happen with L3V7 then? But it looks like it is?
@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.
Thanks but the power source is fine and monitored
@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.
@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? 🙂
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 🙁