Sign inSign up

marcellodesales/iot-web-piliter

By marcellodesales

•Updated almost 10 years ago

Web server that turns all the PILiter lights on/off when hitting the server

Image
0

333

marcellodesales/iot-web-piliter repository overview

The IOT example for Raspberry PI turning all the lights on https://www.m.nu/pi-liter-8-led-strip-for-the-raspberry-pi⁠ from a Web server.

⁠Start the server

$ docker run --privileged=true -ti -p 3333:5000 iot-web-piliter
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 * Restarting with stat
/lights.py:11: RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
  GPIO.setup(pin, GPIO.OUT)
 * Debugger is active!
 * Debugger pin code: 203-431-605

⁠Hit the server

~ ⌚ 5:46:56
$ curl http://pimanager:3333
{"count": 1}%
~ ⌚ 5:47:05
$ curl http://pimanager:3333
{"count": 2}%
~ ⌚ 5:47:10
$ curl http://pimanager:3333
{"count": 3}%
~ ⌚ 5:47:13
$ curl http://pimanager:3333
{"count": 4}%

⁠Server Logs

$ docker run --privileged=true -ti -p 3333:5000 iot-web-piliter
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 * Restarting with stat
/lights.py:11: RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
  GPIO.setup(pin, GPIO.OUT)
 * Debugger is active!
 * Debugger pin code: 203-431-605
192.168.1.113 - - [08/Nov/2016 13:46:38] "GET / HTTP/1.1" 200 -
192.168.1.113 - - [08/Nov/2016 13:46:42] "GET / HTTP/1.1" 200 -
192.168.1.113 - - [08/Nov/2016 13:46:45] "GET / HTTP/1.1" 200 -
192.168.1.113 - - [08/Nov/2016 13:47:02] "GET / HTTP/1.1" 200 -

Tag summary

Content type

Image

Digest

Size

87.6 MB

Last updated

almost 10 years ago

docker pull marcellodesales/iot-web-piliter