-->
Page 1 of 2

[Found] OTA : begin Failed

PostPosted: Tue Jun 12, 2018 4:28 pm
by destroyedlolo
Hello,

I'm doing some test with OTA but when I'm trying to upload a new sketch, I got
Booting
Ready
IP address: 192.168.0.216
Error[1]: Begin Failed


I'm using Arduino IDE 1.8.5 under gentoo/linux.

What should be the cause of this error and how can I solve it ?

Thanks

Re: OTA : begin Failed

PostPosted: Wed Jun 13, 2018 2:05 am
by Pablo2048
Probably is Windows firewall blocking outgoing invitation from IDE to ESP module.
Edit: My bad - I overlooked Linux :-( . So my suggestion - try to check if something is blocking outgoing connection...

Re: OTA : begin Failed

PostPosted: Wed Jun 13, 2018 2:27 am
by QuickFix
A wise man once said:
schufti wrote:the modern plague: the less information they provide, the more answers they expect ...

Please give as much information as you can: setup, script, used power supply, pictures (we love pictures), things you've tried yourself, what are your expectations and what are the results, etc. etc. :idea:
Anything remotely interesting could be relevant.

Re: OTA : begin Failed

PostPosted: Wed Jun 13, 2018 2:31 pm
by destroyedlolo
Hi Pablo,

There is no firewall on my Linux and both the ESP and my PC are on the same network. So I don't think there is anything that can block.

Hi QuickFix,
QuickFix wrote:Please give as much information as you can: setup, script, used power supply, pictures (we love pictures), things you've tried yourself, what are your expectations and what are the results, etc. etc. :idea:
Anything remotely interesting could be relevant.

I duno which additional information I can provide :
  • I installed BasicOTA (with my own network settings obviously) on an ESP-201
  • When I boot it, I can see from it's serial console it's connecting and get an IP address.
  • A new port is created on my Linux box's IDE 1.8.5
  • the IDE successfully connect to this port as the transfer is initiated ... but I got the "Error[1]: Begin Failed" error on ESP's console.
  • it's the same power supply I'm using to burn on ESP all my project without any error and I've put a 470uF capacitor close to ESP power pins
  • Sadly, I don't have any photo by hand but a nice video (unfortunately without any relationship with my issue) of my hens ;) .

Anyway, I've tied to trace this error on library's code : it's raising from ArduinoOTA.cpp's
Code: Select allvoid ArduinoOTAClass::_runUpdate() {
  if (!Update.begin(_size, _cmd)) {
#ifdef OTA_DEBUG
    OTA_DEBUG.println("Update Begin Error");
#endif
    if (_error_callback) {
      _error_callback(OTA_BEGIN_ERROR);
    }
...


And as per Updater.cpp, Error[1] means "Flash Write Failed" which come from
Code: Select allbool UpdaterClass::_writeBuffer(){

  if(!_async) yield();
  bool result = ESP.flashEraseSector(_currentAddress/FLASH_SECTOR_SIZE);
  if(!_async) yield();
  if (result) {
      result = ESP.flashWrite(_currentAddress, (uint32_t*) _buffer, _bufferLen);
  }
  if(!_async) yield();

  if (!result) {
    _error = UPDATE_ERROR_WRITE;
    _currentAddress = (_startAddress + _size);
#ifdef DEBUG_UPDATER
    printError(DEBUG_UPDATER);
#endif
    return false;
  }


Investigation still on going ...