publiclab / pi-builder

Developing a reproducible build script system for making Raspberry Pi .img files
MIT License
22 stars 15 forks source link

Witty pi energy manager software #46

Closed imvectech closed 6 years ago

imvectech commented 6 years ago

WHAT

011

Witty pi mini is a Uugear RPi shield capable of managing energy of the RPi together with keeping time using an embedded RTC.

https://github.com/uugear/Witty-Pi-2

We are working on a timelapse camera for river monitoring. The intention is to turn on the rpi 5 minutes every hour and take a picture. Simple as that. The Witty pi controls the On/OFF of the RPi sending zero voltage to the Pi to fully turn it off. After 55 minutes the Witty sends a electrical signal and the Pi boots up.

We've already done this using raspbian and want to use the PL camera kit instead ;D

In the recipe we also include a pythin script for the timelapse and some packages needed.

Download instructions

Generating the image will take a few minutes. Once the image is prepared, and if it succeeded, you'll see a green checkmark at the bottom of the pull request. To download the image:

  1. click the green checkmark; you'll go to a page at a URL like https://gitlab.com/publiclab/image-builder-rpi/pipelines/########/builds
  2. On this page, click the Jobs tab, next to Pipeline
  3. Click the green Passed button
  4. Click Download in the right-hand sidebar
  5. Unzip the artifacts.zip file, and also the hypriotos-rpi-camera_web.img.zip within it
  6. Use a program like https://etcher.io/ to flash it to an SD card

You'll also be able to read the output of the image generation in this window.

We hope to create a bot to report back the completed image URL in each pull request. If you can help create such a bot, please contact us at:

https://github.com/publiclab/image-builder-rpi/issues/16

Thanks!

imvectech commented 6 years ago

Picture of the camera over the Anoia River near Barcelona.

21-38-20

jywarren commented 6 years ago

Hmm, @icarito is it just taking a while for the GitLab process to begin?

Exciting!!! :-)

I wonder if this would make the Pi last a lot longer using one of these little batteries :-) https://www.amazon.com/s/?ie=UTF8&keywords=cr123a 🔋 ⚡️ 😴

imvectech commented 6 years ago

Is it possible that importing those files to github simplifies the hole thing? We are using the Witty to turn the camera off for 55 minutes. I suppose depending on the project, for sure the board will help making those batteries last longer ;D

jywarren commented 6 years ago

importing those files

which files?

Oh wow i like this approach too! Ideally we can get not only this but also the entire timelapse system running from a prebuilt image.

imvectech commented 6 years ago

the script incorporates the execution of the installWittiPi.sh script to install the witty software + download of the schedule.wpi file and the erase of the original daemon.sh and donwload of a modified one. There is an issue with witty pi and GPIO4 solved changing just a number. After having the witty working this python script is executed on boot to take the picture. Waits 6 minutes and before next picture the witty turns the hole system down. Route of the pictures shoud be changed as it's from our raspbian tests.

!/usr/bin/env python

import time from picamera import PiCamera from datetime import datetime from time import sleep from signal import pause

camera = PiCamera()

frame = 1 while True: try: datetime = datetime.now() camera.resolution = (2592, 1944) camera.capture('/home/pi/Pictures/%s.jpg' % datetime) frame = 1 sleep(360) except IOError: print ("Error")

pause()

imvectech commented 6 years ago

Sorry for the third commit. I didn't intend to merge branch witty into patch-1 but the opposite ;D

icarito commented 6 years ago

I'm guessing PR into master are built automatically by GitLab? e.g. https://gitlab.com/publiclab/pi-builder/-/jobs/115498371

jywarren commented 6 years ago

Ah ok, so @imvectech you just have to open the PR against the master branch instead of the witty branch! Or I could merge it and reopen the witty pr?

imvectech commented 6 years ago

ok closing here and opening a new one. This is being a 100%git learning process. I'll try to install the Witty pi and try our approach with the timelapse already provided ;)

New PR #47

jywarren commented 6 years ago

Awesome and thanks for giving it a try!!!

On Sat, Nov 3, 2018, 9:00 AM IMVEC <notifications@github.com wrote:

Closed #46 https://github.com/publiclab/pi-builder/pull/46.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/publiclab/pi-builder/pull/46#event-1944370514, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ99Sa3m00UAvFI7l_lksFyHZ7bqxks5urZNIgaJpZM4YI7gp .