Skip to main content

Simple Raspberry Pi camera http server interface

Project description

Picamip

Python simple Raspberry-Pi camera module web interface

PyPI version License: GPL v3

This software runs on a RPi, it starts a webserver accessible via it's IP address. The web interface has a preview screen, buttons to take picture, download and delete images.

picamip UI

Installing

Install with pip

pip install picamip

Running

The software can be started with

$ picamip

Then go to the interface at http://<Raspberry IP address>:8000

Additional options may be passed to the program:

picamip --help
usage: picamip [-h] [-p PICTURE_DIR] [-f FILES_PREFIX] [-t FLASK_TEMPLATE]
               [-s FLASK_STATIC] [-o FLASK_OVERLOAD] [-d DEFAULT_ROUTE] [-v]
               [host] [port]

picamip: Python simple Raspberry-Pi camera module web interface

positional arguments:
  host                  Server host
  port                  Server port

optional arguments:
  -h, --help            show this help message and exit
  -p PICTURE_DIR, --picture-dir PICTURE_DIR
                        Pictures storage directory
  -f FILES_PREFIX, --files-prefix FILES_PREFIX
                        Directory to store the pictures. Default: ~/Pictures
  -t FLASK_TEMPLATE, --flask-template FLASK_TEMPLATE
                        Flask additional jinja2 templates directory,
                        overwrites defaults.
  -s FLASK_STATIC, --flask-static FLASK_STATIC
                        Flask additional static files directory, overwrites
                        defaults.
  -o FLASK_OVERLOAD, --flask-overload FLASK_OVERLOAD
                        Flask app functions overload.
  -d DEFAULT_ROUTE, --default-route DEFAULT_ROUTE
                        Default root route. Eg: index.html
  -v, --version         show program's version number and exit

Customizing

It's possible to customize the frontend by specifying another static and template directories with: --flask-static and --flask-template.

Endpoints may be customized by declaring callback functions into a python script and using --flask-overload. Overload functions must start with overload and they receive an instance of flask.Flask (app ) and an instance ofpicamip.StreamPiCamera (camera).

Endpoints

Default endpoints are:

  • / - GET: root route
  • /files - GET: Gets the current storage indexes and filenames
  • /stream - GET: Camera preview (mjpeg)
  • /picture - GET: Gets an image of given index
    • Query params: index (int) - picture index, download (bool)- Downloads the image
  • /picture - POST: Takes a picture from the camera
    • Query params: download (bool)- Downloads the image
  • /downloadAll - GET: Downloads all the images as a zip file
  • /deleteAll - DELETE: Deletes all images
  • /delete - DELETE: Deletes an image of given index
    • Query params: index (int) - picture index
  • /shutdown - POST: Shuts down the Raspberry Pi

License

Python simple Raspberry-Pi camera module web interface Copyright (C) 2021 Luiz Eduardo Amaral luizamaral306@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

picamip-1.2.0b0.tar.gz (607.1 kB view details)

Uploaded Source

Built Distribution

picamip-1.2.0b0-py3-none-any.whl (394.4 kB view details)

Uploaded Python 3

File details

Details for the file picamip-1.2.0b0.tar.gz.

File metadata

  • Download URL: picamip-1.2.0b0.tar.gz
  • Upload date:
  • Size: 607.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for picamip-1.2.0b0.tar.gz
Algorithm Hash digest
SHA256 6798601c845048c48c5efee54f140e78fb49b8981e2bef92a8b5c85862b578b0
MD5 bb737d56134bef5dce9a195fa72a7311
BLAKE2b-256 efc10caa8ffc8012431b5318f302b331868626dd24752f376570981847396b1a

See more details on using hashes here.

File details

Details for the file picamip-1.2.0b0-py3-none-any.whl.

File metadata

  • Download URL: picamip-1.2.0b0-py3-none-any.whl
  • Upload date:
  • Size: 394.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for picamip-1.2.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 2277969434989a2b2658105d39153fb5c4983f7620797ee0e4e140fb5f2b3455
MD5 9637c3d05230a3382b01fa600f849bf3
BLAKE2b-256 1b743bffd0ddbba40fa174c322d6325364634d406f37a6d0789b40d33e35c794

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page