Client library to control a raspberry PI camera through MQTT
Client library to control a raspberry PI camera through MQTT.
- Provides high level methods to control a raspberry PI camera:
The camera needs to have the RPi-Cam-Web-Interface installed and the MQTT agent running. Check rpi-cam-mqtt (https://gitlab.com/gbus/rpi-cam-mqtt) project for further details.
The library can be installed and called in a python module:
pip3 install rpicammqtt_client
from rpicammqtt_client import RpiCamMqttClient help(RpiCamMqttClient)
The configuration file is looked up from:
/etc/rpi-cam-mqtt/rpi-cam-mqtt.yaml $HOME/.rpi-cam-mqtt/rpi-cam-mqtt.yaml ./config/rpi-cam-mqtt.yaml
A template can be downloaded from:
The main class RpiCamMqttClient needs to have passed a reference to publish/subscribe custom definitions to implement the specific calls to the MQTT library of choice. One based on the paho mqtt library is provided and can be used for reference:
from rpicammqtt_client import RpiCamMqttClient from rpicammqtt_client.mqtt import MQTT
The RpiCamMqttClient needs the rpicam name as configured in the remote agent that controls the camera and a few extra options to change the MQTT behaviour.
The main method to use is run_command, which allows to publish any command as it would normally be sent to the PIPE. More info:
Additionally a few higher level methods are provided that simplify the use of the library. A good starting point is the list of examples described in the next section where it is possible to see the library in action.
Example of applications using the library can be found in the package:
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size rpicammqtt_client-0.3.0-py3-none-any.whl (15.9 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size rpicammqtt_client-0.3.0.tar.gz (5.4 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for rpicammqtt_client-0.3.0-py3-none-any.whl