Exit status 1 Compilation error: exit status 1

c:\Users\Mo7a.W\Documents\Arduino\libraries\ArduinoIoTCloud-master\src\ota\implementation\OTAEsp32.cpp: In member function 'virtual void ESP32OTACloudProcess::calculateSHA256(SHA256&)':
c:\Users\Mo7a.W\Documents\Arduino\libraries\ArduinoIoTCloud-master\src\ota\implementation\OTAEsp32.cpp:91:13: error: 'SPI_FLASH_SEC_SIZE' was not declared in this scope; did you mean 'SPI_FLASH_BLOCK_SIZE'?
   91 |   uint8_t b[SPI_FLASH_SEC_SIZE];
      |             ^~~~~~~~~~~~~~~~~~
      |             SPI_FLASH_BLOCK_SIZE
c:\Users\Mo7a.W\Documents\Arduino\libraries\ArduinoIoTCloud-master\src\ota\implementation\OTAEsp32.cpp:101:55: error: 'b' was not declared in this scope
  101 |     if (!ESP.flashRead(a, reinterpret_cast<uint32_t*>(b), (read_size + 3) & ~3)) {
      |                                                       ^
c:\Users\Mo7a.W\Documents\Arduino\libraries\ArduinoIoTCloud-master\src\ota\implementation\OTAEsp32.cpp:105:24: error: 'b' was not declared in this scope
  105 |     sha256_calc.update(b, read_size);
      |                        ^
Multiple libraries were found for "WiFi.h"
  Used: C:\Users\Mo7a.W\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0\libraries\WiFi
  Not used: C:\Users\Mo7a.W\Documents\Arduino\libraries\WiFiNINA
exit status 1

Compilation error: exit status 1

Hi @moha117.

Explanation

The developers of the "esp32" boards platform made some significant changes in the recent 3.0.0 release. One of these changes broke the "ArduinoIoTCloud" library.

The "ArduinoIoTCloud" library developer has already prepared a fix for the bug:

Resolution

Since I see you are already using a beta tester version of the "ArduinoIoTCloud" library, the solution I will suggest is to use the beta tester version of the library that has that fix. If you would prefer to continue to use the version of the library you have installed now, let me know and I'll provide an alternative solution.

I'll provide instructions you can follow to install the version of the library with the fix:

  1. Select File > Quit from the Arduino IDE menus if it is running.
    All Arduino IDE windows will close.
  2. Delete the folder containing your existing installation of the "ArduinoIoTCloud" library at this path on your hard drive:
    c:\Users\Mo7a.W\Documents\Arduino\libraries\ArduinoIoTCloud-master\
    
    :warning: Please be careful when deleting things from your computer. When in doubt, back up!
  3. Click the following link to open the GitHub repository homepage for the version of the library with the fix in your web browser:
    https://github.com/pennam/ArduinoIoTCloud/tree/esp32-3.0.0
  4. Click the "Code ▾" button you see on that page.
  5. Select Download ZIP from the menu.
    A download of the ZIP file of the library will start.
  6. Wait for the download to finish.
  7. Start Arduino IDE.
  8. Select Sketch > Include library > Add .ZIP Library from the Arduino IDE menus.
    The "Select the zip file containing the library you'd like to add" dialog will open.
  9. Select the downloaded file from the dialog.
  10. Click the "Open" button.
    The dialog will close.
  11. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    ⓘ Successfully installed library from ...

Now try compiling or uploading your sketch again. The error should no longer occur and everything should work as expected.


Please let me know if you have any questions or problems while following those instructions.

2 Likes

Thank you very much, the error has disappeared :slightly_smiling_face:

You are welcome. I'm glad it is working now.

Regards,
Per

Thanks for the solution. Happened to me when i updated to ArduinoIoTCloud 2.0.1 automatically by the ArduinoIDE (never installed a Beta version) I think this bug went into production