Adding powermanagement hat Witty?

19 views
Skip to first unread message

mroberts77 Roberts

unread,
Oct 20, 2024, 3:14:08 AM10/20/24
to motioneye
Hello:

Would adding this hat https://www.adafruit.com/product/5705 provide a means to turn the https://learn.pimoroni.com/article/motioneye-os-on-your-octocam into a system which turns off at night when using the MotioneyeOS software?
Intent is to provide a LiPo battery or solar and use minimum power for a time lapse.
Appreciate insights :)
M

StarbaseSSD

unread,
Oct 20, 2024, 12:58:58 PM10/20/24
to motioneye
Several caveats, here...
motionEyeOS is NOT a full OS, so you cannot install apps, unless you build your own version.
If you can write your own software in Python2.7 to control it (it seems to be i2c capable) you can run it, as motionEyeOS does have Python2.7 included, but not Python3.x...
I don't know how to trigger a power up at a specific time without a RTC (and even then, the Pi would be running to be checking when to come back on) bnut shutdown of the Pi is not an issue with running crontab jobs and commands like 'shutdown -h now' or 'poweroff'...
Best bet is to install the latest PiOS, Python3, and motionEye 0.43.1b2 from here: https://github.com/motioneye-project/motioneye#installation
Note: there are issues with CSI cameras, though when using the latest PiOS...

mroberts77 Roberts

unread,
Oct 20, 2024, 2:34:11 PM10/20/24
to motioneye
Ok. Appreciate the response. Will mull over and think of how to tackle.

mroberts77 Roberts

unread,
Oct 21, 2024, 4:48:26 PM10/21/24
to motioneye
Apologies to come back, but to clarify, the witty pi is like an uninterruptable power supply and has a real time clock on it.  From:  Witty Pi 4 L3V7 - RTC & Power Management for Raspberry Pi : ID 5705 : Adafruit Industries, Unique & fun DIY electronics and kits : and user manual:  WittyPi4L3V7_UserManual.pdf So, it may not be hard to start it up, however, since you have to click "shut down" in the motioneyeOS to turn it off properly, I am unsure if code would do that nicely? I'm not a product developer, so the idea of mixing code and MotioneyeOS operations wouldn't be something I am confident with, but keen to apply the excellent software to an application reducing battery capacity.

"ACCURATE REAL TIME CLOCK AND ON/OFF SCHEDULING

The real time clock (RTC) on Witty Pi 4 L3V7 has been calibrated in the factory, and Witty Pi 4 L3V7’s firmware also makes temperature compensation for the crystal. This makes the RTC very accurate, and the actual annual error is limited to ±2ppm. When your Raspberry Pi boots up, the time stored in the RTC will overwrite the system time. As a result, your Raspberry Pi knows the correct time even without accessing the Internet. You can schedule the startup and/or shutdown of your Raspberry Pi and make it a time-controlled device. You can even define a scheduled script to schedule a complicated ON/OFF sequence for your Raspberry Pi.

Scheduling the ON/OFF sequence for Raspberry Pi is the most popular feature of Witty Pi, and it is extremely useful for battery-powered systems. By only turning on Raspberry Pi when necessary, the battery can be used way much longer with Witty Pi installed.

E-LATCHING POWER SWITCH

Witty Pi 4 L3V7 implements an e-Latching power switch, which behaves very similarly to the power switch on your PC/laptop computer. You can gracefully turn on/off your Raspberry Pi with a single tap on the button. The software running in the background will execute the shutdown command before the power gets cut, and it avoids the data corruption caused by a hard shutdown.

SINGLE I2C DEVICE

Witty Pi 4 uses MCU to emulate a single I2C device with default address 0x08 and also map all I2C registers in real time clock and temperature sensor as virtual I2C registers in the same device. You can access all I2C registers in real time clock and temperature sensor via the single I2C device emulated by Witty Pi 4.

The advantage of this new design is that Witty Pi 4 hides other I2C devices (real time clock, temperature sensor) and becomes the proxy to talk to Raspberry Pi. Because the I2C address used by Witty Pi 4 can be changed to any value, you can always avoid the I2C address conflicting.


On Sunday, October 20, 2024 at 9:58:58 AM UTC-7 StarbaseSSD wrote:

StarbaseSSD

unread,
Oct 21, 2024, 5:19:22 PM10/21/24
to motioneye
Yes, but to talk to it requires an app, Python or other language to talk to the i2c ports. It would be like talking to any other UPS via a serial port. In order to set times, send commands, or read info from it, you need a pre-written app (they supply one) or need to write a script. The issue with motionEyeOS is it is a VERY limited OS and cannot easily add programs/apps using something like:
sudo apt install wittyapp
as neither sudo nor apt exist in the system, hence my suggestion to use RPiOS lite (buster or bookworm) and install motionEye manually...
Reply all
Reply to author
Forward
0 new messages