https://github.com/popstas/pixel-server
Kapacitor alerting with RGB led and display controlled arduino or AnyBar
https://github.com/popstas/pixel-server
alerting anybar kapacitor
Last synced: about 2 months ago
JSON representation
Kapacitor alerting with RGB led and display controlled arduino or AnyBar
- Host: GitHub
- URL: https://github.com/popstas/pixel-server
- Owner: popstas
- License: mit
- Created: 2016-08-25T11:55:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-06T17:52:22.000Z (over 8 years ago)
- Last Synced: 2025-02-09T10:09:14.887Z (3 months ago)
- Topics: alerting, anybar, kapacitor
- Language: Go
- Homepage:
- Size: 434 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/popstas/pixel-server)
[](https://coveralls.io/github/popstas/pixel-server?branch=master)Server for send signals to [arduino pixel_meter](https://github.com/popstas/arduino-pixel-meter)
or [AnyBar](https://github.com/tonsky/AnyBar).
# Usage
- Start server, it will default listen at *:8246
- Send POST request to `/status` like this:
```
http -f POST http://localhost:8080/status value=50 message='first string\\second string' blink=2
```
- Or configure your [Kapacitor](https://github.com/influxdata/kapacitor) to `/kapacitor` like this:
```
data
|alert()
.post('http://localhost:8246/kapacitor')
```# Configure server
### Command-line parameters
```
pixel-server \
--web-host="" \
--web-port=8246 \
--serial-port=COM3 \
--serial-speed=9600
--anybar-port=1738
--brightness=100
```### Environment variables
```
PIXEL_SERVER_SERIAL_PORT=COM3 \
PIXEL_SERVER_SERIAL_SPEED=9600 \
PIXEL_SERVER_WEB_HOST= \
PIXEL_SERVER_WEB_PORT=8246 \
PIXEL_SERVER_ANYBAR_PORT=1738 \
PIXEL_SERVER_BRIGHTNESS=100 \
pixel-server
```Command-line parameters has priority over environment variables.
### Request parameters for /status
- `value` - value of signal, required,
0 to 100 (red to green),
-1 for off led
- `message` - message for 16x2 display, lines should be splitted with \ symbol, default no message
- `blink` - blink state, default 0,
0 for not blinking,
1 for blink 3 times and back to previous state,
2 for persistent blinking
- `brightness` - led brightness, 0 to 100, default 100Examples:
```
http -f POST http://localhost:8246/status value=50
```## Behaviour
If status changes from red to green, will be used smooth color change.
If status changes from green to red, color will changed with blinking with last color.