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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pi_lightsensor_webthing-0.2.22.tar.gz
.
File metadata
- Download URL: pi_lightsensor_webthing-0.2.22.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 729766b452a9c4c909b0d2cc754b20fdc55548959a8e758e9806456117574419 |
|
MD5 | 33d2d9a8d0d84b31d61de876c35de87a |
|
BLAKE2b-256 | 44705b73b42e069348ea2e068a9925f2b1e3d307b62485a5cdf5b94edb8bb9ed |
File details
Details for the file pi_lightsensor_webthing-0.2.22-py3-none-any.whl
.
File metadata
- Download URL: pi_lightsensor_webthing-0.2.22-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 641677703e0c64636cd95505239cfdc887680a66bd6bad8a8a744029141887e3 |
|
MD5 | 61d22bdbdd42095b92e48288523e2bc0 |
|
BLAKE2b-256 | 4dc1cc555e2a092279556228aa4c659532531b2c011222f1fb7fb219329bd151 |