I am using your library on ESP8266. email sender v2.4.2.
It takes long times for a JPG file to be sent. I set encode64 to TRUE otherwise it will not arrive properly and with many many artifacts.
The time it takes to send over wifi is very long, for example file sizes: QVGA=5.2K, 2 min, VGA=25K, ~6-8 min , SVGA=`35K , ~20min.
Do these long times make sense to you ? Is there any way to improve this ? If I am connected to wifi I would assume it would be much faster for such small files (single JPG).
Thank you for your reply. I am using an ESP8266 connected to a PIR-IR motion detector. Once motion is detected it triggers an ESP32-CAM to take a JPG picture which is stored on the ESP32-CAM SD card. This picture is then read from SD card by the ESP8266 and then sent by the ESP8266 over wifi with the email sender. I know this is a bit of an awkward way of doing things but the whole device is asleep until triggered by the PIR (works on 2xAA bats). In addition, the ESP32-CAM is very limited with the number of free GPIOs available so I have to store the pic on SD first.
I will have to rethink the whole thing. Maybe it makes more sense to connect the ESP32-CAM to WIFI and let the ESP32 do the encoding and sending over wifi, and not the ESP8266, to send the picture taken. Your thoughts ?
Hi Saillu,
I think, to do less change as possible you can do somethimg like this.
1. Save jpg.
2. Use second core of esp32 to generate a file already encoded in base64.
3. Send email with file encoded, but i must do a change to the library
Or use esp32 for all.
If u need help, write to the forum, and share your code.
Add the following two lines in the ESP32 code: `
size_t size = fb->len;
String buffer = base64::encode((uint8_t *) fb->buf, fb->len);
// fb->buf holds the data and fb->len is the buffer size `
and also add
#include base64.h
at beginning of file.
I set the encode64 in your library to “false” as the file is already encoded. As you said, you need to do a change in your library because the image received still has many artifacts.
I would imagine that if you make this change/update in your library it will serve many other users who are using your library as the file can then be transmitted already encoded and save a lot of time. Especially on battery powered devices like I use this transmission time saved is very valuable.
I used the branch version. Thank you for creating it! Everything compiles and works properly but I still get artifacts and unrecognizable image.
I looked a bit at your code at emailsender.cpp, line 99: const char* encode64_f(char* input, uint8_t len)
I forgot to mention it last time I wrote but the “buffer” I send is of type String and I think your code does not treat it as a string? I used this online tool https://www.base64decode.net/base64-image-decoder to print the base64 encoded string (image taken) and translate the string to an image to see that it is indeed encoded and can be decoded properly.
Sorry for my late reply. I finally got this to work. The issue was in my code in the way I handle the data written to file as string.
I can confirm that your code works perfectly and that the encoded file is displayed properly in Gmail. The time to transmit a pre-encoded file has been reduced significantly. For example, a 640×480 VGA frame that took before about 6 minutes now takes around 40-45 seconds. A 800×600 SVGA that took me before around 20 minutes now takes about a minute. I have not tested other resolutions.
45-60 seconds is still a lot of transmission time when on battery power but in my case I rarely transmit so it is not so bad and acceptable.
I think you can incorporate this into your main code branch so others can also enjoy this :-).
Hi Sailorman,
thanks to you for your feedback, I’m going to incorporate the features, so other can use It.
If you want write an article about your project we are happy to publish It.
Bye Renzo
Maintaining a repository (or site or forum) is a lot like tending to a garden - it requires constant care and attention to keep it thriving. If you're a skilled gardener (or coder!) and want to help keep our repository blooming, we'd love to have you on board! We're also looking for talented writers and forum moderators to help us grow our community. Interested in joining our team? Don't hesitate to reach out and let us know how you can contribute!
Are you a fan of electronics or programming? Share your knowledge with others, write a simple tutorial or how to make a great project Contact me: share_your_ideas@mischianti.org
The content displayed on this website is protected under a CC BY-NC-ND license. Visitors are prohibited from using, redistributing, or altering any content from this website for commercial purposes, including generating revenue through advertising. Any unauthorized use is a violation of the license terms and legal action may be taken against individuals or entities found to be in violation.
You must also provide the link to the source.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.