Skip to main content

A web connected PIR motion sensor detecting movement running on 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 

{
   "motion": true,
   "last_motion": "2020-09-28T08:04:02.330388"
}

The RaspberryPi/PIR sensor hardware setup and wiring may look like HC SR501 example.

To install the 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 --hostname 192.168.0.23 --port 9544 --gpio 14

Here, the webthing API will be bind hostname 192.168.0.23 with 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 --hostname 192.168.0.23 --port 9544 --gpio 14

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

pi_pir_webthing-0.0.28.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

pi_pir_webthing-0.0.28-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

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