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
{
"bright": true
}
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 --port 9122 --gpio 13
Here, the webthing API will be bind to 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 --port 9122 --gpio 13
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
Hashes for pi_lightsensor_webthing-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46ed8fb83cc1c721d4a156dd2b3f8fd177b66ddae8d0872bffdf80647bcce687 |
|
MD5 | 8861f8d4cc147108bd7130122f0e2c9e |
|
BLAKE2b-256 | 1d1a82dc190b7cfbc7808684109178168f168b62c5f76fed0dc4a737d641f433 |
Hashes for pi_lightsensor_webthing-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37ed536743ce01e76a292120e66e8b2788557f0272ae6c43358103e47fe7e70d |
|
MD5 | d689ee21914a3d9482c0f074f0da04cd |
|
BLAKE2b-256 | 4f775cfd4f748f5c3641878208c6ad7b41ceff5461d713039d31900524240b9e |