Error compiling a cloud sketch

I have a long experience developing arduino projects using UNO R3, Mega boards.

I am starting my first IoT cloud project using the Arduino R4 WIFI board. My old sketches run well on the new board.

I have read a lot of documents and I have a reasonably good understanding of the process to develop a cloud application.

I have created a device and a thing. A sketch was automatically created by thing.

This sketch, even without variables or new code, does not compile. I get the error:

Error verifying

Multiple libraries were found for “RTC.h” followed by a few lines…

What to do next?

Post the full sketch here, using code tags, and the full error message, again using code tags

Thanks for the response. I am not familiar using the forum

/* 
  Sketch generated by the Arduino IoT Cloud Thing "Boat_Thing"
  https://create.arduino.cc/cloud/things/c8cec87d-be14-40ba-b671-a7c88cecd089 

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  - No variables have been created, add cloud variables on the Thing Setup page
    to see them declared here

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

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


Multiple libraries were found for "RTC.h"
Used: /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.2/libraries/RTC
Not used: /home/builder/opt/libraries/m5core2_0_2_0
Not used: /home/builder/opt/libraries/m5stickcplus_0_1_0
Not used: /home/builder/opt/libraries/m5stickc_0_3_0
Not used: /home/builder/opt/libraries/m5station_0_0_1
Error during build: exit status 1

Hi @jcpmorvan. I'm going to ask you to provide the full output from a compilation.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Open your sketch in Arduino Cloud Editor.
  2. Click the button in the Cloud Editor toolbar.
  3. Wait for the compilation to fail.
  4. If the black "Console" panel at the bottom of the Cloud Editor page is minimized, click the ˄ icon at the right side of the "Console" toolbar to expand it.
  5. Click the icon in the top right corner of the black "Console" panel at the bottom of the Cloud Editor page that looks like two pieces of paper ("Copy Console Output"):
  6. Open a forum reply here by clicking the "Reply" button.
  7. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the compilation output is correctly formatted.
  8. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  9. Move the cursor outside of the code block markup before you add any additional text to your reply.
  10. Click the "Reply" button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.

Click here for attachment instructions

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:

    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

Thank you for the fast reply with clear instructions

/usr/local/bin/arduino-cli compile --fqbn arduino:renesas_uno:unor4wifi --build-cache-path /tmp --output-dir /tmp/2768204884/build --build-path /tmp/arduino-build-6D8CCEE52AFDA56DA37A8CCD45B70739  --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/DHT-sensor-library --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/Headers --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/IRremote --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/MicroLCD --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/MultiLCD --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/Narcoleptic --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/NeoGPS --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/NewPing --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/OBD --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/OBD2UART --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/SIM800 --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/Timer-2.1 --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/TinyGPS --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/TinyGPSPlus-1.0.2 --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/analogComp --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/json-c --library /mnt/create-efs/webide/bd/0a/bd0ad604096ce77a6a1132a60262b720:jcpmorvan/libraries_v2/pitches /tmp/2768204884/Boat_Thing_nov25a

In file included from /tmp/2768204884/Boat_Thing_nov25a/Boat_Thing_nov25a.ino:17:0:
/tmp/2768204884/Boat_Thing_nov25a/thingProperties.h:6:25: error: 'SECRET_SSID' was not declared in this scope
 const char SSID[]     = SECRET_SSID;    // Network SSID (name)
                         ^~~~~~~~~~~
/tmp/2768204884/Boat_Thing_nov25a/thingProperties.h:6:25: note: suggested alternative: '_GETSSID'
 const char SSID[]     = SECRET_SSID;    // Network SSID (name)
                         ^~~~~~~~~~~
                         _GETSSID
/tmp/2768204884/Boat_Thing_nov25a/thingProperties.h:7:25: error: 'SECRET_OPTIONAL_PASS' was not declared in this scope
 const char PASS[]     = SECRET_OPTIONAL_PASS;    // Network password (use for WPA, or use as key for WEP)
                         ^~~~~~~~~~~~~~~~~~~~
Multiple libraries were found for "RTC.h"
  Used: /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.2.2/libraries/RTC
  Not used: /home/builder/opt/libraries/m5core2_0_2_0
  Not used: /home/builder/opt/libraries/m5stickcplus_0_1_0
  Not used: /home/builder/opt/libraries/m5stickc_0_3_0
  Not used: /home/builder/opt/libraries/m5station_0_0_1
Error during build: exit status 1
/* 
  Sketch generated by the Arduino IoT Cloud Thing "Boat_Thing"
  https://create.arduino.cc/cloud/things/c8cec87d-be14-40ba-b671-a7c88cecd089 

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  - No variables have been created, add cloud variables on the Thing Setup page
    to see them declared here

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#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();
}

Thank you for your help.
I have responded to your post by sending the complete sketch and the complete verification result.
Best,
Jean Claude

OK, great. I can see the problem now:

Arduino Cloud IoT Thing sketches must have access to the Internet in order to communicate with the Arduino Cloud server. For this reason, you must configure the Thing with credentials to access your Wi-Fi access point. The sketch is failing to compile because you have not configured those credentials.

I'll provide instructions you can follow to configure the network credentials:

  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 Things in the web browser:
    https://app.arduino.cc/things
  3. Click the name of the Thing.
    The "Setup" page for the Thing will open.
  4. Click the button ("Configure") under the "Network" section of the page.
    The "Configure network" dialog will open.
  5. Type the SSID of your Wi-Fi access point into the "Wi-Fi Name" field of the dialog.
  6. Type the password for the Wi-Fi access point into the "Password" field of the dialog.
  7. Click the "SAVE" button at the bottom of the dialog.
    The dialog will close.
  8. Select the "Sketch" tab at the top of the page.
    The Thing sketch will open in Arduino Cloud Editor.

Now try compiling the sketch again. This time it should compile without those errors.

You will continue to see this message even after fixing the network credentials, but don't worry. When you compile a sketch, the Arduino sketch build system searches through all the installed libraries to find the ones that contain each of the header files specified by the #include directives in the sketch code. Multiple libraries might contain a header file with the specified filename. In this case, the sketch build system must decide which of the libraries to use.

The "Multiple libraries were found for ..." message is only communicating that this happened, and which of the libraries was used. The sketch build system is pretty smart in how it chooses the library so usually this message is nothing to worry about. Just take a quick look at the message and if the expected library was used then you can safely ignore the message.

The only time you need to pay attention to this message is when Arduino IDE picked a different library than the one you had intended. In this case, it will be necessary to take some action to cause the correct library to be selected. If you have that problem, just let us know and we'll provide assistance.

For the convenience of the user, every one of the thousands of libraries in the Arduino Library Manager are preinstalled on the Arduino Cloud server. This means it is likely that, for any #include directive for a file that is named using a common term, multiple libraries will contain a matching header file. So it is expected that you will often see these "Multiple libraries were found for ..." messages when compiling your projects with Cloud Editor.

After correcting the thing for the network, the sketch verification and downloading went well. I should be able to start my project that is a both ways communication to display info and control activities on my sailboat from my iPhone.

Thank you very much for your precious help. Your instructions are clear, complete and to the point.
A great assistance job.

Best,
Jean Claude

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

Regards, Per