IoT cloud rtc problem

Hi, I'm trying to build a remote controlled watering sistem for my garden but I keep getting the same errors. I'm using an mkr 1010 wifi board and a DS1302 module to keep track of the time. Does anyone know how to fix this? P.S. I'm just a beginner.

/tmp/arduino-build-024F8E4F800A6DFA75142C0CCBC0A22F/libraries/virtuabotixRTC/objs.a(virtuabotixRTC.cpp.o):/mnt/create-efs/webide/18/ab/18abf25fdc934dabdacb3bad4f88a40f:davide_8/libraries_v2/virtuabotixRTC/virtuabotixRTC.cpp:353: multiple definition of `rtc'

/tmp/arduino-build-024F8E4F800A6DFA75142C0CCBC0A22F/libraries/arduinoiotcloud_1_11_2/utility/time/objs.a(TimeService.cpp.o):/home/builder/Arduino/libraries/arduinoiotcloud_1_11_2/src/utility/time/TimeService.cpp:50: first defined here

collect2: error: ld returned 1 exit status

Multiple libraries were found for "SPI.h"

Used: /home/builder/.arduino15/packages/arduino/hardware/samd/1.8.13/libraries/SPI

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

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_0

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

Error during build: exit status 1

Hi!

You have multiple definitions of the object 'rtc', probably because you have several libraries conflicting or in your sketch.

Can you share your sketch?

#include "thingProperties.h"
#include <virtuabotixRTC.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 
  
  
}

As you can see i tried to remove everything except from including the library to see were the problem was but nothing changed

Try removing VirtuabotixRTC.h.

Why do you want to use that library?

If you want to get the time, you can use ArduinoCloud.getLocalTime().
More info here.

[quote="davide_8, post:1, topic:1142644"]
/tmp/arduino-build-024F8E4F800A6DFA75142C0CCBC0A22F/libraries/virtuabotixRTC/objs.a(virtuabotixRTC.cpp.o):/mnt/create-efs/webide/18/ab/18abf25fdc934dabdacb3bad4f88a40f:davide_8/libraries_v2/virtuabotixRTC/virtuabotixRTC.cpp:353: multiple definition of `rtc'

/tmp/arduino-build-
[/quote]Check for multiple definitions of the rtc symbol in your Arduino project files and libraries.
Remove or update conflicting libraries that may be causing the symbol collision.
Rename the rtc symbol in one of the conflicting files to avoid the collision.

As I said I'm just a beginner and I've always used virtuabotixRTC.h with my ds1307. Can someone explain how to convert unix time to h24 format time. I also need day of the week for my project, it can also be displayed by a number

The error message related to multiple libraries (SPI.h , WiFiNINA.h , ArduinoECCX08.h ) indicates that there are conflicting library versions installed on your system. To resolve this, make sure you have only one version of each library installed.

I'll try, but how can I do this on arduino cloud?

You have to go to the 'libraries' section on the left side of the console. Then type the names of the libraries. Then you have to uninstall them manually.

1 Like

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