https://github.com/rna3210d/rpi-telebot
Python based Telegram bot to monitor and control the Raspberry Pi
https://github.com/rna3210d/rpi-telebot
pi raspberry raspberry-pi raspberry-pi-3 raspberry-pi-4 raspberry-pi-iot raspberry-pi-zero raspberrypi rpi-telebot telegram-bot telegram-bot-api telegram-bots
Last synced: 8 months ago
JSON representation
Python based Telegram bot to monitor and control the Raspberry Pi
- Host: GitHub
- URL: https://github.com/rna3210d/rpi-telebot
- Owner: RNA3210d
- License: mit
- Created: 2020-06-28T09:45:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-30T06:54:48.000Z (over 2 years ago)
- Last Synced: 2024-10-11T02:02:21.267Z (12 months ago)
- Topics: pi, raspberry, raspberry-pi, raspberry-pi-3, raspberry-pi-4, raspberry-pi-iot, raspberry-pi-zero, raspberrypi, rpi-telebot, telegram-bot, telegram-bot-api, telegram-bots
- Language: Python
- Homepage:
- Size: 245 KB
- Stars: 23
- Watchers: 0
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# RPi-TELEBOT
Python based Telegram bot to monitor and control the headless Raspberry Pi servers.
## Setting up the bot
- Install telepot library for enabling the Raspberry Pi to communicate with the Telegram bot using the API.
```
sudo apt-get install python-pip
sudo pip install telepot
```
- Request the BotFather to create a new Bot.
- Paste the HTTP access token here (in the code):
```
bot = telepot.Bot(' Enter your Telegram bot API token here ')
```
- Run *gpiotel20.py* as sudo
- Try out the commands given below in the Telegram bot chat (see Usage section below)
- GPIO of led1 and led2 set as 5 and 10 respectively (BCM numbering).
## Commands:- help - List of commands
- ledon1 - Switch on LED 1
- ledoff1 - Switch off LED 1
- ledon2 - Switch on LED 2
- ledoff2 - Switch off LED 2
- cpu - Get CPU info (lscpu)
- usb - See connected USB devices (lsusb)
- hi - To check if online
- time - Returns time
- date - Returns date
- temp - CPU Temperature
- repoupdate - update repositories (sudo apt-get update)
- upgrade - upgrade packages (sudo apt-get upgrade -y)
- shutdown - Shutdown RPi (sudo shutdown -h now)
- reboot - Reboot RPi (sudo reboot)## Usage:
- Use ' / ' before each command
- Example: To check the CPU Temperature;
```
/temp
```
## Tips:
- See more about telegram bots here: https://core.telegram.org/bots
- As the /repoupdate and /upgrade takes time you can use /ledon1 or /ledon2 command to alert you when the process is complete.
- If you are running this script on boot [systemd users] , refer : https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
## Screenshots:

