Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

RTClib 1.4.0 error (no error with 1.3.4)
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RTClib 1.4.0 error (no error with 1.3.4)

by TDEAF on Thu Mar 12, 2020 11:17 am

Hi.

I just updated several of my Arduino libraries, including Adafruit's RTClib, to their most current versions. It appears that there is an error in the RTClib 1.4.0 version, as when I compile my sketch (or Adafruit's RTClib pfc8523 example) I get the following errors when using RTClib 1.4.0, but not when using RTClib 1.3.4. If this has been posted somewhere already, I apologize in advance, but I have not seen it noticed in these forums or via a Google search.

Thanks for taking a look at this!

20200312 1430 UTC:
- Error when compiling with Adafruit’s RTClib 1.4.0, but not with 1.3.4, when attempting to adjust the rtc date/time.
- Adafruit’s RTClib pcf8523 example generates the same error when attempting to adjust the rtc date/time.
- I’m running this on an Adafruit Feather nRF52832 with attached AdaLogger Featherwing. Everything works fine with RTClib 1.3.4, but not with RTClib 1.4.0.

Arduino: 1.8.12 (Windows 10), Board: "Adafruit Feather nRF52832, 0.3.0 SoftDevice s132 6.1.1, Level 0 (Release)"

C:\Users\XYZ\Documents\Arduino\libraries\RTClib\RTClib.cpp: In static member function 'static void RTC_DS3231::adjust(const DateTime&)':

C:\Users\XYZ\Documents\Arduino\libraries\RTClib\RTClib.cpp:975:30: error: call of overloaded 'write(int)' is ambiguous

Wire._I2C_WRITE(DS3231_TIME); // start at location 0

^

In file included from C:\Users\XYZ\Documents\Arduino\libraries\RTClib\RTClib.cpp:47:0:

C:\Users\XYZ\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\0.18.5\libraries\Wire/Wire.h:50:12: note: candidate: virtual size_t TwoWire::write(uint8_t)

size_t write(uint8_t data);

^~~~~

In file included from C:\Users\XYZ\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\0.18.5\cores\nRF5/Stream.h:26:0,

from C:\Users\XYZ\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\0.18.5\libraries\Wire/Wire.h:26,

from C:\Users\XYZ\Documents\Arduino\libraries\RTClib\RTClib.cpp:47:

C:\Users\XYZ\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\0.18.5\cores\nRF5/Print.h:51:12: note: candidate: size_t Print::write(const char*)

size_t write(const char *str) {

^~~~~

exit status 1
Error compiling for board Adafruit Feather nRF52832.

TDEAF
 
Posts: 29
Joined: Mon Nov 25, 2019 11:19 pm

Re: RTClib 1.4.0 error (no error with 1.3.4)

by adafruit_support_carter on Thu Mar 12, 2020 2:44 pm


adafruit_support_carter
 
Posts: 16938
Joined: Tue Nov 29, 2016 2:45 pm

Re: RTClib 1.4.0 error (no error with 1.3.4)

by adafruit_support_carter on Fri Mar 13, 2020 11:54 am

This ended up being an issue with the Arduino BSP for the nRF platform:
https://github.com/adafruit/Adafruit_nR ... issues/456

Please try upgrading to the 0.19.0 version:
https://github.com/adafruit/Adafruit_nR ... tag/0.19.0

adafruit_support_carter
 
Posts: 16938
Joined: Tue Nov 29, 2016 2:45 pm

Re: RTClib 1.4.0 error (no error with 1.3.4)

by TDEAF on Sun Mar 15, 2020 9:56 pm

Thanks for your quick reply. It looks like a simple solution.

I have downloaded the ZIP file for the 0.19.0 BSP, but can't seem to figure out how to manually install it. I thought it would be as simple as unzipping the 0.19.0 file and putting it in the adafruit hardware directory where the 0.18.5 version currently is and restarting the Arduino IDE. However, that doesn't seem to do it, and the instructions on the Adafruit website seem to assume that I can do it automatically through the Board Manager in the Arduino IDE. So, might you be able to point me in the right direction for getting this installed? Thanks!

TDEAF
 
Posts: 29
Joined: Mon Nov 25, 2019 11:19 pm

Re: RTClib 1.4.0 error (no error with 1.3.4)

by adafruit_support_carter on Mon Mar 16, 2020 12:36 pm

Yep, install it through Board Manager like you originally did. If you go there again, it should show a new version available and you can just click "Update".
https://learn.adafruit.com/bluefruit-nr ... -bsp-setup

Don't install it directly from the repo. Sorry, that was just linked for reference.

adafruit_support_carter
 
Posts: 16938
Joined: Tue Nov 29, 2016 2:45 pm

Re: RTClib 1.4.0 error (no error with 1.3.4)

by TDEAF on Mon Mar 16, 2020 3:27 pm

Hmmm. I'm not seeing a 0.19.0 version available to auto-install from the Board Manager section of the Arduino IDE. I only see 0.18.5. I tried this yesterday, and tried it again just now, with the same results.

My "additional board manager URLs" are as follows:

https://adafruit.github.io/arduino-boar ... index.json
https://www.adafruit.com/package_adafruit_index.json

Any other ideas?

TDEAF
 
Posts: 29
Joined: Mon Nov 25, 2019 11:19 pm

Re: RTClib 1.4.0 error (no error with 1.3.4)

by hathach on Wed Mar 18, 2020 11:17 pm

please try again, we have just rolled it out.

hathach
 
Posts: 1110
Joined: Tue Apr 23, 2013 1:02 am

Re: RTClib 1.4.0 error (no error with 1.3.4)

by TDEAF on Thu Mar 19, 2020 6:31 am

Awesome! Thanks! That worked and no compile errors this time! :-)

