Skip to main content

A web connected digital light sensor measuring the intensity of ambient light on Raspberry Pi

Project description

pi_lightsensor_webthing

A web connected digital light sensor measuring the intensity of ambient light on Raspberry Pi

This project provides a webthing API to a digital light sensor such as mentioned in Photo-resistor light sensor on Raspberry Pi.

The pi_lightsensor_webthing package exposes an http webthing endpoint which supports measuring the intensity of ambient light via http. E.g.

# webthing has been started on host 192.168.0.23

curl http://192.168.0.23:9122/properties 

{
   "brightness": 100
}

Regarding the RaspberryPi/digital light sensor hardware setup and wiring please refer tutorials mentioend above

To install this software you may use PIP package manager such as shown below

sudo pip install pi_lightsensor_webthing

After this installation you may start the webthing http endpoint inside your python code or via command line using

sudo lightsensor --command listen --hostname 192.168.0.23 --port 9122 --gpio 13

Here, the webthing API will be bind to hostname 192.168.0.23 and the local port 9122 and be connected to the light sensor digital pin using gpio 13

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 lightsensor --command register --hostnme 192.168.0.23 --port 9122 --gpio 13

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_lightsensor_webthing-0.0.24.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pi_lightsensor_webthing-0.0.24-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file pi_lightsensor_webthing-0.0.24.tar.gz.

File metadata

  • Download URL: pi_lightsensor_webthing-0.0.24.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for pi_lightsensor_webthing-0.0.24.tar.gz
Algorithm Hash digest
SHA256 cc445e16e29988cdf500fc7dbf83e21396dfb1ebfe82d59850413459d01656ab
MD5 79d9998bbafe2e4980d71f1e5c524ff6
BLAKE2b-256 4e4eeb00aaf2445d4e2f23a744ef02b1b5b6ea3f978484e911af6d02581e7ca1

See more details on using hashes here.

File details

Details for the file pi_lightsensor_webthing-0.0.24-py3-none-any.whl.

File metadata

  • Download URL: pi_lightsensor_webthing-0.0.24-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for pi_lightsensor_webthing-0.0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 9876da8d935f341e5cb80b64d4131cfd2356e3499faf568082c1ad3ff0a4372e
MD5 385bfb27659b1a21c372b6d63edd79e6
BLAKE2b-256 c04c721144eac820360e24ae3eed7ee788646e226aa33c2408f54a00820778ee

See more details on using hashes here.

Supported by

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