Servidor escrito en Golang que permite una comunicación con la tira de Leds WS281X, vía API, de forma que puedas controlar la tira de LEDs con una serie de peticiones http desde cualquier cliente.
Compilar la librería rpi_ws281x directamente en la Raspberry Pi, de acuerdo a la documentación, para luego copiar los ficheros *.a
a /usr/local/lib
y los ficheros *.h
a /usr/local/include
.
POST
/action
(Restaura la configuración de la tira de leds y enciende las luces con la animación por defecto)
type command "startup" {"instruction":"any","args":[]}
http code content-type response 201
application/json
{"type":"startup","command":{"instruction":"any", "args":[]}}
400
application/json
Error message
curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8888/action
POST
/action
(Apaga las luces y las deja en modo ahorro de energía)
type command "shutdown" {"instruction":"any","args":[]}
http code content-type response 201
application/json
{"type":"shutdown","command":{"instruction":"any", "args":[]}}
400
application/json
Error message
curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8888/action
POST
/action
(Sube el brillo de la tira de LEDs un 25%)
type command "set-brightness" {"instruction":"increase","args":[]}
http code content-type response 201
application/json
{"type":"set-brightness","command":{"instruction":"increase", "args":[]}}
400
application/json
Error message
curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8888/action
POST
/action
(Sube el brillo de la tira de LEDs una cantidad especificada)
type command "set-brightness" {"instruction":"increase","args":["10"]}
http code content-type response 201
application/json
{"type":"set-brightness","command":{"instruction":"increase", "args":["10"]}}
400
application/json
Error message
curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8888/action
POST
/action
(Baja el brillo de la tira de LEDs un 25%)
type command "set-brightness" {"instruction":"decrease","args":[]}
http code content-type response 201
application/json
{"type":"set-brightness","command":{"instruction":"decrease", "args":[]}}
400
application/json
Error message
curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8888/action
POST
/action
(Baja el brillo de la tira de LEDs una cantidad especificada)
type command "set-brightness" {"instruction":"decrease","args":["10"]}
http code content-type response 201
application/json
{"type":"set-brightness","command":{"instruction":"decrease", "args":["10"]}}
400
application/json
Error message
curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8888/action
POST
/action
(Pone las luces en modo oficina)
type command "change-mode" {"instruction":"office-lights","args":[]}
http code content-type response 201
application/json
{"type":"change-mode","command":{"instruction":"office-lights", "args":[]}}
400
application/json
Error message
curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8888/action
POST
/action
(Pone las luces en modo arcoiris bolas)
type command "change-mode" {"instruction":"rainbow balls","args":[]}
http code content-type response 201
application/json
{"type":"change-mode","command":{"instruction":"rainbow balls", "args":[]}}
400
application/json
Error message
curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8888/action
POST
/action
(Pone las luces en modo arcoiris continuo)
type command "change-mode" {"instruction":"rainbow continuous","args":[]}
http code content-type response 201
application/json
{"type":"change-mode","command":{"instruction":"rainbow continuous", "args":[]}}
400
application/json
Error message
curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8888/action
POST
/action
(Pone las luces en modo color estático)
type command "change-mode" {"instruction":"static-color","args":["0xc1e1c1"]}
http code content-type response 201
application/json
{"type":"change-mode","command":{"instruction":"static-color", "args":["0xc1e1c1"]}}
400
application/json
Error message
curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8888/action