Loading

Pigeon: An Open source Raspberry PI Zero W Cloud Camera

by geraldoramos, published

Pigeon: An Open source Raspberry PI Zero W Cloud Camera by geraldoramos Apr 6, 2017
4 Share
Download All Files

Thing Apps Enabled

Order This Printed View All Apps

Contents

Design Tools

OnShape

Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

11380Views 1386Downloads Found in Camera

Summary

Logo

Example

Pigeon is a simple cloud home surveillance camera project that uses the new Raspberry Pi Zero W single board computer ($10). It uses a custom designed 3D printed enclosure that fits the board and the camera. A wall mount is also included.

The goal of this project is to provide an easy way to setup a basic (yet functional) cloud camera at a very low cost (~$20 total). The software includes features like motion detection and Dropbox integration.

Requirements

  • A Rasberry Pi Zero W running Raspbian and connected to the internet. The regular (no-wifi) Raspberry PI Zero also works, but will require a usb wifi doongle that will stay out of the designed enclosure: Buy a Raspberry PI Zero W
  • A Raspberry Pi camera with cable: Buy it
  • (optional) A long micro-usb power cable: Buy it
  • M1.7x6mm Thread Self Tapping Screws for the case lid
  • Head Combo Machine Screw with Nut, 6-32-Inch x 1-Inch for the adjustable support
  • M3*6 screws for the adjustable support link with the wall mount.

For software installation instructions please check the Github repository

Also available on Instructables

Assembling is pretty straight forward, please use the comments if you have any questions. I apologize for the confusing screw/bolt selections for this project.

Print Settings

Printer:

Qidi Tech 1

Rafts:

No

Supports:

No

Resolution:

0.2

Infill:

20%

More from Camera

view more

All Apps

3D Print your file with 3D Hubs, the world’s largest online marketplace for 3D printing services.

App Info Launch App

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Print through a distributed network of 3D printing enthusiasts from across the US, at a fraction of the cost of the competitors. We want to change the world for the better through technology, an...

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App

3D Print a wide range of designs with Treatstock. Easy to use tools to get the perfect result. The global 3D printing network that connects you with high-quality and fast working print services nea...

App Info Launch App

It seems the 6/32 screw is the wrong thread size. I purchased the one linked below and printed 3 different cases but the screw is just too small of a thread. I ended up using the supplied nut that came with the set.

sorry about that. It's probably a mistake. I will review and make sure to provide the right size in the instructions.

Does anyone know how to change the quality of the stream and what the best settings are?

I have a extremely fast wifi, so I know that isn't the issue. The picture is delayed and any significant movement blurs the picture. I have seen some screenshots of others and they great.

Are you using the official raspberry Pi camera? The quality will not be that great because the motion detection process takes too much processing resources but it's supposed to be decent. Here is how mine looks:
https://www.dropbox.com/s/cspbhmpjwkh9xhm/2490-20170816182116.mp4?dl=0

This is using the default configuration, no changes. I'm also not having a 5s delay, the delay is a lot lower than that.

Or can I turn off motion detection and just run it 24/7 and get a better quality picture? Seems like motion detection takes up a lot of resources. I can just delete the dropbox videos myself.

Yup sure am. The 8MP camera v 2.1.

The FPS seem very choppy on mine. Is there a way to change the FPS? I'd be fine if it was just the viewing quality on streaming. But the file videos uploaded to Dropbox are pretty useless as well.

You can edit the file pigeon.conf (section Live Stream Server). There are video quality configurations you can play around.

The Pigeon project uses the Motion project behind the scenes, there is no way to remove the motion detection mechanism. For that, I would recommend another solution, maybe UV4L: https://www.linux-projects.org/uv4l/

The motion project has just changed the development team, hopefully, there will be improvements to come. More info:
https://github.com/Motion-Project/motion

Regards,

Geraldo

Comments deleted.
Aug 15, 2017 - Modified Aug 15, 2017

i cannot for the life of me get this connected. Someone should really make a video.

I type the git clone... and it comes back and says -bash: git command not found

How do you install this??

