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 

{
   "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 131

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 33

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.2.tar.gz (3.8 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.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pi_lightsensor_webthing-0.0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.6

File hashes

Hashes for pi_lightsensor_webthing-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c5cbd2a5280c9c19aaf5bd2743e15f716c45f021efd82c784636a9bee28ad009
MD5 cad867c7c1b8ffc1709a145d7f3d2fd9
BLAKE2b-256 54c22bb5c3a48a3d28f53f57d1699ed55d21d38e59b8dbae3261efaed3e3762c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pi_lightsensor_webthing-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.6

File hashes

Hashes for pi_lightsensor_webthing-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6cbc75bb57a9994f84059c0390688c856f32d2e7c1e7e398f7e662e17485acdf
MD5 ad3e7e92327b29730152c77689ebf92c
BLAKE2b-256 7ebfdf1d91efbe9ec097f3974217a7888633923134f51046f8dae68e822b1c50

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