This application serves as a blackbox FTP and SMTP server specifically designed for Suntek trail cameras, but should work with other SIM-enabled cameras too. Its primary function is to forward the pictures uploaded by the cameras to a designated Telegram (personal or group) chat.
- FTP Server: The FTP server is designed to receive images from the trail cameras. However, it doesn't alter or store any files on the server. It simply acts as a conduit to receive the images and forward them to Telegram.
- SMTP Server: The SMTP server is implemented to make the camera believe it's interacting with a real email service. However, it doesn't send any emails. Its sole purpose is to receive the images from the camera and forward them to Telegram.
In essence, this application acts as a blackbox, mimicking the behavior of real FTP and SMTP servers to receive images from Suntek trail cameras and forward them to Telegram.
This software should work with all Suntek cameras that have SIM card for network connectivity and configured with MMSCONFIG
software. It can be found online. Google for MMSCONFIG
and you will find a few results from cnsuntek.com
.
On AliExpress there are handful of trail cameras to pick from. The one I purchased is Suntek HC900LTE
.
I am a bit too lazy to provide actual logs, but here is how communication works with FTP at first:
- Device connects to FTP server.
- Gets FTP os info.
- Sets current working directory to specified directory in camera's config.
- Switches to binary mode.
- Switches to passive mode and gets passive port from FTP server.
- Uploads file.
- Exits.
After 3-48 hours, the implementation breaks and it basically becomes steps 1-3 only. Looking at errors file (on sd card) it shows that it tries to upload, but getting error from modem command, which was translated by ChatGPT to be "FTP server not found". Also tried explicitly closing connection after each uploaded image and notifying FTP client that connection is closing prior that - nothing has worked. This sounds like firmware/software bug which cannot be fixed by me. As usually, Suntek support were almost clueless of what is FTP to begin with, so reaching out to them for assistance is out of question.
Initially this software was written for FTP functionality only, but after giving up with FTP, I decided to look into SMTP method and it worked just great!
Linux server with public IP and Docker.
Suggestions:
- If you have public IP at home - with some port forwarding and home server (such as RPI) you can easily host this application.
- Alternatively, feel free to purchase instance at your favorite cloud provider. I prefer
Linode
for their cheapest shared CPU instances.
FTP (at least with my camera) is broken and unusable, so I am stuck with SMTP. Basically decide which one you would like to use. Changing it is easy in this application's configuration, but might be difficult to change in camera (pull out SD card, generate config, upload config, insert SD card etc.)
Here is how configuration looks like:
APN is configured to your SIM provider (for mobile internet) and the rest points to your FTP server.
Here is how configuration looks like:
APN is configured to your SIM provider (for mobile internet) and the rest points to your SMTP server. Email Setting
needs to contain a single random email address.
Create config.yml
file out of config.example.yml
file.
Then create Telegram bot and add Telegram API Key as well as ChatID.
Then, if using FTP method:
- Ensure
ftp.enabled: true
. - Update
ftp.bind_host
andftp.bind_port
if needed. - Set
ftp.username
andftp.password
to match of what you configured in camera FTP configuration. - If needed, update
public_ip
andpassive_ports
fields too.
Or if using SMTP method:
- Ensure
smtp.enabled: true
. - Update
smtp.bind_host
andsmtp.bind_port
if needed. - Set
smtp.username
andsmtp.password
to match of what you configured in camera SMTP configuration.
services:
suntek2telegram:
image: ghcr.io/erkexzcx/suntek2telegram:latest
container_name: suntek2telegram
restart: always
volumes:
- ./suntek2telegram/config.yml:/config.yml
ports:
# You can use any TCP port for FTP or SMTP:
- 8123:8123/tcp
# Port range is only used for FTP PassivePorts functionality:
#- 4100-4199:4100-4199/tcp
See latest release.