TDEAF
 
Posts: 29
Joined: Mon Nov 25, 2019 11:19 pm

Re: RTClib 1.4.0 error (no error with 1.3.4)

by colindgrant on Sat Apr 18, 2020 7:20 pm

hathach wrote:please try again, we have just rolled it out.


Hi hathach, two things -

1) I don't think these new overload methods made it into the 0.19.0 release.

I ran into this issue on the nRF52840 Feather Bluefruit Sense after I had already upgraded to BSP 0.19.0 in Arduino IDE 1.8.12.

I see the fix was merged here https://github.com/adafruit/Adafruit_nRF52_Arduino/pull/457
But it looks like the 0.19.0 release had already been merged with #455 earlier that day?
As a sanity check I went and downloaded the 0.19.0 source archive directly from https://github.com/adafruit/Adafruit_nRF52_Arduino/archive/0.19.0.tar.gz
I can see that Adafruit_nRF52_Arduino-0.19.0/libraries/Wire/Wire.h lacks the extra overload methods that were part of #457.

I may still be missing something, but thought I would let you know.


2) Looking at the RTCLib code, I see a number calls to Wire._I2C_WRITE with an explicit (byte) cast. For example:

Code: Select all | TOGGLE FULL SIZE
void RTC_DS1307::adjust(const DateTime& dt) {
  Wire.beginTransmission(DS1307_ADDRESS);
  Wire._I2C_WRITE((byte)0); // start at location 0

Code: Select all | TOGGLE FULL SIZE
void RTC_PCF8523::adjust(const DateTime& dt) {
  Wire.beginTransmission(PCF8523_ADDRESS);
  Wire._I2C_WRITE((byte)3); // start at location 3


But not in this case:

Code: Select all | TOGGLE FULL SIZE
void RTC_DS3231::adjust(const DateTime& dt) {
  Wire.beginTransmission(DS3231_ADDRESS);
  Wire._I2C_WRITE(DS3231_TIME); // start at location 0


I initially got my Sense board working with "(byte)DS3231_TIME" before I found this thread. DS3231_TIME is 0x00, and a few posts talk about how that specific value is ambiguous:
https://stackoverflow.com/questions/204 ... -ambiguous
https://forum.arduino.cc/index.php?topi ... #msg731722

So, would it be prudent to explicitly cast DS3231_TIME with (byte)?

I can submit a pull request to Adafruit/RTCLib for issue #136 if that's helpful.

Obviously there are more important things going on right now, this is no emergency. Stay safe!

colindgrant
 
Posts: 2
Joined: Thu Dec 12, 2019 9:42 pm

Re: RTClib 1.4.0 error (no error with 1.3.4)

by henrygab on Sat Apr 18, 2020 9:26 pm

You are correct that the fixes were made just after the snap for 0.19.0. It should be in the next release, but based on the detective work you've already shown, I think you may already have realized this. There is no PR per se that you can offer, as the fix is already in the master branch, and thus will be in the next release.

henrygab
 
Posts: 4
Joined: Wed Feb 13, 2019 11:24 pm

Please be positive and constructive with your questions and comments.