Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Raspberry Pi Camera with Wifi and Picam #5

Open
4 tasks
nelsonic opened this issue Jul 7, 2020 · 4 comments
Open
4 tasks

Using Raspberry Pi Camera with Wifi and Picam #5

nelsonic opened this issue Jul 7, 2020 · 4 comments

Comments

@nelsonic
Copy link
Member

nelsonic commented Jul 7, 2020

@pdgonzalez872 wrote this post in 2018. it looks like a good starting point:
https://medium.com/@pdgonzalez872/using-nerves-with-rpi3-wifi-and-picam-3b04cee78d22
Code + full walkthrough: https://github.com/pdgonzalez872/nerves_rpi3_wifi_picam

It would be great to:

  • See if everything still works in 2020
  • Update it to use the latest hardware (Raspberry Pi 4 and/or Zero W)
  • Test it with streaming images/video to a screen either on a separate device or connected to the Pi.
  • Write it up!

The practical applications are:
a. Home security camera (external): dwyl/home#130
b. Monitoring Plants/Fish/Grow System for Aquaponics https://github.com/dwyl/learn-aquaponics/issues
c. OctoPi to monitor/record 3D printer activity - https://octoprint.org | https://youtu.be/ZxHf1LqPiPI
d. GrannyCam - create a secure stream using RTSP / WebRTC
obviously we wouldn't advise anyone to have a camera streaming publicly on the Internet! But with auth it could be a fun little project to create a bi-directional stream between grandparents and grandchildren who are otherwise separated by thousands of miles and only get updates when exhausted new parents remember to send them ... We know a couple of Grandmothers who would be addicted to this 24/7. 😜 ... Baby photos/videos are basically Crack for Grandmothers, they just can't get enough. 🙄

I have the V2.1 Camera and a RPI3 (the exact components used in this tutorial), so I can try and get it working.
But we could consider getting a more advanced camera (with a variable focus lens): https://www.amazon.co.uk/dp/B07R4JH2ZV
image

@th0mas are you interested in helping out with this after you have finished your current work on Access Control?

@pdgonzalez872
Copy link

Please let me know and I'll edit the article to show your findings! This is excellent!

@nelsonic
Copy link
Member Author

@th0mas as noted in dwyl/smart-home-security-system#10 we would like to use a Camera Connected to the Pi to detect motion and switch on the Welcome Display. Which camera do you think would be appropriate for that? (Please do a some Amazon research and share a link so we can send you one today). Thanks!

@th0mas
Copy link
Collaborator

th0mas commented Jul 10, 2020

For your use case, I'd use https://www.amazon.co.uk/LABISTS-Official-Camera-Surrordings-Raspberry/dp/B07VT2KGQC:

Screenshot 2020-07-10 at 10 20 20

Which Is an Infrared version of the Standard Pi camera.

There's a few problems that we'd need to overcome to tick all the boxes however:

  • Motion detection is a hard problem. Theres the Motion library that will help with this, but we'll need to create a custom Nerves image and write an Elixir wrapper round it to use.

  • Streaming Video is hard. The Elixir Picam library only supports MJPEG video streaming, which, while fine for local network use, is too inefficient to use over WAN.

    Streaming using the build in libraries then piping to FFMPEG seems to be the way to go? https://projects.raspberrypi.org/en/projects/infrared-bird-box/10

Membrane Looks promising but doesn't have Native Picam support yet

@nelsonic
Copy link
Member Author

Yeah, totally understand that doing motion detection is definitely not easy. (hence making it a stretch goal). 👍
The only reason I thought it was doable is because a couple of people have managed to do it using Elixir/Nerves.

Arto Bendiken (@artob) gave a superb presentation on Home Security with Elixir and Nerves
where he demonstrates using a PI + Cam to do facial detection:
image
https://youtu.be/oyNSmhkS7Dw - the slides are: https://speakerdeck.com/arto/building-a-home-security-system-with-elixir-and-nerves and corresponding blog post is: https://ar.to/2019/02/talk-at-pivorak-conf-2
But sadly, the code does not appear to be Open Source ...
maybe I'm not looking in the right place: https://github.com/artob?tab=repositories ... 🤷
We could just ask Arto really nicely if he can share some of his work to save time.

Similarly Jacqueline Manzi's (@JacquiManzi) excellent ElixirConf 2019 talk "Breaking Into Nerves" does motion detection:
image
https://youtu.be/IU8epH8FAI4

The code appears to be: https://github.com/JacquiManzi/jacqui_manzi_elixir_conf_breaking_into_nerves
And the motion worker looks like a good starting point for tackling the challenge of motion detection (without face recognition): https://github.com/JacquiManzi/jacqui_manzi_elixir_conf_breaking_into_nerves/blob/master/lib/hello_nerves/motion/worker.ex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants