Software control power ON
Chris Hall (132) 3559 posts |
I should like a very low power watch battery powered power on/off switch that would power on my Pi Zero a certain time (say 20 min or 60 min) after it last switched off. The particular application is for a GPS device: if after being powered back on, its next GPS fix showed that it had not moved, then it would power off again. Also once stationary for 10 mins, it would power off for 10 min. Hence it would only stay on whilst moving. Another application for such a device would be an alarm clock. I do have a watch battery voltage output from a GPS device (which would look after recharging the battery etc.). Any ideas please? |
Jon Abbott (1421) 2651 posts |
Is the Witty Pi any use? |
Gavin (1413) 54 posts |
+1 for the Witty Pi. I have the first gen one and it has worked great. You’d need to configure it in Linux first, I think, but after that I’d assume it wouldn’t care what OS you boot into. I can’t say I’ve ever tried it with RISC OS though. |
Chris Hall (132) 3559 posts |
I’ll try it – many thanks. The second gen one no longer uses TXDATA (which is good as that would confuse the GPS module) and its IIC address is &68 which is different from the OLED display (&78 or &7A I thought but perhaps it is &3C) and the 16×2 text display (&27). It looks like I shall have to see what Linux is doing – utilities written in BASH which is probably similar to BASIC or command line – and then work out how to express the same in RISC OS. |
Rick Murray (539) 13851 posts |
If you mean my OLED, yes, it is device &3C. |
Chris Hall (132) 3559 posts |
Witty Pi version 2 uses a RTC clock chip (3231) similar enough to the 1337 that it ‘just works’. |
Chris Hall (132) 3559 posts |
I have a project which requires a software command to turn off the computer with a scheduled restart time (for the moment 10 mins hence). I have a model A+ plus a Witty Pi and the following BASIC programme which reads the RTC chip time (via IIC) and sets an alarm 10 mins hence (which schedules the machine to be turned on again in 10 mins time). It then waits for you to press the space bar. Once the SPACE bar is pressed, it asserts GPIO 4 low using the GPIO module (which the Witty Pi sees as a command to turn off):
there seem to be a few idiosynchrasies – the day of the week is not set when you set the time for example, but it does work. The chip is sufficiently similar to the DS1337 and DS1338 that it is supported by the RISC OS HAL. The only issue at present is that after it schedules itself to turn on, it seems to lose the time and date setting. This may be due to it setting an erroneous alarm time (minutes sixty-something) so more investigation needed… |