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

{
   "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 -p 9122:9122 -e gpio=13  grro/pi_lightsensor_webthing:0.1.0


**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 --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


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.0.27.tar.gz (5.1 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.0.27-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pi_lightsensor_webthing-0.0.27.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.7

File hashes

Hashes for pi_lightsensor_webthing-0.0.27.tar.gz
Algorithm Hash digest
SHA256 2a9abb61263d5ecada5b2af8de32224d1e4c35684b939f26e5f14d72e70f3e61
MD5 5a8b07d77b0a4e8945c19ab650629369
BLAKE2b-256 a799751889d41dce242ed6798c919f00efa6eead019acf05804f9aaafbccc278

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pi_lightsensor_webthing-0.0.27-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.7

File hashes

Hashes for pi_lightsensor_webthing-0.0.27-py3-none-any.whl
Algorithm Hash digest
SHA256 0ae34763a4e1d48fef072c40913185cc50e8b2c27d6efc3007332a2947ce2a68
MD5 b2d564b91bd95b2319f8802749477286
BLAKE2b-256 9022b9cb9a3af385e219cb87e0300f54c3777903c9c2a9dd8e8e12360ec3a41d

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