Raspberry Pi Telegram Remote Control Bot
- Raspberry Pi
- Servo
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install npm
Follow Pi Blaster library install instructions:
$ cd
$ git clone https://github.com/sarfata/pi-blaster.git
$ cd pi-blaster
$ ./autogen.sh
$ ./configure
Patch file pi-blaster.c
before compile to set 50Hz servo frequency:
#define CYCLE_TIME_US 20000
$ make
$ sudo make install
$ cd
$ mkdir projects && cd projects
$ git clone https://github.com/DirectX/gatepass.git
$ cd gatepass
$ cp .env.example .env
Replace <BOT_KEY>
placeholder in .env
with actual Telegram API key obtained using @BotFather
$ npm install
$ npm start
$ sudo nano /etc/systemd/system/gatepass.service
[Unit]
Description=GatePass
After=network.target
[Service]
WorkingDirectory=/home/pi/projects/gatepass
ExecStart=/usr/bin/npm start
Restart=on-failure
User=pi
[Install]
WantedBy=multi-user.target
$ sudo service gatepass start
$ sudo systemctl enable gatepass.service
$ sudo service gatepass status
● gatepass.service - GatePass
Loaded: loaded (/etc/systemd/system/gatepass.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2019-07-02 20:03:46 UTC; 1s ago
Main PID: 3345 (node)
Tasks: 6 (limit: 2200)
Memory: 5.2M
CGroup: /system.slice/gatepass.service
└─3345 node /usr/bin/npm start