Skip to content
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

/update doesn't work on a ESP32cam board #100

Open
alport opened this issue Nov 18, 2022 · 9 comments
Open

/update doesn't work on a ESP32cam board #100

alport opened this issue Nov 18, 2022 · 9 comments

Comments

@alport
Copy link

alport commented Nov 18, 2022

I am trying to upload the LED .bin file via the OTA on a ESP32-CAM board using:
https://randomnerdtutorials.com/esp32-ota-over-the-air-arduino/

Problem is that when I try to browse to the IP: 192.168.0.114/update after a little delay, I just get a blank screen – ie no web page.
However, when I browse to 192.168.0.114 I get the expected: “I am ESP32”.
Could be a problem unique to the ESP32cam board.
I have tried updating via OTA and /update using the same program on a standard ESP32 - and it works with no problem.
Can anyone point me in the right direction?

@KeithHanson
Copy link

KeithHanson commented Jan 30, 2023

Hm. Can confirm, I'm having issues as well.

I've managed to capture this log if it seems useful to anyone:

update:24          POST http://192.168.1.36/update net::ERR_CONNECTION_RESET
(anonymous) @ update:24
Promise.then (async)
uploadOTA @ update:24
re @ update:24
r @ update:24
Ko.i._wrapper @ update:24

After which, the device resets. The firmware is exported from Arduino 1.8.19 (sketch -> export as compiled binary) and is 1mb. Am I running out of space, perhaps?

I am also making my own use of ArduinoWebsockets. Other than that, it's a pretty vanilla espcam project.

@KeithHanson
Copy link

Digging into this, it looks like it's due to the partition scheme not having enough space for the incoming firmware.

Haven't gotten any of the options in the Arduino IDE to work, though with ElegantOTA. Will report back if I've solved it.

@KeithHanson
Copy link

Once I set any partition scheme to something with OTA, and try to upload ElegantOTA's demo, all things work.

Once I go back to my own code, something breaks. Whittling down my libraries to try to figure it out.

Currently, I do notice my app being 1mb (reported by Arduino).

@KeithHanson
Copy link

Another user reporting similar feedback here: #89

@KeithHanson
Copy link

I have tried so many different configurations now of OTA partitions. Default sketch for ElegantOTA works over many different versions of partition layouts.

Once I add in my libraries, things fail:

#include "WiFi.h"
#include "esp_camera.h"
#include "esp_timer.h"
#include "img_converters.h"
#include "Arduino.h"
#include "soc/soc.h"           // Disable brownour problems
#include "soc/rtc_cntl_reg.h"  // Disable brownour problems
#include "driver/rtc_io.h"

#include <ArduinoWebsockets.h>

#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <AsyncElegantOTA.h>

Going to try and whittle down which library it is next.

@KeithHanson
Copy link

Whelp. After wrestling with this all day, I just decided to abandon the current arduino project, start from scratch.

In Arduino 1.8.19, using the github master zip downloads for all required libraries, I'm able to successfully:

  1. Take a picture
  2. Upload it over websocket to my server
  3. Wait for a predetermined amount of time
  4. Deep sleep for a predetermined amount of time

While waiting to sleep, the ElegantOTA works perfectly.

My settings are obvious:

Board: Ai Thinker ESP32-CAM
Partition Scheme: Minimal SPIFFS

I'm pretty much at a loss as to what was happening before, but a fresh Arduino project fixed it for me.

@sopek777
Copy link

sopek777 commented Feb 19, 2023

Тоже столкнулся с такой проблемой на esp8266. Сразу после загрузки esp страница ip/update работает. Потом, через некоторое время не загружается. Может пройти час, а может и несколько дней беспрерывной работы esp чтобы вылезла эта проблема

@De-Backer
Copy link

hello everyone, after having problems with it yesterday it seems to be the partitions.
this did work with "partitions = default.csv"

https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/default.csv

PlatformIO.ini
[env:esp32cam] platform = espressif32 board = esp32cam framework = arduino monitor_speed = 115200 board_build.partitions = default.csv lib_deps = ayushsharma82/AsyncElegantOTA ottowinter/ESPAsyncWebServer-esphome

by default this is huge_app.csv in platformio
see:
https://github.com/platformio/platform-espressif32/blob/master/boards/esp32cam.json

i hope this helps.

@mathieucarbou
Copy link

mathieucarbou commented Dec 25, 2023

This is already in the official Expressif doc. Whatever system is used for OTA (Arduino OTA, ElegantOTA or anything else), it requires that the partitions are correctly set. This is unrelated to how ElegantOTA is working but is related to how the Update feature works in Expressif / Arduino.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/ota.html

The OTA update mechanism allows a device to update itself based on data received while the normal firmware is running (for example, over Wi-Fi or Bluetooth.)

OTA requires configuring the Partition Tables of the device with at least two OTA app slot partitions (i.e., ota_0 and ota_1) and an OTA Data Partition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants