Skip to content

Commit

Permalink
docs: update readme (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
j3ko authored Dec 28, 2024
1 parent 5e6f990 commit f764ee4
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 14 deletions.
17 changes: 6 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ language: generic
services:
- docker

branches:
only:
- main

env:
global:
- IMAGE_NAME="j3ko/motionberry"
- secure: "VlXKeuMmo2tctwL2fIBvEuVpqW6tzob4fDFuyk6oHRdu/zeWXRSCAXTU40Tg1Ls+/8nWreV+Xas7RTPGXTMmPzKhF24QIvql0Gqm+DA15C1i5qzTU0gg6mX87z8e4JFh2kacvf2Wsto8SxK6JKCfwtHM/WVRolSoagMjB10IRB9sBoLMcNwloHM9E7jrgxv4QY5simK4oqJj5HDzYbBE3n+k3qR1yk/UFfQTuKit+tN35ul0A4PEfkTgyOQjNIMGrIgF+x1h2UatJNjtgzTOhk0InJZKeO0uULpG9g9a3/Mtk5vNrmDFzlwRD+pWkOaJJFih3B/hz+fRi6uFCikelokMluD8JAdrLSh2OLrK85y5TkxDb8PMsV7HeZtD1jitlc2U7c2MjLYmtpgE9r5mH9mFboag0sDeu0XuDBjNwwzd1HbImPV2NCgaAN3RNOpSz/X5lJMZLRVNHCY3kP9yP2HWTSPLilJCQuMWIvtg1ACXtrL8agd6DIW5XWtf2QZvnZiw3tsrVr5eKkggdhRfDgG3esi5BqP1FZHJYoLvywQEUQA1x4gnyGOda3yQwsHB8xHSMonqbOTYzIG4CAMCFmJyeQYJvCrZA3QzCxXgRmbUw7K5Kn6c4GqbsFoHhsc6OaJ4YOyf8p+9zTKbvV4y8K4+WZdwaFpwRlHvrIH1puQ="
- secure: "OULpw2FDrT3V+I1xgozV4D1vEU3NJmJEyzlsK+a+necHgcZORW2xRMaGmmmTybZMFRLmSQa+aaPleqZprvb15zvGErFIC7zitLXQhDzi6x2WlEd2RSoreK/0ohbZlhQc8y67pPCh00dSDp1nCnIAakj60PgNJqXPG958iMJOQwRNd9+NBhyOrs5IkKHVU7nGpD1xFKasC+6Koj52o/IiKWfY3U7CsGw+Ba88+8SG7Xt3AlXTH/Yb2jxjrsjV0ugjOC4VAZAU7JL743l0nn7+SUr+FdoepMf2dt4FgXbOvkDV/hub+cmynyD4/FM5n4H4zawHlirDUZ4FWVTAvnSaUAIG0ZDpV6h69RRmhyZ5mgHDaIGuBx6YpRPuwxZzj+O+uH7FE7ZE1754EmHbcyWzyTaqmPTpUOlUgoBn7PdfTpCVSdQuKe9pf1S94f6JVB3J3BoJeYlOnya2D2nvQJu4qePMoD8o7jwtTu/KUkJLmrJvndcu8AhbR+SKI/NWtpmapxolWr4XoHrmXS0vMYfve2S3s6t/pFT4ZIldoJg29599oS4KVPsLlYzCsx3VceeVr+bp0xmo9d6SFeFPDNVsliOLVsaKr0GF5HNGzoPQ3ts3TZRU5NGvyHTn0wZJstCuHEBcqu79r2iwxjPSRxgdag1G4X6eoGoOfeDOBXBBJjo="

before_install:
- |
if [[ ! ($TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ || $TRAVIS_BRANCH == "main") ]]; then
echo "No deployment conditions met; skipping build."
exit 0
fi
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Expand All @@ -30,9 +27,7 @@ deploy:
docker push $IMAGE_NAME:$TRAVIS_TAG;
docker tag $IMAGE_NAME:$TRAVIS_TAG $IMAGE_NAME:latest;
docker push $IMAGE_NAME:latest;
elif [[ $TRAVIS_BRANCH == "main" && -z "$TRAVIS_TAG" ]]; then
elif [[ -z "$TRAVIS_TAG" ]]; then
docker tag $IMAGE_NAME $IMAGE_NAME:edge && docker push $IMAGE_NAME:edge;
fi
on:
branch: main
tags: true
65 changes: 62 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,70 @@
# motionberry
# Motionberry

Motion detection and streaming solution for Raspberry Pi, built using `picamera2`.

## Pre-requisites

- A Raspberry Pi
- A camera module compatible with picamera2 (e.g., Raspberry Pi Camera Module 3).

## Docker installation
Run the following command to deploy Motionberry using Docker:
```bash
docker run --name motionberry \
--privileged \
-e PUID 1000 \
-e PGID 1000 \
-v <path to config.yml>:/motionberry/config \
-v <path to capture directory>:/motionberry/captures \
-v /run/udev:/run/udev:ro \
-p 5000:5000 \
motionberry
```
j3ko/motionberry:latest
```

Explanation of Options:

- `--privileged`: Required for hardware access, such as the camera module.
- `-e PUID` / `-e PGID`: Set user and group IDs to match your system's user permissions.
- `-v <path>`: Map local directories to container paths:
- `<path to config.yml>`: Path to your configuration file.
- `<path to capture directory>`: Directory where captures will be stored.
- `-p 5000:5000`: Maps port 5000 on the host to the container.

Replace `<path to config.yml>` and `<path to capture directory>` with appropriate paths on your host machine.

## Bare metal installation
To install and run Motionberry natively on your Raspberry Pi, follow these steps:
1. Install Required Libraries:
```bash
sudo apt install -y --no-install-recommends \
git \
python3-dev \
python3-venv \
python3-pip \
python3-numpy \
python3-picamera2
```
1. Clone the Repository:
```bash
git clone https://github.com/j3ko/motionberry.git
```
1. Set Up a Virtual Environment:
```
cd motionberry
python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install --upgrade pip
pip install --no-cache-dir -r requirements.txt
```
1. Run the Application:
```bash
.venv/bin/python run.py
```

## Configuration

For configuration options, refer to [config.default.yml](https://github.com/j3ko/motionberry/blob/main/config.default.yml).

## Reporting Issues

For bugs and issues, please create a GitHub issue [here](https://github.com/j3ko/motionberry/issues).

0 comments on commit f764ee4

Please sign in to comment.