Skip to content

meinside/scroll-daemon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go daemon for Pimoroni Scroll pHat

With this daemon, you can scroll strings on your Pimoroni Scroll pHat through command line or Telegram messages.

Install

$ go get -d github.com/meinside/scroll-daemon
$ go get github.com/meinside/scroll-daemon/cmd/scroll-cli

and build daemon:

$ cd $GOPATH/src/github.com/meinside/scroll-daemon
$ go build

Configuration

Config file

$ cd $GOPATH/src/github.com/meinside/scroll-daemon
$ cp config.json.sample config.json
$ vi config.json

and edit values to yours:

{
	"api_token": "0123456789:abcdefghijklmnopqrstuvwyz-x-0a1b2c3d4e",
	"local_port": 59991,
	"available_ids": [
		"telegram_id_1",
		"telegram_id_2",
		"telegram_id_3"
	],
	"phat_brightness": 5,
	"phat_scroll_delay": 75,
	"phat_rotate_180degrees": false,
	"telegram_monitor_interval": 1,
	"is_verbose": false
}

systemd

$ sudo cp systemd/scroll-daemon.service /lib/systemd/system/
$ sudo vi /lib/systemd/system/scroll-daemon.service

and edit User, Group, WorkingDirectory and ExecStart values.

It will launch automatically on boot with:

$ sudo systemctl enable scroll-daemon.service

and will start with:

$ sudo systemctl start scroll-daemon.service

Send messages/commands through Telegram

scroll_daemon_telegram

Send messages/commands through command line

# scroll current time
$ scroll-cli -t

# scroll ip addresses
$ scroll-cli -i

# scroll a long message
$ scroll-cli "show me the money $$$"
$ scroll-cli `uname -a`

License

MIT