Public Repository

Last pushed: a month ago
Short Description
Image with motion-mmal setup and cofigured to support motion with the raspberry pi camera module
Full Description

Use your raspberry pi with camera module as a surveillance system by running this container.

source code

supported tags

2.2 Dockerfile
2.1 Dockerfile
2.0 Dockerfile

usage

$ docker run --device /dev/vchiq -p 80:8081 -p 8080:8080 -v /home/pi:/home/pi jritsema/rpi-motion-mmal

or using docker-compose...

motion:
  container_name: driveway-motion
  image: jritsema/rpi-motion-mmal
  devices:
    - "/dev/vchiq"
  volumes:
    - /home/pi/motion:/home/pi
    - /home/pi/cam-driveway/motion-mmalcam.conf:/etc/motion.conf
  ports:
    - "80:8081"
    - "8080:8080"
  restart: always

Optionally, if you would like each motion event to be auto-tagged using Amazon's Rekognition service, you can add your AWS keys as environment variables and configure motion as follows.

motion:
  container_name: driveway-motion
  image: jritsema/rpi-motion-mmal
  environment:
    - "AWS_ACCESS_KEY_ID=xyz"
    - "AWS_SECRET_ACCESS_KEY=xyz"
  devices:
    - "/dev/vchiq"
  volumes:
    - /home/pi/motion:/home/pi
    - /home/pi/cam-driveway/motion-mmalcam.conf:/etc/motion.conf
  ports:
    - "80:8081"
    - "8080:8080"
  restart: always

motion.conf

on_picture_save rekognize %f > %f.json

And if you want to auto-email an event based on certain tags, you can use the following.

motion:
  container_name: driveway-motion
  image: jritsema/rpi-motion-mmal
  environment:
    - "AWS_ACCESS_KEY_ID=xyz"
    - "AWS_SECRET_ACCESS_KEY=xyz"
    - "REKOGNOTIFY_MATCH=Human,People,Person,Animal,Mammal"
    - "REKOGNOTIFY_HOST=smtp.server.net"
    - "REKOGNOTIFY_USER=user@server.net"
    - "REKOGNOTIFY_PASS=xyz"
    - "REKOGNOTIFY_SENDER_ADDRESS=user@server.net>"
    - "REKOGNOTIFY_RECEIVER_ADDRESS=user2@server.net"
  devices:
    - "/dev/vchiq"
  volumes:
    - /home/pi/motion:/home/pi
    - /home/pi/cam-driveway/motion-mmalcam.conf:/etc/motion.conf
  ports:
    - "80:8081"
    - "8080:8080"
  restart: always

motion.conf

on_picture_save rekognize %f | tee %f.json | rekognotify %f
Docker Pull Command
Owner
jritsema

Comments (6)
jritsema
9 months ago

Sorry it took so long but the Dockerfile is finally available here...

https://github.com/jritsema/rpi-motion-mmal/blob/master/Dockerfile

/cc: @richt

jritsema
a year ago

Hi @richt. Sorry for the delayed response as I'm just now seeing these comments (apparently docker hub defaults to no notifications).

Thanks for your comments and I'm glad you found this image useful. I will try to publish the Dockerfile this week.

richt
a year ago

Also if you are running docker on the pi, this is more portable as you might not be in the pi user directory

docker run --device /dev/vchiq -p 80:8081 -p 8080:8080 -v $HOME:/home/pi jritsema/rpi-motion-mmal motion
richt
a year ago

And finally, I don't think you need the bash -c, this should work

docker run --device /dev/vchiq -p 80:8081 -p 8080:8080 -v /home/pi:/home/pi jritsema/rpi-motion-mmal motion
richt
a year ago

I don't think you want -it as this hangs, you want -d to run in background. Also, you have set 8080 to only work on local host, so you want to change /etc/motion.conf.

richt
a year ago

Is there ar docker file for this. very useful