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.22.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

pi_lightsensor_webthing-0.2.22-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pi_lightsensor_webthing-0.2.22.tar.gz
Algorithm Hash digest
SHA256 729766b452a9c4c909b0d2cc754b20fdc55548959a8e758e9806456117574419
MD5 33d2d9a8d0d84b31d61de876c35de87a
BLAKE2b-256 44705b73b42e069348ea2e068a9925f2b1e3d307b62485a5cdf5b94edb8bb9ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pi_lightsensor_webthing-0.2.22-py3-none-any.whl
Algorithm Hash digest
SHA256 641677703e0c64636cd95505239cfdc887680a66bd6bad8a8a744029141887e3
MD5 61d22bdbdd42095b92e48288523e2bc0
BLAKE2b-256 4dc1cc555e2a092279556228aa4c659532531b2c011222f1fb7fb219329bd151

See more details on using hashes here.

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