A web connected PIR motion sensor detecting movement Raspberry Pi
Project description
pi_pir_webthing
A web connected PIR motion sensor on Raspberry Pi
This project provides a webthing API to a PIR motion sensor such as descriped here.
The pi_pir_webthing package exposes an http webthing endpoint which supports detecting motion via http. E.g.
# webthing has been started on host 192.168.0.23
curl http://192.168.0.23:9544/properties
{
"time": false,
"last_motion": "2020-09-28T08:04:02.330388"
}
Regarding the RaspberryPi/PIR sensor hardware setup and wiring please refer tutorials such as How to Interface a PIR Motion Sensor With Raspberry Pi GPIO
To install this software you may use PIP package manager such as shown below
sudo pip install pi_pir_webthing
After this installation you may start the webthing http endpoint inside your python code or via command line using
sudo pir --command listen --port 9544 --gpio 14
Here, the webthing API will be bind to the local port 9544 and be connected to the PIR pin using gpio 14
Alternatively to the listen command, you can use the register command to register and start the webthing service as systemd unit. By doing this the webthing service will be started automatically on boot. Starting the server manually using the listen command is no longer necessary.
sudo pir --command register --port 9544 --gpio 14
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pi_pir_webthing-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 610172cf89b251443e6eb68226d2cd214ec2629c802a396ecc16306b4b8a1c60 |
|
MD5 | 63850e8363c38f26aec2874e7b6b9787 |
|
BLAKE2b-256 | 85b792f1a78261f3b08e6ff22a001784d2a4497328a0e73685037cece4418ce4 |