witnessmenow / Universal-Arduino-Telegram-Bot

Use Telegram on your Arduino (ESP8266 or Wifi-101 boards)
MIT License
1.09k stars 302 forks source link

Faster binary upload of picture #214

Open ambanmba opened 3 years ago

ambanmba commented 3 years ago

At the moment, the example for PhotoFromSD sends one byte at a time while others such as PhotoFromSerial send full buffers at a time.

I have created a sketch which pulls a still image from a CCTV camera and stores it in a LittleFS file and then sends it to Telegram. My sketch is modelled on PhotoFromSD and takes about 20 seconds to send the image to Telegram. By comparison the step to retrieve the image from the CCTV and store it in LittleFS takes about 6 seconds.

I'm wondering if the sketch was modelled on a PhotoFromSerial example if it would be faster. My skills aren't up to being able to adapt the PhotoFromSD example, but if PhotoFromSerial is a better approach, it would be good to refactor the PhotoFromSD example to use the same buffered approach.