Skip to content

Releases: nexesninja/raspberrypi-telegram-bot

Version 2.0

09 Jul 14:35
059fd4a
Compare
Choose a tag to compare

📦 Release v2.0 – Major Refactor & Feature Expansion

Date: 2025-07-08

A major update of the Raspberry Pi Telegram Bot with a modular codebase, enhanced security, system monitoring, and robust remote command support.


✨ Features

  • 🔒 Secure Command Execution
    Whitelisted command execution with validation, pattern checks, and sandboxing.

  • 🌡️ Temperature Monitoring
    Real-time CPU temperature display with alert capability.

  • 📊 System Monitoring
    View CPU, memory, and disk usage via /system and /status.

  • 💻 Remote Shell Execution
    Run allowed commands on your Pi from Telegram using /cmd <command>.

  • 🤖 PTB v20+ Support
    Upgraded to python-telegram-bot v20 with ApplicationBuilder and JobQueue.

  • 🗂️ Modular Structure
    Code split into config/, modules/, and clean main.py entry point.


🧭 Setup Instructions

📄 Key files and documentation:

  • README.md – Full usage, commands, and structure
  • docs/installation_guide.md – Step-by-step setup
  • docs/initial_setup.txt – What you need before installation
  • docs/troubleshooting.md – Common errors and fixes

🛡 Security Improvements

  • ✅ Only safe, whitelisted commands can run
  • ❌ Blocks dangerous patterns like rm -rf /, mkfs, dd, etc.
  • ⏱ Built-in timeout handling and safe working directory

📁 Project Structure

raspberrypi-telegram-bot/
├── config/
│ └── config.py
├── docs/
│ ├── installation_guide.md
│ ├── initial_setup.txt
│ └── troubleshooting.md
├── logs/
│ └── bot.log
├── modules/
│ ├── command_executor.py
│ ├── system_monitor.py
│ └── temp_monitor.py
├── .gitignore
├── CHANGELOG.md
├── main.py
└── pi-telegram-bot.service


💬 Commands

  • /temp – Show temperature
  • /system – System resource summary
  • /cmd <command> – Run a safe command
  • /help – List available commands

⚠ Known Notes

  • Bot has a slight startup delay (~30–60 seconds) after reboot for network readiness

📥 Feedback & Issues

Have questions, feature ideas, or bugs to report?
👉 Open an issue on GitHub

Version 1.0.1

15 May 06:52
f003220
Compare
Choose a tag to compare

📦 Release v1.0.1 – Improved Boot Stability & Bot Resilience

This release introduces key fixes and improvements to ensure the Raspberry Pi Telegram bot starts reliably after a reboot and handles early network issues gracefully.


Improvements

  • Enhanced systemd service file

    • Added network-online.target to ensure the bot starts only after the network is ready.
    • Introduced ExecStartPre=/bin/sleep 30 to provide additional boot delay for stability.
    • Updated Restart policy to on-failure with a RestartSec=60 wait time.
  • Improved Python bot script

    • Replaced asyncio.run() with native application.run_polling() to fix event loop issues.
    • Added retry mechanism using time.sleep() for better resilience on slow network startup.
    • Enhanced logging for easier debugging and monitoring.

Fixes

  • Fixed Cannot close a running event loop crash during boot.
  • The bot now consistently initializes on Raspberry Pi startup.

Updated Files

  • temp.service (Systemd service file)
  • temp.py (Main Telegram bot script)

Note: There's an initial delay of 1 minute until the bot starts after booting rpi.

💬 Let us know if you face any issues or suggestions by opening an issue on GitHub.

Version 1.0

06 May 08:50
723b407
Compare
Choose a tag to compare

📦 Release v1.0.0 – Initial Stable Release

First official release of the Raspberry Pi 5 Telegram Bot!

Features:

  • 🌡️ Temperature Monitoring
  • 📊 System Monitoring (coming soon)
  • 💻 Remote Command Execution (planned)
  • 🔒 SSH-based Setup

Setup Instructions:

  • README.md for full setup
  • docs/Prerequisites.md
  • docs/TemperatureMonitoring.md

Roadmap:

  • Temperature monitoring
  • CPU & memory usage display
  • Custom shell command execution
  • Error logging and bot resilience

How to Use:

  • /temp → View system temperature
  • /help → Get help message

Known Issues:

  • Manual token editing required in and systemd service file
  • No error handling yet for failed commands or bot disconnections