I have followed the readme exactly. Am I just supposed to copy and paste?

I am connected through SSH, the Pi is on my wifi. I log into if from the IP address and my password. I copy this -

cd /home/pi
git clone https://github.com/geraldoramos/pigeon.git
cd pigeon

and nothing happens. So I paste this,

 chmod +x pigeon_install.sh
 ./pigeon_install.sh

Again, nothing happens. No loading or file retrieving like seen in the update functions.

Hi, try install git first:

sudo apt-get install git

Haha, that did it! Must have spent 3 hours trying to figure out why it wasn't working.. Thanks Sir!

The image quality on the stream is pretty poor though. There is about a 5 sec delay and then it get's really fuzzy. Any advice?

I think I mistyped my Dropbox token. Where do I edit that? I didn't see it in the Pigeon.conf

Just login to your raspberry pi and run:

sudo rm -rf /home/pi/pigeon/modules/dropbox/binaries/dropbox.conf
sudo ./home/pigeon/modules/dropbox/binaries/dropbox_uploader.sh -f /home/pi/pigeon/modules/dropbox/binaries/dropbox.conf

Let me know if it works!

This did work, thank you

In the process of printing. I see the code allows for uploading to drop box, does it still have the function to upload a network share?

It currently does not have the function to do any other upload except Dropbox... :(

Hi, here is the right place talk about the case ;)
I need to use a wide angle camera. The lens is 14mm diameter. Could you share the source file of your 3D design?
Cheers,
Antony

Hey there, sorry for the delay! This was done using Onshape, do you have an account there? If so, let me know the user name and I can share!

How do i remove the authentication if i set it up by mistake on install? I tried commenting it out in pigeon.conf but that did not work

NVM i found it. Had to change the setting to authentication disabled.

ok! Glad you found out! Let me know if you have any other question.

I'm planning to use it outdoor but looks like the USB is too exposed. Anyone tried this outside already?

I was thinking maybe sealing it good with hot glue or maybe silicon. maybe even epoxy...

Jun 28, 2017 - Modified Jun 28, 2017
geraldoramos - in reply to lsabalo

I don't use it outdoors but looks like this user does: https://www.thingiverse.com/make:326384

Maybe you can comment on the page above to see if you can get any feedback from him?

I might play with the model and try to make the usb compartment tighter, but the tighter I make, more inconsistent it will be with all types of printers we have out there, all with different tolerances. If I make it perfect tweaked for mine, it might not work on many other printer types. The current model has the advantage of working for everyone (regardless the USB cord type and 3d printer).

Any suggestions there?

Pigeon: An Open source Raspberry PI Zero W Cloud Camera

It worked outdoors OK, however over time this design seemed to stress the camera ribbon cable and I had two failures. Have since swapped to a case design where there was more support for the board and a less aggressive bend on the ribbon.

Jun 12, 2017 - Modified Jun 12, 2017

Thanks for the great work. I am going to assemble this but now I realized that I don't know the sizes of screw and bolt. Could you please write it somewhere? There are four different screw sizes, aren't they? Thanks

Quite handy model, thank you. After 3D printing it's quite hit and miss situation without BOM (for all different types of screws). Can't find those extra small for cover (would prefer 2mm etc.).

Thanks for the feedback. I need to improve the BOM and may change the screw sizes as well.

I will be working on a few improvements, including the above, soon!

Sorry about that and thanks for giving it a try!

Jun 1, 2017 - Modified Jun 1, 2017

Would be great if you could provide screw and bolt sizes for assembly.

I've also been looking through the github code and have beeñ writing an SCP upload module, bit noted that there are some issues with the module loader, in that if I don't setup Dropbox, because I don't use it. It just goes through the setup routine again and again, so additional modules won't get loaded.

I've tweaked that, basically to look for the appropriate .conf file in each module directory and if it's not there and you're not in setup, then it skips that module.

Really like the project and have got a few instances of the code working flawlessly. Just struggling a little with the bolts and screws so if you can help that would be great.

Additionally let me know if you want me to contribute my code, I'll be happy to create a branch on your github so you can check it out.

Thanks!

Great feedback, thank you! I was aware of this module issue but just didn't have the time to fix it yet. I'm really looking for contributors, if you can create a pull request with your solution, it will be amazing and really appreciated. Regarding the bolts/screws and better assembly instructions, I will work on that as soon as possible.

Great work on this project, I love it. Wanted to also check in to see if a design for the SHCHV wide angle lense with IR, seems like it would be a perfect fit for this. Thanks!

good idea! I will try to come up with a version that will fit the SHCHV wide angle camera. It will be a great variation for the project. Just bought one...

Hello! Thanks for the camera case model! Does this model work with the official camera?

Yes, it does work with the official Raspberry Pi camera. I also tested with cheap generic versions I purchased on Aliexpress.

Great idea and great case. I've printed one out and installing it this evening. Pi Wifi Zero and cameras are dirt cheap so can see making plenty of these. Adding a cheap £1 PIR detector would be good to catch wildlife events during the night?

Thanks! I recently got some PIR detectors and I'm thinking about incorporating this to the case. Thanks a lot for the feedback. Let me know if you find any issues in the process or have any suggestions for improvement!

Hi, pillar supports seem a bit thin that hold the pi up. Ive broken mine and probably going to remix to make them more solid and open up the holes that fit the lid to take some 3mm screws. Some reason the scripts dont work , seems to be something to do with the sudo wrappers on either the main file on the on_picture_save etc. The scripts run, just that the dropbox uploader doesnt seem to like running inside them. Dropbox uploader and on_picture_save work fine from the command line though.

Apr 16, 2017 - Modified Apr 16, 2017
geraldoramos - in reply to Ajaxjones

Hi,

I've just released a new alpha version with various permission fixes and the ability to setup a name for the camera, this way the dropbox folder will be structured in a way that allows multiple cameras. If you define name X for the camera, the dropbox folder where files will be stored will have the same name.

Can you please update (git pull) and try to reinstall it? If git pull doesn't work, you can do:
git fetch --all
git reset --hard origin/master

Or, if you prefer, you can remove everything and start over by cloning the project again.

If after installation of the new version you still have troubles with Dropbox, please edit the file pigeon.conf and in the line 15, change 'daemon on' to 'daemon off'. This way motion will not run in the background.

After doing so, please make sure motion is not running:
ps aux | grep motion

if you see a motion process, like this:
root 5283 18.9 6.5 99216 24816 ? Sl 02:52 2:33 motion -c pigeon.conf

kill it by doing:
sudo kill -9 5283

When you confirm motion is not running, run it:
sudo motion -c /home/pi/pigeon/pigeon.conf

Now motion will be running in the console, please do any movement in the camera and you should see a motion event starting, like below:
[1:ml1] [NTC] [ALL] motion_detected: Motion detected - starting event 1

When you see that, stop any movement for around 30s, so the event will be finalized and upload will begin. If you have issues with the uploading process to dropbox, we will know at this point. Please send the output to me so I can troubleshoot.

Thanks a lot for testing/using the project, you can also create a Github issue if you still have no luck and want to continue troubleshooting from there. I'm fine continuing troubleshooting here too, but since it's code related, it will be nice to handle in the repository.

In regards to the 3D files, if you do any remix, please show me so I can implement your idea in the design as well. I didn't have troubles with my pillar support, what type of material did you print? What resolution and infill? If you want, you can also send some rough drawing of what solution you think will be good to prevent this pillar issue and I can try to implement asap.

I'm using PLA+ with 20% infill. Second iteration I added a web between pillar and case and that kept them in place, but the pillar pegs still broke after inserting the USB power several times. I also added an extension to the lid so that it held the pi in place and gave something to push against. However next iteration I'm going to look at just fixing the pi to the lid which should make it more robust when using the USB connector. Wonder if there is a way to periodically flash the pi onboard LeD and show it's working? It's currently in place keeping an eye on the garden, a PiNoir is en-route today as I have a large IR array and want to capture garden nightlife and going to use an old zero with USB dongle wifi for that

