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.21.tar.gz (5.7 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.21-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pi_lightsensor_webthing-0.2.21.tar.gz
Algorithm Hash digest
SHA256 03bb1b93603065f8bc8b63cf83b9073b76592a2fad4cef9098e052b4be749394
MD5 0b8bc747ab099121ed81fcf141bf82fe
BLAKE2b-256 a2230d22b6786d19fb736dc7c604c30ea9370824d5602c2836a16fbbf48739f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pi_lightsensor_webthing-0.2.21-py3-none-any.whl
Algorithm Hash digest
SHA256 d8e47d58190d1b5d7ae86d14f51a8da623cf9e40c319066ca2495411a0234c64
MD5 db184290f8741b40b11fd7d0697ef8b0
BLAKE2b-256 a19584b560b95578b52a208076455b4da5156a8106cb468207025e5fb3566167

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