Cameras
An ESP32 camera board sends pictures and live view to the console's Image and Video widgets over its own cloud connection: nothing to open on the router, viewable from anywhere.
Boards
AI Thinker ESP32-CAM, ESP32-S3-EYE, XIAO ESP32S3 Sense, ESP-EYE and M5Stack Camera, all with PSRAM. The camera driver comes with the ESP32 core; no other library is needed. Start from the 06.Camera/Camera example and pick your board in its camera_pins.h.
Partition scheme
In the Arduino IDE choose Tools > Partition Scheme > Minimal SPIFFS (1.9MB APP with OTA). The board's default leaves no room for remote updates.
Send a picture
sendImage() sends one JPEG straight from the camera's buffer, up to 200 KB. It returns false while offline: pictures are not queued, because the next one replaces them anyway.
camera_fb_t* fb = esp_camera_fb_get();
if (fb) {
MaxwellTrack.sendImage(fb->buf, fb->len);
esp_camera_fb_return(fb);
}Answer the console
The console asks for pictures only when someone needs them. onCameraRequest() is called with live = true while someone has a Video widget open (send small pictures as fast as the connection allows for seconds; the request repeats while they watch), and with live = false when someone presses Take picture (send one now).
unsigned long liveUntil = 0;
bool pictureWanted = true;
void onCameraRequest(bool live, unsigned int seconds) {
if (live) liveUntil = millis() + seconds * 1000UL;
else pictureWanted = true;
}
void setup() {
startCamera(); // from the example
MaxwellTrack.onCameraRequest(onCameraRequest);
MaxwellTrack.begin(DEVICE_ID, AUTH_TOKEN, WIFI_SSID, WIFI_PASS);
}In the console
Add an Image or Video widget to the device's dashboard and choose This device's camera as the source. Image shows the kept pictures, newest first, with Take picture; Video shows live view while it is on screen and stops by itself shortly after it is closed. Pictures are shown only to people with access to the device, and are deleted with it.
Something unclear or out of date on this page? Tell support.
