Setting Up A Telegram-Based Camera Surveillance System
Telegram bots paired with inexpensive camera hardware have become a genuinely useful surveillance tool in my work. I've deployed dozens of these setups for small business monitoring, rental property checks, and remote equipment observation. The approach is straightforward once you understand the pieces involved. The core concept involves connecting a camera device to a Telegram bot so that when motion is detected, or on a scheduled interval, the bot pushes video clips or photos directly to your phone. The hardware side typically runs on an ESP32-CAM module, a Raspberry Pi with a camera hat, or even a repurposed Android phone running a dedicated app. The software side lives in Telegram's BotFather API. Here is how the actual setup works from a technical standpoint.
First, you create a bot through @BotFather on Telegram. You get an API token that authorizes your device to send messages and media. Then you configure the camera hardware. For an ESP32-CAM, you upload firmware like ESP32-CAM-Mqtt or a custom sketch that captures images and forwards them via HTTP POST to the Telegram bot API endpoint. A typical request looks like sending the image file to https://api.telegram.org/bot
For the Telegram side, you need to handle rate limits carefully. Telegram restricts bots to about 30 messages per second globally, which is rarely a bottleneck for a single camera setup, but if you manage multiple cameras across locations, you should queue messages through a delay mechanism rather than firing them all simultaneously. I use a simple Redis queue with a 2-second delay between sends. It prevents temporary ban flags and keeps the feed readable. One practical detail most guides skip: storing footage. Telegram is not a cloud storage service for video. Messages with media expire or get buried quickly. You should pipe the camera output to local storage on the device and only use Telegram for alerts. I have a secondary script that zips older video clips and uploads them to a local NAS or S3 bucket after 24 hours, then deletes the Telegram media after syncing to prevent storage bloat on Telegram's servers. I encountered a specific edge case last year that illustrates why planning matters. I had a camera setup in a storage unit using an ESP32-CAM with WiFi. The device would connect fine, capture images, and send them. But after about three days, the bot stopped receiving new messages. The issue was that Telegram's Bot API returns a 429 error when you exceed their flood control limits, and the firmware I was using did not handle retries. The workaround was adding an exponential backoff retry loop with a maximum of five attempts before dropping the message and logging it locally. I also added a watchdog timer that resets the ESP32 every 48 hours to clear memory leaks, which are common in these low-memory devices. After implementing that, the uptime went from roughly 72 hours to over 30 days between physical resets.
Get the Full Details

Another counter-intuitive point: using Telegram for alerts is fast, but it is not encrypted end-to-end for your surveillance data in the way you might assume. The connection between your camera and Telegram's servers uses Telegram's standard encryption, but once the message reaches your device, it is stored on Telegram's infrastructure according to their retention policies. If you are monitoring anything involving private spaces or sensitive information, you should pair this with local-only storage and treat Telegram purely as an alerting channel, not a evidence repository. For people who want a ready-made software solution instead of building from scratch, there are established projects. CamBot for Android turns a phone into a Telegram-connected camera with motion detection and night mode. Esp32CamMqtt is the most common firmware for ESP32-CAM boards. On the Raspberry Pi side, mjpg-streamer combined with a Telegram bot script handles RTSP-to-Telegram routing. These projects are available through their respective GitHub repositories and community documentation. The cost breakdown for a basic single-camera setup runs about $12 to $18 for the ESP32-CAM board, a micro SD card for local storage, and a 5V power supply. A Raspberry Pi Zero 2 W with a camera module runs closer to $45 total. An old Android phone costs nothing if you already have one lying around. Monthly costs are zero since Telegram does not charge for bot usage within reasonable limits.
Legal considerations matter here. In many jurisdictions, recording audio in private spaces without consent is illegal regardless of whether the device is Wi-Fi connected or not. Video recording in areas where there is a reasonable expectation of privacy, such as bathrooms or bedrooms, carries similar restrictions. I have seen people get in real trouble because they assumed a hobby project was legally harmless. Always check your local wiretapping and surveillance laws before deploying any camera, especially in residential or shared living situations. Performance limitations are worth noting. ESP32-CAM boards max out around 720p resolution at 15fps, which is adequate for identifying faces at close range but insufficient for detailed license plate recognition or wide-area monitoring. The processing power is also limited, so advanced analytics like facial recognition or object classification will either lag or require offloading to an external server. If you need those capabilities, a proper IP camera with onboard processing or a NVR system is the better investment, even though it costs more upfront. The battery life on repurposed phone setups varies enormously depending on screen-off settings, motion detection frequency, and network signal strength. In my testing, a phone with aggressive Doze mode and 30-second motion check intervals lasted roughly 4 to 6 days on a full charge when transmitting photos. Continuous streaming drains the battery in under 8 hours. Using a USB power adapter eliminates this variable entirely, which is why hardwired installations are the default for anything meant to run long-term.
If you are just starting out, I would recommend beginning with an ESP32-CAM and the Esp32CamMqtt firmware. It has the most documentation, the simplest setup process, and a working Telegram integration out of the box. Flash the firmware, configure your WiFi credentials and Telegram bot token in the config file, upload it, and you should have your first alert within 10 minutes. From there you can iterate toward more complex multi-camera setups as your needs grow.