I replied to your comments with instructions how to do a simple script to turn the LED on and off in an interval, but for some reason, it's being moderated (probably because of the code). Hopefully will not take a long time...

Apr 19, 2017 - Modified Apr 19, 2017
geraldoramos - in reply to Ajaxjones

Thanks! I will try to incorporate those improvements in the next iteration of the model. Regarding the Led, It's totally possible.

To turn the the ACT led on, the command is:
echo 0 | sudo tee /sys/class/leds/led0/brightness

To turn it off, just echo 1 instead:
echo 0 | sudo tee /sys/class/leds/led0/brightness

It's possible to make it run whenever a motion event is triggered (just need to run this on/off command during the events we expose through the modules), but if you want to just turn on and off periodically, I would do a script like this:

```#!/usr/bin/env bash

while true; do
echo 1 | sudo tee /sys/class/leds/led0/brightness &&
sleep 60 &&
echo 0 | sudo tee /sys/class/leds/led0/brightness &&
sleep 60
done



Save it as something like leds.sh and then run it in the background (make sure to add run permission first)
chmod +x leds.sh
sh leds.sh > /dev/null &

This will run the script in the background and turn it on, wait 60 seconds, turn off, wait 60 seconds turn on and do it over and over. You can add this to your rc.local file if you want to make it run whenever the PI restarts.

I'm not sure how visible the LED is after the PI is in the case. Let me know how it goes. Maybe if it's super dark, you will be able to notice well from a distance.

that worked :) I'll post anything else to the git. Interestingly dropbox was all working from cmd line, but when run in no daemon mode it asked for the key again, when that was entered it works and is now catching motion on movement in the garden..

Amazing! Phew :)

Thanks for the feedback, will look into that!

Great idea and nice solution. The problem in our country is, you won't get a Pi Zero under 25 $, if you get it at all (the offerings are really rare). Not to speak about the camera module and the rest of the parts, including the printed ones. A rough calculation showed me, that it would make around 50 $ :-(

Where are you from? Yeah, I understand that this might not be low cost for people outside the U.S :(

Apr 6, 2017 - Modified Apr 6, 2017
TuxMan - in reply to geraldoramos

... from Germany.
I could order it from US or UK, but in this case I had to pay a lot for the mailing and the result would be the same. It is only about the Pi Zero, the other Pis are available for approx. the same price as in US.

bummer.... I bought mine very close to the launch date and it was unavailable everywhere in the US, I ended up buying in the UK:
https://thepihut.com/products/raspberry-pi-zero-w?variant=30332705425

Apr 6, 2017 - Modified Apr 6, 2017
TuxMan - in reply to geraldoramos

Interesting, that's my supplier too but from within Germany and it was more expensive. But even if you take the UK Pi Hut, the camera adapter there costs 4 Pound (approx. the same as Euro or $, the later a little more) and the camera module 24 Pound plus the Pi Zero plus the rest of the parts you will be in the same price area as I mentioned.
But I'm not arguing against you. You are not making the prices ;-) It is still a nice project and it has benefits compared to similar solutions out of the store. You are flexible in programming the functions you need and to make it more secure as many other products.
I will keep a eye on it :-)
Thanks again!

Hello! I now have a camera cable for sale for about $4.5 shipped anywhere in the world within a week: http://www.ebay.com/itm/40mm-long-Raspberry-Pi-Zero-Zero-W-Compatible-Camera-Cable-USA-Seller-/222491606180?hash=item33cd887ca4:g:7~4AAOSwX61ZA2Zd

Thanks for the information :-)

Other option is to get things from China (not the original PI camera). If you get the raspberry PI zero W from PiHut and the rest from China (generic camera&cable + long power cable), I guess the cost will be the lowest possible. (not sure how hard is to buy from China from Germany).

Anyway, Thanks for checking this project out, really appreciate the conversation.

No problem with orders from China except the time it takes till parts arrive. I had some that took up to 8 weeks, average is 5 weeks. I enjoyed the conversation too and as I said, I will keep an eye on this :-)

Top