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 BH1750. Please consider to activate I2C 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 mentioned above

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

Docker approach

sudo docker run --privileged -p 9122:9122 grro/pi_lightsensor_webthing

PIP approach

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 --port 9122 

Here, the webthing API will be bind to the local port 9122

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 --port 9122

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.2.13.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.2.13-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pi_lightsensor_webthing-0.2.13.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pi_lightsensor_webthing-0.2.13.tar.gz
Algorithm Hash digest
SHA256 b2502dd3573eb9a003c18a9b7989b98d43a9ac7854aa5694ac91eb934bc8c732
MD5 942a0394ed6dfde38879e4e336303aa8
BLAKE2b-256 5838a2fdddd23acc1549045d94a2334e7e52c7831b10f553ce36e06c0795e2d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pi_lightsensor_webthing-0.2.13-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pi_lightsensor_webthing-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 b553cfc228184048e3f6c79a42e45a7560f5487431ea9fb27b22928d37888e14
MD5 ba9f49992fa0ff5bf40f7fb639ae793c
BLAKE2b-256 e8d9b7b39575f44845946f3337b5b2bcd9af075e3197ae1caba0b78d01b40c98

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