-
Notifications
You must be signed in to change notification settings - Fork 7.6k
no OTA example works for AI Thinker ESP32-CAM (wrong partition table?) #6114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
i think the partition table settings for that AI Thinker ESP32-CAM board in arduino esp32 is not compatible for OTA skeches. WORKAROUND:
after a new start of Arduino IDE i now have an additional entry in the ESP boards list with the name: "AI Thinker ESP32-CAM (for OTA)". i don't know if it is the right way, if |
The AI-Thinker ESP32-CAM board definition described in the esp32cam.name=AI Thinker ESP32-CAM
esp32cam.upload.tool=esptool_py
esp32cam.upload.maximum_size=3145728
esp32cam.upload.maximum_data_size=327680
esp32cam.upload.flags=
esp32cam.upload.extra_flags=
esp32cam.upload.speed=460800
esp32cam.serial.disableDTR=true
esp32cam.serial.disableRTS=true
esp32cam.build.tarch=xtensa
esp32cam.build.bootloader_addr=0x1000
esp32cam.build.target=esp32
esp32cam.build.mcu=esp32
esp32cam.build.core=esp32
esp32cam.build.variant=esp32
esp32cam.build.board=ESP32_DEV
esp32cam.build.flash_size=4MB
esp32cam.build.partitions=default
esp32cam.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw
esp32cam.build.extra_libs=
esp32cam.build.code_debug=0
esp32cam.menu.PartitionScheme.default=Default(3MB No OTA/1MB SPIFFS)
esp32cam.menu.PartitionScheme.default.build.partitions=huge_app
esp32cam.menu.PartitionScheme.default.upload.maximum_size=3145728
esp32cam.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
esp32cam.menu.PartitionScheme.no_ota.build.partitions=no_ota
esp32cam.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
esp32cam.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
esp32cam.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
esp32cam.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
esp32cam.menu.CPUFreq.240=240MHz (WiFi/BT)
esp32cam.menu.CPUFreq.240.build.f_cpu=240000000L
esp32cam.menu.CPUFreq.160=160MHz (WiFi/BT)
esp32cam.menu.CPUFreq.160.build.f_cpu=160000000L
esp32cam.menu.CPUFreq.80=80MHz (WiFi/BT)
esp32cam.menu.CPUFreq.80.build.f_cpu=80000000L
esp32cam.menu.CPUFreq.40=40MHz (40MHz XTAL)
esp32cam.menu.CPUFreq.40.build.f_cpu=40000000L
esp32cam.menu.CPUFreq.26=26MHz (26MHz XTAL)
esp32cam.menu.CPUFreq.26.build.f_cpu=26000000L
esp32cam.menu.CPUFreq.20=20MHz (40MHz XTAL)
esp32cam.menu.CPUFreq.20.build.f_cpu=20000000L
esp32cam.menu.CPUFreq.13=13MHz (26MHz XTAL)
esp32cam.menu.CPUFreq.13.build.f_cpu=13000000L
esp32cam.menu.CPUFreq.10=10MHz (40MHz XTAL)
esp32cam.menu.CPUFreq.10.build.f_cpu=10000000L
esp32cam.menu.FlashMode.qio=QIO
esp32cam.menu.FlashMode.qio.build.flash_mode=dio
esp32cam.menu.FlashMode.qio.build.boot=qio
esp32cam.menu.FlashMode.dio=DIO
esp32cam.menu.FlashMode.dio.build.flash_mode=dio
esp32cam.menu.FlashMode.dio.build.boot=dio
esp32cam.menu.FlashMode.qout=QOUT
esp32cam.menu.FlashMode.qout.build.flash_mode=dout
esp32cam.menu.FlashMode.qout.build.boot=qout
esp32cam.menu.FlashMode.dout=DOUT
esp32cam.menu.FlashMode.dout.build.flash_mode=dout
esp32cam.menu.FlashMode.dout.build.boot=dout
esp32cam.menu.FlashFreq.80=80MHz
esp32cam.menu.FlashFreq.80.build.flash_freq=80m
esp32cam.menu.FlashFreq.40=40MHz
esp32cam.menu.FlashFreq.40.build.flash_freq=40m With this fix, the Tool menu in the Arduino IDE will show the partition table available for the OTA. |
Using PlatformIO, I managed to do OTA on this board by specifying the right partition. In
In
|
The AI-THINKER board definition in the IDE is most definitely not OTA compatible and offers no partition scheme selection. I have an OTA compatible fork of the standard webcam sketch and have documented the relevant settings here: https://github.com/easytarget/esp32-cam-webserver#programming |
Hello, can you please retest this on v2.0.3-rc1? |
any news? |
sorry for my late response, i couldn't try it yet. |
Take a look on installing guide please. https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html |
Ok; this appears to be resolved, in the boards manager for 2.0.3 release the I tested this by selecting the board + ota partition (minimal spiffs) used for my sketch and flashing the 'BasicOTA' example over it (over the air), then re-flashing my sketch back over the example (again, over the air). I also checked the boards definition in the 2.0.3 package's This is easy enough to document for my projects users, I consider it closed, thankyou. |
Here's the only working OTA for this board I've seen: https://github.com/wjsanek/wjsanek They're cleverly using the unused OTA partition as the SPIFFS for the camera data, which is how and why it can work. |
Also if using the right partition for OTA usage I found out, that the ESP32-CAM board is rebooting on firmware update, if the frame buffer for big pictures is configured like: config.fb_count = 2; |
what is your or it may have someting to do with the restrictions |
when fb_count is more than 1 and you have set |
@me-no-dev , i just stumbled over this condition in the esp32-camera/driver/cam_hal.c code: esp_err_t cam_config(const camera_config_t *config, framesize_t frame_size, uint16_t sensor_pid)
{
...
#if CONFIG_IDF_TARGET_ESP32
cam_obj->psram_mode = false;
#else
cam_obj->psram_mode = (config->xclk_freq_hz == 16000000);
#endif
... does it mean, when the target is ESP32, psram is not used at all, or is that something totally different? |
@beta-tester: I used the basis from the ESP32 Camera example: CameraWebServer.
As the ESP32-CAM uses PSRAM psramFound() should be true and so
is the used cobfiguration. @me-no-dev: ESP32-CAM only used ESP32, not S3. And if DMA+ISR is always triggered in case of buffer frames >1 I do not understand, why PSRAM is disturbing the OTA, which in my understanding is happening in the DRAM? |
This is a different thing. It allows direct write from DMA to PSRAM on S2 and S3 (not recommended, but supported). All chips do support PSRAM otherwise.
OTA writes to Flash, so not only DRAM used there :) |
Just for the record, if you are using arduino-cli it is possible to also get the correct partition table configured without editing any config files:
|
Board
AI Thinker ESP32-CAM
Device Description
Hardware Configuration
Version
latest master
(2.0.2)
IDE Name
Arduino IDE 1.8.19 (Linux 64 bits)
Arduino IDE 1.8.19 (Linux ARM 32 bits)
Operating System
Ubuntu 21.10 (64bit)
RasPi OS Buster / Bullseye (32bit)
Description
i can successfully update my ESP32 Dev Modules via OTA by using the example sketches:
WebUpdate.ino
andhttpUpdate.ino
.but when i switch the Arduino IDE to AI Thinker ESP32-CAM and compile the sketches for that and flash it to the Ai Thinker ESP32-CAM (compatible) modules and try to update the device via OTA it crashes. with
Sketch
/libraries/ArduinoOTA/examples/OTAWebUpdater/OTAWebUpdater.ino
/libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino
/libraries/WebServer/examples/WebUpdate/WebUpdate.ino
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: