IoT Cloud problem unable to compile code with cloud Libraries (Entry Plan)

Hi

I have not used my IoT Cloud account for several months. I was compiling the same code that worked in the past and it would not compile lots of errors.
I then made up some very basic code that would just connecting to the cloud it failed to compile . See code and Errors

It seams that any code that I use with ArduinoIoTCloud.h, Arduino_ConnectionHandler comes up with lots of errors.
I created a second account and used the same code (very basic code with ArduinoIoTCloud.h, Arduino_ConnectionHandler) it worked no problem on the same system.

Do I have some kind a problem with my account?

  • Web Browser:Foxfox 125.0.2 and Microsoft Edge version 124.0.2478.51 (Official build) (64-bit). Tried other browser and same problem.
  • Board used :ESP32 Wrover Module.

Code

#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 
  
  
}

thingProperties.h

// Code generated by Arduino IoT Cloud, DO NOT EDIT.

#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>

const char DEVICE_LOGIN_NAME[]  = "92a6c7bb-1f8f-4542-9566-6d8b520d3a95";

const char SSID[]               = SECRET_SSID;    // Network SSID (name)
const char PASS[]               = SECRET_OPTIONAL_PASS;    // Network password (use for WPA, or use as key for WEP)
const char DEVICE_KEY[]  = SECRET_DEVICE_KEY;    // Secret device password



void initProperties(){

  ArduinoCloud.setBoardId(DEVICE_LOGIN_NAME);
  ArduinoCloud.setSecretDeviceKey(DEVICE_KEY);

}

WiFiConnectionHandler ArduinoIoTPreferredConnection(SSID, PASS);

Error on Console

/usr/local/bin/arduino-cli compile --fqbn esp32:esp32:esp32wrover:UploadSpeed=921600,FlashFreq=80,FlashMode=qio,PartitionScheme=default,DebugLevel=none,EraseFlash=none --build-cache-path /tmp --output-dir /tmp/445397665/build --build-path /tmp/arduino-build-8DAE6323BE33722E279A41B9C8006775  --library /mnt/create-efs/webide/63/d1/63d1ba54b5cf017a7327ec2c3d21c313:normanwieser/libraries_v2/ESP32_easy_wifi_data --library /mnt/create-efs/webide/63/d1/63d1ba54b5cf017a7327ec2c3d21c313:normanwieser/libraries_v2/SimpleTimer --library /mnt/create-efs/webide/63/d1/63d1ba54b5cf017a7327ec2c3d21c313:normanwieser/libraries_v2/Time --library /mnt/create-efs/webide/63/d1/63d1ba54b5cf017a7327ec2c3d21c313:normanwieser/libraries_v2/WiFi --library /mnt/create-efs/webide/63/d1/63d1ba54b5cf017a7327ec2c3d21c313:normanwieser/libraries_v2/WiFiNINA /tmp/445397665/Untitled_4_may11a

/home/builder/Arduino/libraries/arduino_connectionhandler_0_8_1/src/Arduino_WiFiConnectionHandler.cpp: In member function 'virtual NetworkConnectionState WiFiConnectionHandler::update_handleInit()':
/home/builder/Arduino/libraries/arduino_connectionhandler_0_8_1/src/Arduino_WiFiConnectionHandler.cpp:92:8: error: 'class WiFiClass' has no member named 'mode'
   WiFi.mode(WIFI_STA);
        ^~~~
/home/builder/Arduino/libraries/arduino_connectionhandler_0_8_1/src/Arduino_WiFiConnectionHandler.cpp:92:13: error: 'WIFI_STA' was not declared in this scope
   WiFi.mode(WIFI_STA);
             ^~~~~~~~
/home/builder/Arduino/libraries/arduino_connectionhandler_0_8_1/src/Arduino_WiFiConnectionHandler.cpp: In member function 'virtual NetworkConnectionState WiFiConnectionHandler::update_handleConnecting()':
/home/builder/Arduino/libraries/arduino_connectionhandler_0_8_1/src/Arduino_WiFiConnectionHandler.cpp:101:16: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
     WiFi.begin(_ssid, _pass);
                ^~~~~
In file included from /home/builder/Arduino/libraries/arduino_connectionhandler_0_8_1/src/Arduino_ConnectionHandler.h:151,
                 from /home/builder/Arduino/libraries/arduino_connectionhandler_0_8_1/src/Arduino_WiFiConnectionHandler.h:25,
                 from /home/builder/Arduino/libraries/arduino_connectionhandler_0_8_1/src/Arduino_WiFiConnectionHandler.cpp:22:
/mnt/create-efs/webide/63/d1/63d1ba54b5cf017a7327ec2c3d21c313:normanwieser/libraries_v2/WiFi/src/WiFi.h:79:21: note:   initializing argument 1 of 'int WiFiClass::begin(char*, const char*)'
     int begin(char* ssid, const char *passphrase);
               ~~~~~~^~~~
Multiple libraries were found for "WiFi.h"
  Used: /mnt/create-efs/webide/63/d1/63d1ba54b5cf017a7327ec2c3d21c313:normanwieser/libraries_v2/WiFi
  Not used: /home/builder/opt/libraries/wifi_1_2_7
  Not used: /home/builder/opt/libraries/indhilib_3_0_5
  Not used: /home/builder/opt/libraries/vega_wifinina_1_0_1
  Not used: /home/builder/opt/libraries/wifinina_1_8_14
  Not used: /mnt/create-efs/webide/63/d1/63d1ba54b5cf017a7327ec2c3d21c313:normanwieser/libraries_v2/WiFiNINA
  Not used: /home/builder/opt/libraries/wifiespat_1_4_3
  Not used: /home/builder/opt/libraries/seeed_arduino_rpcwifi_1_0_7
  Not used: /home/builder/opt/libraries/da16200_wi_fi_library_for_arduino_1_1_0
  Not used: /home/builder/opt/libraries/betterwifinina_1_3_0
  Not used: /home/builder/opt/libraries/nina_wi_fi_1_0_1
  Not used: /home/builder/.arduino15/packages/esp32/hardware/esp32/2.0.5/libraries/WiFi
Multiple libraries were found for "WiFiClientSecure.h"
  Used: /home/builder/.arduino15/packages/esp32/hardware/esp32/2.0.5/libraries/WiFiClientSecure
  Not used: /home/builder/opt/libraries/seeed_arduino_rpcwifi_1_0_7
Multiple libraries were found for "SPI.h"
  Used: /home/builder/.arduino15/packages/esp32/hardware/esp32/2.0.5/libraries/SPI
  Not used: /home/builder/opt/libraries/eventethernet_1_0_0
Error during build: exit status 1

All the code was automatedly generated by the IoT Cloud.

Anyone have any Idea what my problem is?

Norm

Hi @normanwieser.

It looks like you imported a variant of the "WiFi" library to your Arduino Cloud account. The library you imported is incompatible with your ESP32 board. The correct library for the ESP32 board is pre-installed in the Arduino Cloud servers. It is the one shown in this part of the information compilation message here:

Imported libraries are given preference over the pre-installed libraries. So Arduino Cloud choses to use the incompatible library you imported when compiling instead of the correct library, which results in the compilation failure.

The solution will be to remove the problematic imported libraries from your account. Both the libraries you imported are preinstalled in Arduino Cloud, so the imported copies of them serve no purpose and their removal should not cause any problems.

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

Remove Imported "WiFi" Library

  1. If you are not already, log in to your Arduino account:
    https://login.arduino.cc/login

  2. Click the following link to open the list of your Arduino Cloud IoT Things in the web browser:
    https://app.arduino.cc/things

  3. Click on the Thing you are working on.
    The Thing page will open.

  4. Select the "Sketch" tab of the page.
    The sketch will open in Arduino Cloud Editor.

  5. Click the icon that looks like shelved books ("Libraries") in the bar on the left side of the Cloud Editor page.
    The "Libraries" panel will open.

  6. Select the "Custom" tab from the "Libraries" panel.

  7. You will see text near the top of the panel:

    Show libraries for:
    <board name>

    (where <board name> is the name of the board you have selected in Arduino Cloud Editor)
    Click the board name in that text.
    The text will now change to:

    Show libraries for:
    ALL DEVICES

  8. Scroll down through the list of custom libraries until you find the entry for the "WiFi" library.

  9. Click the icon to the right of the library name.
    A menu will open.

  10. Select "Delete Library" from the menu.
    A "Delete custom library" dialog will open.

  11. Click the "YES, DELETE" button in the dialog.

Remove Imported "WiFiNINA" Library

From the output you shared, it appears that you also imported a copy of the library:

Since this is also an imported library, it might end up getting used instead of the good variant of the "WiFi" library once you have removed the incompatible imported "WiFi" library. So you should also remove this library from your account, using the same procedure as you used to remove the imported "WiFi" library:

  1. Click the icon that looks like shelved books ("Libraries") in the bar on the left side of the Cloud Editor page.
    The "Libraries" panel will open.

  2. Select the "Custom" tab from the "Libraries" panel.

  3. You will see text near the top of the panel:

    Show libraries for:
    <board name>

    (where <board name> is the name of the board you have selected in Arduino Cloud Editor)
    Click the board name in that text.
    The text will now change to:

    Show libraries for:
    ALL DEVICES

  4. Scroll down through the list of custom libraries until you find the entry for the "WiFiNINA" library.

  5. Click the icon to the right of the library name.
    A menu will open.

  6. Select "Delete Library" from the menu.
    A "Delete custom library" dialog will open.

  7. Click the "YES, DELETE" button in the dialog.


After you have removed the two libraries, try compiling the sketch again. Hopefully this time the errors will no longer occur.


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

Looks like that fixed my problem.

Thank You

Norm

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

Regards,
Per