I am trying code from this tutorial ESP32-CAM Take Photo and Display in Web Server | Random Nerd Tutorials which works for me.
I want to slightly modify this so image get pushed to MQTT.
For this I trying to conver image into base64
.
.
#include <base64.h>
.
.
String encoded = base64::encode(fb->buf);
Serial.println(encoded);
For this I get compile error
esp32-cam-mqtt.ino: In function 'void capturePhotoSaveSpiffs()':
esp32-cam-mqtt:232:43: error: invalid user-defined conversion from 'uint8_t* {aka unsigned char*}' to 'const String&' [-fpermissive]
String encoded = base64::encode(fb->buf);
This works fine
String toEncode = "Hello World";
String encoded = base64::encode(toEncode);
Serial.println(encoded);
How do I get the image in a string format which I can convert to base64 ?