No matching function for call to'DS3231 (const uint8_t &, const uint8_t &) '

Please help me!
For a week I am unable to work with the web editor.
In my Sketch I already had parts with the DS3231 library, working.
When compiling comes the following message:
"No corresponding function to call for DS3231 (const uint8_t &, const uint8_t &) '"
I've already uninstalled the DS3231 library and reinstalled. Unsuccessfully.
The usage examples for the DS3231 also display the same message ...
In IDE 1.8.5 it compiles perfectly.
Thank you very much for your attention!

Please share the sketch link.
Also if you can attache the custom library that may also be useful.

What board are you trying to use ?

Thanks for the feedback!

I'm new here. Sorry if I'm making a mistake.

The link is:

I think the library is from WEB EDITOR itself.

I'm using the Uno and MEGA2560 boards.

Thank you!

Please post your full sketch. If possible you should always post code directly in the forum thread as text using code tags (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then it's OK to add it as an attachment. Don't put your code in some external file service like dropbox, etc. We shouldn't need to go to an external website just to help you. I do feel it's reasonable to post a link to code hosted on GitHub or similar code hosting sites since that's an platform specifically designed for this sort of thing.

Please do this:

  • Hover the mouse over the red bar that shows the error message. Click and drag it up so you can see the black console window.
  • Click the icon in the top right corner of the console that looks like two pieces of paper.
  • Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

Below is the sketch I am using as an example.

He asks for the DS3231 library.

But even reinstalling the library, WEB EDITOR does not recognize.

I think it was some page change.

/*
DS3231: Real-Time Clock. Simple example
Read more: www.jarzebski.pl/arduino/komponenty/zegar-czasu-rzeczywistego-rtc-ds3231.html
GIT: GitHub - jarzebski/Arduino-DS3231: DS3231 Real-Time-Clock
Web: http://www.jarzebski.pl
(c) 2014 by Korneliusz Jarzebski
*/

#include <Wire.h>
#include <DS3231.h>

DS3231 clock;
RTCDateTime dt;

void setup()
{
Serial.begin(9600);

// Initialize DS3231
Serial.println("Initialize DS3231");;
clock.begin();

// Set sketch compiling time
clock.setDateTime(DATE, TIME);
}

void loop()
{
dt = clock.getDateTime();

// For leading zero look to DS3231_dateformat example

Serial.print("Raw data: ");
Serial.print(dt.year); Serial.print("-");
Serial.print(dt.month); Serial.print("-");
Serial.print(dt.day); Serial.print(" ");
Serial.print(dt.hour); Serial.print(":");
Serial.print(dt.minute); Serial.print(":");
Serial.print(dt.second); Serial.println("");

delay(1000);
}

Below is the error returned.

./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -logger humantags -fqbn arduino:avr:uno -build-cache /tmp -build-path /tmp/713943306/build -verbose -prefs runtime.tools.avr-gcc.path=./opt/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2 -prefs runtime.tools.avrdude.path=./opt/tools/avrdude/6.3.0-arduino14 -prefs runtime.tools.arduinoOTA.path=./opt/tools/arduinoOTA/1.2.1 -libraries /tmp/713943306/custom -libraries /tmp/713943306/pinned /tmp/713943306/DS3231_simple

Multiple libraries were found for "DS3231.h"

Used: /home/ubuntu/opt/libraries/latest/ds3231_1_0_2

Not used: /tmp/713943306/custom/0ec1addf-1f63-4db0-979f-049890b19d55

Using library Wire at version 1.0 in folder: /home/ubuntu/opt/cores/arduino/avr/libraries/Wire

Using library ds3231_1_0_2 at version 1.0.2 in folder: /home/ubuntu/opt/libraries/latest/ds3231_1_0_2

/tmp/713943306/DS3231_simple/DS3231_simple.ino:13:1: error: 'RTCDateTime' does not name a type

RTCDateTime dt;

^

/tmp/713943306/DS3231_simple/DS3231_simple.ino: In function 'void setup()':

/tmp/713943306/DS3231_simple/DS3231_simple.ino:21:9: error: 'class DS3231' has no member named 'begin'

clock.begin();

^

/tmp/713943306/DS3231_simple/DS3231_simple.ino:24:9: error: 'class DS3231' has no member named 'setDateTime'

clock.setDateTime(DATE, TIME);

^

/tmp/713943306/DS3231_simple/DS3231_simple.ino: In function 'void loop()':

/tmp/713943306/DS3231_simple/DS3231_simple.ino:29:3: error: 'dt' was not declared in this scope

dt = clock.getDateTime();

^

/tmp/713943306/DS3231_simple/DS3231_simple.ino:29:14: error: 'class DS3231' has no member named 'getDateTime'

dt = clock.getDateTime();

^

exit status 1

CODE TAGS !!!

Dear ballscrewbob and pert. Thank you very much for the directions.
Maybe I have not figured out how I should proceed. But I think I'm in the way...

No you are not in the way at all but you really do need to read the sticky posts at the top of the forum sections please.
It will save you a lot of problems later with any issues.

The forum can change code and error messages if they are not formatted correctly and thats why we ask you use code tags ( </> )

Arrgh. The Arduino Web Editor is being really annoying with this one. There are two problems:

The library author didn't follow the Arduino Library Specification regarding the folder structure for the example sketches. With the standard Arduino IDE, this causes no problems; but it causes the Arduino Web Editor to import it as a collection of sketches, not a library.

The solution to this problem is to:

  1. Download the library: https://github.com/jarzebski/Arduino-DS3231/archive/master.zip
  2. Unzip the downloaded file.
  3. In the unzipped folder, create a subfolder named examples
  4. Move all the example sketch folders from the root of the library folder to the examples folder.

The second problem is that, for reasons I don't understand, when the custom library is imported the Arduino Web Editor is using the preinstalled library instead of the imported one:

Giovani_Delgado:
Multiple libraries were found for "DS3231.h"

Used: /home/ubuntu/opt/libraries/latest/ds3231_1_0_2

Not used: /tmp/713943306/custom/0ec1addf-1f63-4db0-979f-049890b19d55

My understanding was that, as long as they have equally good architecture matches, the Arduino Web Editor should give preference to the imported (AKA "custom") library. This use of the pre-installed library seems like it must be a bug since it's only logical that the user would prefer their imported library to be used.

So we're forced to use an ugly hack to force the Arduino Web Editor to do as we intend:

  1. In the unzipped library folder, create a file named UseThisDS3231Library.h. The file will be empty because it's just a dummy file.
  2. Zip the library folder.
  3. In the Arduino Web Editor, click the "Libraries" tab.
  4. Click the Import button (upward pointing arrow).
  5. If it displays a dialog about importing your sketchbook, click "Import".
  6. Select the zipped file that contains the modified library.
  7. Click "Open".
  8. If you get a dialog about updating the existing library, click "OK".
  9. Wait until you get the message that the library was successfully imported.
  10. In your sketch, above this line:
    #include <DS3231.h>
    
    add a new line:
    #include <UseThisDS3231Library.h>
    

I've used this technique successfully in the past but unfortunately when I tried it now I get an error:

/tmp/722347697/DS3231_temperature/DS3231_temperature.ino:10:34: fatal error: UseThisDS3231Library.h: No such file or directory

I think the Arduino Web Editor is just super broken right now. I'm hoping this error is something specific to my account so I think it's worth it for you to give it a try. If that doesn't work then you'll probably need to use the regular Arduino IDE until the temporary issue with Arduino Web Editor is resolved.

Many thanks pert!

Returned the same error...

/tmp/247815396/DS3231_simple/DS3231_simple.ino:13:34: fatal error: UseThisDS3231Library.h: No such file or directory

I just tried again and still the same error. I tried to download the imported library back to my computer from Arduino Web Editor to verify UseThisDS3231Library.h is present but I just get an "Error while downloading" message.

Finally I found a solution:

  • Open UseThisDS3231Library.h in a text editor.
  • Add the following text:
// This file intentionally left blank[/li]
[li]// its purpose is to force the correct library to be used[/li]
[li]

[/li]

  • Save the file.
  • Zip the folder containing the library with the modified UseThisDS3231Library.h.
  • In the Arduino Web Editor, import the new .zip file, going through the update process as before.

Apparently, UseThisDS3231Library.h being an empty file caused some problem with the Arduino Web Editor, I'm not sure exactly what. The exact text you add to the file is not important, as long as its valid C++ code, it's only important that the file contains something.

I tried to do it in several ways.
They all returned to the error below.

./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -logger humantags -fqbn arduino:avr:uno -build-cache /tmp -build-path /tmp/054770778/build -verbose -prefs runtime.tools.avr-gcc.path=./opt/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2 -prefs runtime.tools.avrdude.path=./opt/tools/avrdude/6.3.0-arduino14 -prefs runtime.tools.arduinoOTA.path=./opt/tools/arduinoOTA/1.2.1 -libraries /tmp/054770778/custom -libraries /tmp/054770778/pinned /tmp/054770778/DS3231_simple

Using library Wire at version 1.0 in folder: /home/ubuntu/opt/cores/arduino/avr/libraries/Wire

Using library 60c800d6-04d3-410e-8a77-211d3664c826 in folder: /tmp/054770778/custom/60c800d6-04d3-410e-8a77-211d3664c826 (legacy)

In file included from /tmp/054770778/DS3231_simple/DS3231_simple.ino:15:0:

/tmp/054770778/custom/60c800d6-04d3-410e-8a77-211d3664c826/UseThisDS3231Library.h:2:1: error: expected unqualified-id before '[' token

[li]// its purpose is to force the correct library to be used[/li]

^

In file included from /tmp/054770778/DS3231_simple/DS3231_simple.ino:16:0:

/tmp/054770778/custom/60c800d6-04d3-410e-8a77-211d3664c826/DS3231.h:98:2: error: 'RTCDateTime' does not name a type

RTCDateTime getDateTime(void);

^

/tmp/054770778/custom/60c800d6-04d3-410e-8a77-211d3664c826/DS3231.h:129:43: error: 'RTCDateTime' has not been declared

char* dateFormat(const char* dateFormat, RTCDateTime dt);

^

/tmp/054770778/custom/60c800d6-04d3-410e-8a77-211d3664c826/DS3231.h:133:2: error: 'RTCDateTime' does not name a type

RTCDateTime t;

^

/tmp/054770778/DS3231_simple/DS3231_simple.ino:19:1: error: 'RTCDateTime' does not name a type

RTCDateTime dt;

^

/tmp/054770778/DS3231_simple/DS3231_simple.ino: In function 'void loop()':

/tmp/054770778/DS3231_simple/DS3231_simple.ino:35:3: error: 'dt' was not declared in this scope

dt = clock.getDateTime();

^

/tmp/054770778/DS3231_simple/DS3231_simple.ino:35:14: error: 'class DS3231' has no member named 'getDateTime'

dt = clock.getDateTime();

^

exit status 1

The fault is mine. The forum markdown got accidentally injected into the code. I should have checked what I posted to make sure it was correctly formatted by the forum. Please do this:

  • Open UseThisDS3231Library.h in a text editor.
  • Replace the previous text with the following text:
// This file intentionally left blank
// its purpose is to force the correct library to be used
  • Save the file.
  • Zip the folder containing the library with the modified UseThisDS3231Library.h.
  • In the Arduino Web Editor, import the new .zip file, going through the update process as before.

Pert, thank you very much for your dedication!

I followed your tips and it worked!

However, after many tests, I believe that the WEB EDITOR bug has been corrected, returning to normal.

Thank you one more time!

Congratulations to all!

This post is old I know but if anyone needs help, this worked for me:

The problem strarted when I changed my laptop so I reinstalled everything incluiding the DS3231 Library in the library manager, however that´s not the right one.
I had to go to:

Documents>Arduino>library

and delete the "DS3231" library. Then Downloaded Rinky-Dink´s DS3231 library:
http://www.rinkydinkelectronics.com/library.php?id=73

Add the library in Arduino´s IDE menu and enjoy!

5 Likes