Skip to content

lug-tw/hexbase-telegram-door-bot

Repository files navigation

HEXBASE telegram door bot

A telegram bot for the roll-up door of HexBase.

img

Available commands

command note
/ping life check
/up scroll up
/down scroll down
/stop stop scrolling

Synopsis

  • Prepare hardware.
  • Install python and go (>=1.5)
  • Build binary.
  • Prepare telegram bot token, put it into a file.
  • python daemon.py
  • hexbase-telegram-door-bot -k 10_bytes_hexdecimal_string_as_secret_key -t your_token_file

Installation

# clone the repo
mkdir ~/dev && cd dev
git clone https://github.com/lug-tw/hexbase-telegram-door-bot.git
cd hexbase-telegram-door-bot/systemd


# change path to /home/pi/dev/hexbase-telegram-door-bot
vim  doorctl.service
vim doorctl_systemd.sh


# install systemd service
cp doorctl.service .config/systemd/user/
systemctl --user enable doorctl
systemctl --user start doorctl

Contribute

Go part

# setup go env and download goimports
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
which goimports || go install golang.org/x/tools/cmd/goimports

# fetch latest code
go get -u -d github.com/lug-tw/hexbase-telegram-door-bot

# hack, hack, hack
cd $GOPATH/src/github.com/lug-tw/hexbase-telegram-door-bot
your_favorite_editor bot.go

# reformat the code, build and upload
goimports -w bot.go

# cross compile to Raspberry Pi architecture
GOARCH=arm go build -a

Python

# install flake8 syntax checker
sudo pacman -S flake8

# hack, hack, hack
your_favorite_editor daemon.py

# run syntax check
flake8 daemon.py

Testing

# launch python daemon
python daemon.py &

socat - UNIX-CONNECT:/tmp/doorctl

Circuit design

img

Hardware

img

img

previous prototype

  • Our Raspberry Pi and the bread board

img

img

About

Hexbase telegram door bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •