I think I've broken the Web editor

Hi, I think I've managed to somehow break the web editor so it no longer compiles, even with previously fully working scripts.
I'm using a DOIT ESP32 dev board (though there are other errors when compiling scripts for my nano 33 iot boards too).
If I PULL the script into Arduino IDE 2.2.1, it compiles fine., zero errors zero advisories.
Does anyone have any idea, what I've done to break it? I suspect that one or more libraries that I have up uploaded may have caused this issue, but even if this is the case, I do not know how to delete them. I really do feel that my iot cloud space needs to wiped leaving me free to rebuild it.
Anyway, hope someone out there can help/advise, thank you.

When compiling, the webeditor throws out the following error:

In file included from /mnt/create-efs/webide/50/76/507692cbdfa0a3e325495d16b26b5421:gavvyboy/libraries_v2/ESP8266WiFi/src/WiFiClientSecure.h:23,

from /home/builder/Arduino/libraries/arduinoiotcloud_1_12_2/src/ArduinoIoTCloudTCP.h:33,

from /home/builder/Arduino/libraries/arduinoiotcloud_1_12_2/src/ArduinoIoTCloud.h:175,

from /tmp/3753422621/Hot_water_and_Central_Heating_nov27a/thingProperties.h:3,

from /tmp/3753422621/Hot_water_and_Central_Heating_nov27a/Hot_water_and_Central_Heating_nov27a.ino:17:

/mnt/create-efs/webide/50/76/507692cbdfa0a3e325495d16b26b5421:gavvyboy/libraries_v2/ESP8266WiFi/src/WiFiClientSecureBearSSL.h:27:10: fatal error: bearssl/bearssl.h: No such file or directory

#include <bearssl/bearssl.h>

^~~~~~~~~~~~~~~~~~~

compilation terminated.

My code (doesn't do anything) :

#include "thingProperties.h"

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500); 

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  // Your code here 
  
  
}


/*
  Since DataString is READ_WRITE variable, onDataStringChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onDataStringChange()  {
  // Add your code here to act upon DataString change
}

Well, interestingly, I registered a new Arduino account, used the same script, registered a new thing (using the same DOI ESP32 board) and hey presto it compiles just fine.
Somehow, the files within my cloud storage area (or wherever the files are stored) are corrupted.

Has anybody any recommendations as to what I do next? I was thinking of pulling all my scripts and storing them locally using IDE 2.2.1 and then asking Arduino to reset/clear my account.
Thanks

Nice work identifying the cause of the error! This is exactly it.

From the path of the library shown in this error message, I can see that you imported the "ESP8266WiFi" library to your Arduino Cloud account. That library is specific to the ESP8266 microcontroller and can't be used with the ESP32 microcontroller. So getting an error when attempting to compile this library for an ESP32-based board is expected.

As you know, when you want to use a library in your Arduino sketch, you add an #include directive for a header file from the library. Libraries may also do the same thing to use other libraries in their code. When you compile a sketch using Arduino Web Editor (or Arduino IDE for that matter), it searches through the installed libraries and finds the library that contains a header file matching the #include directive. In some cases multiple libraries might be installed that contain a matching header file. In this case Arduino Web Editor must decide which of the libraries to use. It gives preference to the libraries you imported to your account over the standard pre-installed libraries.

In this case, the "ESP8266WiFi" happened to contain a header file matching one of the #include directives in your sketch or in one of the libraries used by your sketch. Arduino Web Editor chose to use the "ESP8266WiFi" library instead of the pre-installed library that was actually the right one to use for ESP32.

In cases where you really need an imported library, we can use some advanced techniques to influence Arduino Web Editor to pick the right library. However, in this case I doubt you really needed to import the "ESP8266WiFi" library. The reason is that this library is already pre-installed in Arduino Web Editor and that pre-installed copy of the library will always be available when you are compiling for an ESP8266-based board (while not causing any interference when you are compiling for other boards). So unless you have some specific reason for importing the "ESP8266WiFi" library, my recommendation is for you to simply remove the problematic imported library from your account.

I'll provide instructions you can follow to do that:

  1. Log into your original Arduino Cloud account.
  2. Click the following link to open Arduino Web Editor in your web browser:
    https://create.arduino.cc/editor
  3. If it is not already open, select "Libraries" from the menu on the left side of the "Arduino Web Editor" window to open the Libraries panel.
  4. Select the "CUSTOM" tab from the Libraries panel.
  5. Find the entry for the "ESP8266WiFi" library in the list of "custom" libraries.
  6. Hover the mouse pointer over the entry for the "ESP8266WiFi" library.
    You will see a downward pointing triangle icon appear to the right of the library name.
  7. Click the downward pointing triangle icon.
    A context menu will open.
  8. Select "Delete Library" from the context menu.
  9. Wait until you see the entry for the "ESP8266WiFi" library disappear from the list of "custom" libraries.

Now try compiling your sketch again. Hopefully this time the error will not occur.

That won't be necessary. It will be much faster for you to fix the problem yourself than waiting for your ticket to work through the support queue. And this way you will learn how to manage your imported libraries so that you can easily fix this type of problem in the future.

2 Likes

Hi, thank you very much for your reply, I am grateful.
Re. the custom libraries, I had suspected that this could be a problem and I deleted these a few days ago. All I have in my custom library list is the ADAFRUIT SSD1327 and MODBUSMASTER (by doc walker) libraries. I did have other libraries beforehand but deleted these a few days ago.
Does it take a few days from deleting the custom libraries to it taking effect?
Out of interest, I ran another compilation of an ESP32 based board and get the following, there are multiple found for WiFI.h and oddly ArduinoIoTCloud.h, please see my errors below.
Please note, I also get errors on my nano 33 iot boards too, but I think I'll deal with one problem at a time!
In file included from /mnt/create-efs/webide/50/76/507692cbdfa0a3e325495d16b26b5421:gavvyboy/libraries_v2/ESP8266WiFi/src/WiFiClientSecure.h:23,

from /home/builder/opt/libraries/arduinoiotcloud_1_12_2/src/ArduinoIoTCloudTCP.h:33,

from /home/builder/opt/libraries/arduinoiotcloud_1_12_2/src/ArduinoIoTCloud.h:175,

from /tmp/2503906765/Display_ESP32_may14a/Display_ESP32_may14a.ino:4:

/mnt/create-efs/webide/50/76/507692cbdfa0a3e325495d16b26b5421:gavvyboy/libraries_v2/ESP8266WiFi/src/WiFiClientSecureBearSSL.h:27:10: fatal error: bearssl/bearssl.h: No such file or directory

#include <bearssl/bearssl.h>

^~~~~~~~~~~~~~~~~~~

compilation terminated.

Multiple libraries were found for "WiFi.h"

Used: /home/builder/.arduino15/packages/esp32/hardware/esp32/2.0.5/libraries/WiFi

Not used: /home/builder/opt/libraries/nina_wi_fi_1_0_0

Not used: /home/builder/opt/libraries/vega_wifinina_1_0_1

Not used: /home/builder/opt/libraries/wifiespat_1_4_3

Not used: /home/builder/opt/libraries/wifinina_1_8_14

Not used: /home/builder/opt/libraries/wifi_1_2_7

Not used: /home/builder/opt/libraries/da16200_wi_fi_library_for_arduino_1_1_0

Not used: /home/builder/opt/libraries/seeed_arduino_rpcwifi_1_0_6

Not used: /home/builder/opt/libraries/indhilib_3_0_5

Multiple libraries were found for "WiFiClientSecure.h"

Used: /mnt/create-efs/webide/50/76/507692cbdfa0a3e325495d16b26b5421:gavvyboy/libraries_v2/ESP8266WiFi

Not used: /home/builder/opt/libraries/seeed_arduino_rpcwifi_1_0_6

Not used: /home/builder/.arduino15/packages/esp32/hardware/esp32/2.0.5/libraries/WiFiClientSecure

Multiple libraries were found for "ArduinoIoTCloud.h"

Used: /home/builder/opt/libraries/arduinoiotcloud_1_12_2

Not used: /home/builder/opt/libraries/arduinoiotcloud_1_12_2

Error during build: exit status 1

OK, then there must be a bug in Arduino Cloud that is causing the "ESP8266WiFi" to not be shown in the "Custom" libraries list even though it is installed under your account. So I think you had the right idea after all in contacting Arduino technical support, since it will be necessary for someone with administrative permissions to remove the library from your account if you aren't able to do it yourself from the Arduino Web Editor user interface.

You can contact Arduino technical support via this form:

https://www.arduino.cc/en/contact-us


I can provide you with a workaround you can use to get your sketch compiling right away. The workaround consists of importing the "WiFiClientSecure" library that should be used for ESP32 to your account. Importing the library will cause Arduino Web Editor to give it preference over the "ESP8266WiFi" library:

  1. Click the following link to open the GitHub page for version 2.0.5 (the version currently installed in Arduino Cloud) of the ESP32 boards platform in your web browser:
    https://github.com/espressif/arduino-esp32/tree/2.0.5
  2. Click the "Code ▾" button you see on that page.
  3. Select Download ZIP from the menu.
    A download of the ZIP file of the platform will start.
  4. Wait for the download to finish.
  5. Extract the downloaded arduino-esp32-2.0.5.zip file.
  6. Zip the libraries/WiFiClientSecure subfolder of the extracted folder.
  7. 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.
  8. Select the downloaded file from the dialog.
  9. Click the "Open" button.
  10. Wait for Arduino IDE to show a "Successfully installed library ... notification.
  11. Log into your original Arduino Cloud account.
  12. Click the following link to open Arduino Web Editor in your web browser:
    https://create.arduino.cc/editor
  13. If it is not already open, select "Libraries" from the menu on the left side of the "Arduino Web Editor" window to open the Libraries panel.
  14. Click the upward pointing arrow button ("Import") to the right side of the "Library Manager" button.
  15. If you get a popup about importing your sketchbook, click the "Import" button.
    A dialog will open that allows you to select a file on your computer to import to your Arduino Cloud account.
  16. Select the "ZIP" file you created at step (6) of these instructions.
  17. Click the "Open" button.
  18. Wait for Arduino Web Editor to display the notification that the library was successfully imported.
  19. Click the "OK" button.

Now try compiling your sketch again. Hopefully it will compile without any errors this time.


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

1 Like

That's great, its fixed it and I am now able to compile successfully. On installing it did notify me that I had reached my sketch limit, but this doesn't seem to have affected anything.

Out of interest I tried to compile another sketch (for a nano 33 iot) and it produced another error whilst compiling, see below, again it seems to be esp32 related but I'm a bit confused as to why.
When I do write to Tech Support, do you think it would be worth resetting all libraries in my account so just the original remain and removing all imported libraries? (I can always include them later, if they appear to be missing when I compile). The reason for suggesting this, is that there may be libraries that cause me issues in the future. Otherwise I'm not sure quite what to ask them to do (apart from deleting the "ESP8266WiFi " library)

As mentioned above, below are the errors generated when compiling a working sketch for a nano 33 iot board. Let me know if I should be including the sketch, but the error seems to be due to this bit:
/mnt/create-efs/webide/50/76/507692cbdfa0a3e325495d16b26b5421:gavvyboy/libraries_v2/Wire/src/Wire.h:28:10: fatal error: esp32-hal.h: No such file or directory

#include <esp32-hal.h>

In file included from /home/builder/Arduino/libraries/arduinoeccx08_1_3_7/src/ECCX08.h:24:0,

from /home/builder/Arduino/libraries/arduinoeccx08_1_3_7/src/ArduinoECCX08.h:23,

from /home/builder/Arduino/libraries/arduinoiotcloud_1_12_2/src/tls/utility/CryptoUtil.h:34,

from /home/builder/Arduino/libraries/arduinoiotcloud_1_12_2/src/ArduinoIoTCloudTCP.h:45,

from /home/builder/Arduino/libraries/arduinoiotcloud_1_12_2/src/ArduinoIoTCloud.h:175,

from /tmp/609695455/Solar_Thermal_mar20a/Solar_Thermal_mar20a.ino:6:

/mnt/create-efs/webide/50/76/507692cbdfa0a3e325495d16b26b5421:gavvyboy/libraries_v2/Wire/src/Wire.h:28:10: fatal error: esp32-hal.h: No such file or directory

#include <esp32-hal.h>

^~~~~~~~~~~~~

compilation terminated.

Multiple libraries were found for "WiFiNINA.h"

Used: /home/builder/opt/libraries/wifinina_1_8_14

Not used: /home/builder/opt/libraries/vega_wifinina_1_0_1

Multiple libraries were found for "ArduinoECCX08.h"

Used: /home/builder/opt/libraries/arduinoeccx08_1_3_7

Not used: /home/builder/opt/libraries/rak5814_atecc608a_1_0_0

Multiple libraries were found for "Wire.h"

Used: /mnt/create-efs/webide/50/76/507692cbdfa0a3e325495d16b26b5421:gavvyboy/libraries_v2/Wire

Not used: /home/builder/.arduino15/packages/arduino/hardware/samd/1.8.13/libraries/Wire

Multiple libraries were found for "OneWire.h"

Used: /home/builder/opt/libraries/onewire_2_3_7

Not used: /home/builder/opt/libraries/sdu_ags_sensorboard_1_0_0

Not used: /home/builder/opt/libraries/onewireng_0_13_2

Not used: /home/builder/opt/libraries/max31850_onewire_1_1_3

Error during build: exit status 1

This is the same type of problem. You imported the variant of the "Wire" library for the ESP32 microcontrollers. That library is now being used even when compiling for the Nano 33 IoT board, which has a different microcontroller (ATSAMD21G18). If the imported library wasn't there, Arduino Web Editor would instead use the pre-installed "Wire" library variant that was written specifically for the Nano 33 IoT's microcontroller.


I might have an idea about why you don't see the "Wire" and "ESP8266WiFi" libraries listed in your Arduino Cloud "custom" libraries. There is an optional filter on the libraries list. When this filter is enabled, it hides the libraries that are not compatible with the currently selected board. So if you have the Nano 33 IoT board selected, you won't see the "Wire" library you imported because that library is not compatible with the Nano 33 IoT board.

Please try this:

  1. Log into your original Arduino Cloud account.

  2. Click the following link to open Arduino Web Editor in your web browser:
    https://create.arduino.cc/editor

  3. If it is not already open, select "Libraries" from the menu on the left side of the "Arduino Web Editor" window to open the Libraries panel.

  4. Select the "CUSTOM" tab from the Libraries panel.

  5. You might see something like this under the search field in the Libraries panel:

    SHOWING LIBRARIES FOR NANO 33 IOT

    If so, click on the "NANO 33 IOT" part of the text.
    The text should now change to:

    SHOWING LIBRARIES FOR ALL BOARDS

  6. Find the entry for the "Wire" library in the list of "custom" libraries.

  7. Hover the mouse pointer over the entry for the "Wire" library.
    You will see a downward pointing triangle icon appear to the right of the library name.

  8. Click the downward pointing triangle icon.
    A context menu will open.

  9. Select "Delete Library" from the context menu.

  10. Wait until you see the entry for the "Wire" library disappear from the list of "custom" libraries.

Now try compiling your sketch again. Hopefully this time the error will not occur.

You are a star!
Its fixed, I deleted the majority of the custom libraries and all seems well with every one of my sketches.
I will definitely keep an eye on this in the future. Every day is a learning day.
Thank you for taking the time to help me out, you've made an old man very happy.

You are welcome. I'm glad we made our way to a proper solution eventually, even if it took me a bit longer than it should have to realize what was going on with the libraries list.

Regards,
Per

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.