RTCLib - Trinket don't work correctly
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- rivandemo
- Posts: 29
- Joined: Fri Feb 12, 2021 1:06 pm
Re: RTCLib - Trinket don't work correctly
I will do that with Trinket and RTC on a bread-board. I made 6 clocks, the first 3 having a separate PCB for the leds and 3 in which the leds are integrated on the main PCB. I kept the first one for me and gave the 5 others to my children and grand-daughters for Christmas last year. On the photo, the leds show 12h58.
- rivandemo
- Posts: 29
- Joined: Fri Feb 12, 2021 1:06 pm
Re: RTCLib - Trinket don't work correctly
I have installed RTClib version 1.14.0 but it didn't work until i added "Wire.begin()" in setup(). I will try the latest RTClib version but this time with Wire.begin().
- rivandemo
- Posts: 29
- Joined: Fri Feb 12, 2021 1:06 pm
Re: RTCLib - Trinket don't work correctly
Latest RTClib version doesn't work at all, here are the "red" lines extracted from the compilation report.
The most recent working version is 1.14.1
The most recent working version is 1.14.1
Code: Select all
/Users/rivdmoosdyk/Développements/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp: In member function 'bool Adafruit_I2CDevice::write(const uint8_t*, size_t, bool, const uint8_t*, size_t)':
/Users/rivdmoosdyk/Développements/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp:112:47: warning: invalid conversion from 'const uint8_t* {aka const unsigned char*}' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
if (_wire->write(prefix_buffer, prefix_len) != prefix_len) {
^
In file included from /Users/rivdmoosdyk/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15/libraries/Wire/Wire.h:24:0,
from /Users/rivdmoosdyk/Développements/libraries/Adafruit_BusIO/Adafruit_I2CDevice.h:5,
from /Users/rivdmoosdyk/Développements/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp:1:
/Users/rivdmoosdyk/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15/libraries/Wire/TinyWireM.h:62:19: note: initializing argument 1 of 'size_t TinyM_USI_TWI::write(uint8_t*, uint8_t)'
inline size_t write(uint8_t* d, uint8_t n) { uint16_t i; for (i = 0; i < n; i++) write(d[i]); return (size_t)n; }
^~~~~
/Users/rivdmoosdyk/Développements/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp:121:31: warning: invalid conversion from 'const uint8_t* {aka const unsigned char*}' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
if (_wire->write(buffer, len) != len) {
^
In file included from /Users/rivdmoosdyk/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15/libraries/Wire/Wire.h:24:0,
from /Users/rivdmoosdyk/Développements/libraries/Adafruit_BusIO/Adafruit_I2CDevice.h:5,
from /Users/rivdmoosdyk/Développements/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp:1:
/Users/rivdmoosdyk/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15/libraries/Wire/TinyWireM.h:62:19: note: initializing argument 1 of 'size_t TinyM_USI_TWI::write(uint8_t*, uint8_t)'
inline size_t write(uint8_t* d, uint8_t n) { uint16_t i; for (i = 0; i < n; i++) write(d[i]); return (size_t)n; }
^~~~~
/Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/WInterrupts.c: In function 'attachInterrupt':
/Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/WInterrupts.c:198:8: warning: #warning attachInterrupt may need some more work for this cpu (case 1) [-Wcpp]
#warning attachInterrupt may need some more work for this cpu (case 1)
^~~~~~~
/Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/WInterrupts.c: In function 'detachInterrupt':
/Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/WInterrupts.c:312:8: warning: #warning detachInterrupt may need some more work for this cpu (case 1) [-Wcpp]
#warning detachInterrupt may need some more work for this cpu (case 1)
^~~~~~~
In file included from /Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/WInterrupts.c:29:0:
/Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/WInterrupts.c: In function 'INT1_vect':
/Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/WInterrupts.c:373:15: warning: 'INT1_vect' appears to be a misspelled 'signal' handler, missing '__vector' prefix [-Wmisspelled-isr]
IMPLEMENT_ISR(INT1_vect, EXTERNAL_INT_1)
^
/Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/WInterrupts.c:373:1: note: in expansion of macro 'IMPLEMENT_ISR'
IMPLEMENT_ISR(INT1_vect, EXTERNAL_INT_1)
^~~~~~~~~~~~~
In file included from /Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/Tone.cpp:37:0:
/Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/Tone.cpp: In function 'void TIMER2_COMPA_vect()':
/Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/Tone.cpp:538:5: warning: 'TIMER2_COMPA_vect' appears to be a misspelled 'signal' handler, missing '__vector' prefix [-Wmisspelled-isr]
ISR(TIMER2_COMPA_vect)
^
- rivandemo
- Posts: 29
- Joined: Fri Feb 12, 2021 1:06 pm
Re: RTCLib - Trinket don't work correctly
To be complete i should describe my environment
Apple Macbook Air M1 (sept 2021), Mac OS Big Sur
I don't know whether this is relevant but the Java version is 10.0.2 but i don't know where this version comes from as according to the "O-racle" site no version is already available for M1.
That being said the problem is the same on my "old" Macbook Pro
Apple Macbook Air M1 (sept 2021), Mac OS Big Sur
I don't know whether this is relevant but the Java version is 10.0.2 but i don't know where this version comes from as according to the "O-racle" site no version is already available for M1.
That being said the problem is the same on my "old" Macbook Pro
- mikeysklar
- Posts: 14194
- Joined: Mon Aug 01, 2016 8:10 pm
Re: RTCLib - Trinket don't work correctly
I don’t think the MacOS / Java release is an issue. The compiler errors on the current RTClib looks like chip i2c emulation Wire problems that were part of the updated.
Glad to hear you could run the 1.14.1 release without issue when Wire.begin() was added.
If it is not too much trouble I’m curious which library release breaks compatibility for you on the 5v Trinket (atmega85). That would help me to find the change and we can open a github issue. I suspect it all about how Wire is invoked.
Glad to hear you could run the 1.14.1 release without issue when Wire.begin() was added.
If it is not too much trouble I’m curious which library release breaks compatibility for you on the 5v Trinket (atmega85). That would help me to find the change and we can open a github issue. I suspect it all about how Wire is invoked.
- rivandemo
- Posts: 29
- Joined: Fri Feb 12, 2021 1:06 pm
Re: RTCLib - Trinket don't work correctly
It is not completely clear to me. Do you want me to do other tests? With more recent RTClib version(s)?
I tested RTClib 2.0.0: compiles but dooesn't return correct values (for now.day())
I tested 1.14.2: compilation returns error messages:
The most recent RTClib OK version is 1.14.1
Anything else I should test?
I tested RTClib 2.0.0: compiles but dooesn't return correct values (for now.day())
I tested 1.14.2: compilation returns error messages:
Code: Select all
/var/folders/93/943hqqws21xdlw51bshh4s140000gn/T//ccpt15Ia.ltrans0.ltrans.o: In function `setup':
Plusieurs bibliothèque trouvées pour "Wire.h"
Utilisé : /Users/rivdmoosdyk/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15/libraries/Wire
Non utilisé : /Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/libraries/Wire
/Users/rivdmoosdyk/Développements/Arduino/Sketches/Binary-Clock-Setup/Binary-Clock-Setup.ino:91: undefined reference to `RTC_DS3231::adjust(DateTime const&)'
/Users/rivdmoosdyk/Développements/Arduino/Sketches/Binary-Clock-Setup/Binary-Clock-Setup.ino:95: undefined reference to `RTC_DS3231::now()'
/var/folders/93/943hqqws21xdlw51bshh4s140000gn/T//ccpt15Ia.ltrans0.ltrans.o: In function `loop':
/Users/rivdmoosdyk/Développements/Arduino/Sketches/Binary-Clock-Setup/Binary-Clock-Setup.ino:111: undefined reference to `RTC_DS3231::now()'
collect2: error: ld returned 1 exit status
Utilisation de la bibliothèque RTClib version 1.14.2 dans le dossier: /Users/rivdmoosdyk/Développements/libraries/RTClib
Utilisation de la bibliothèque Wire version 1.0 dans le dossier: /Users/rivdmoosdyk/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15/libraries/Wire
Utilisation de la bibliothèque EEPROM version 2.0 dans le dossier: /Users/rivdmoosdyk/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/libraries/EEPROM
exit status 1
Erreur de compilation pour la carte Adafruit Trinket (ATtiny85 @ 8MHz)
Anything else I should test?
- mikeysklar
- Posts: 14194
- Joined: Mon Aug 01, 2016 8:10 pm
Re: RTCLib - Trinket don't work correctly
I went ahead and looked at the changes to RTClib 2.0.0 since you have nailed down the version where things started going sideway with the ATtiny85.
There are 336 commits for the v2.0.0 release. I looked through them and the ones related to how the Wire library work are still the most suspect to me. That narrows it down to about 6 changes.
https://github.com/adafruit/RTClib/commits/2.0.0
If anything stands out please let me know. Otherwise this would be an excellent time to file an issue stating that rtc.adjust() stopped working on the ATtiny85 (Trinket 5v) with version 2.0.0 release. Then provide an example of Adafruit code that fails or a minimum viable case.
https://github.com/adafruit/RTClib/issues
There are 336 commits for the v2.0.0 release. I looked through them and the ones related to how the Wire library work are still the most suspect to me. That narrows it down to about 6 changes.
https://github.com/adafruit/RTClib/commits/2.0.0
If anything stands out please let me know. Otherwise this would be an excellent time to file an issue stating that rtc.adjust() stopped working on the ATtiny85 (Trinket 5v) with version 2.0.0 release. Then provide an example of Adafruit code that fails or a minimum viable case.
https://github.com/adafruit/RTClib/issues
- rivandemo
- Posts: 29
- Joined: Fri Feb 12, 2021 1:06 pm
Re: RTCLib - Trinket don't work correctly
I don't know whether this might help but i'm now using IDE 2.0.2 and RTClib v 2.1.1.
Sketches work OK but i get the compile errors below
Sketches work OK but i get the compile errors below
Code: Select all
/Users/rivdmoosdyk/Développements/Arduino/Sketches/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp: In member function 'bool Adafruit_I2CDevice::write(const uint8_t*, size_t, bool, const uint8_t*, size_t)':
/Users/rivdmoosdyk/Développements/Arduino/Sketches/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp:112:47: warning: invalid conversion from 'const uint8_t* {aka const unsigned char*}' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
if (_wire->write(prefix_buffer, prefix_len) != prefix_len) {
^
In file included from /Users/rivdmoosdyk/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15/libraries/Wire/Wire.h:24:0,
from /Users/rivdmoosdyk/Développements/Arduino/Sketches/libraries/Adafruit_BusIO/Adafruit_I2CDevice.h:5,
from /Users/rivdmoosdyk/Développements/Arduino/Sketches/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp:1:
/Users/rivdmoosdyk/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15/libraries/Wire/TinyWireM.h:62:19: note: initializing argument 1 of 'size_t TinyM_USI_TWI::write(uint8_t*, uint8_t)'
inline size_t write(uint8_t* d, uint8_t n) { uint16_t i; for (i = 0; i < n; i++) write(d[i]); return (size_t)n; }
^~~~~
/Users/rivdmoosdyk/Développements/Arduino/Sketches/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp:121:31: warning: invalid conversion from 'const uint8_t* {aka const unsigned char*}' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
if (_wire->write(buffer, len) != len) {
^
In file included from /Users/rivdmoosdyk/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15/libraries/Wire/Wire.h:24:0,
from /Users/rivdmoosdyk/Développements/Arduino/Sketches/libraries/Adafruit_BusIO/Adafruit_I2CDevice.h:5,
from /Users/rivdmoosdyk/Développements/Arduino/Sketches/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp:1:
/Users/rivdmoosdyk/Library/Arduino15/packages/adafruit/hardware/avr/1.4.15/libraries/Wire/TinyWireM.h:62:19: note: initializing argument 1 of 'size_t TinyM_USI_TWI::write(uint8_t*, uint8_t)'
inline size_t write(uint8_t* d, uint8_t n) { uint16_t i; for (i = 0; i < n; i++) write(d[i]); return (size_t)n; }
^~~~~
- mikeysklar
- Posts: 14194
- Joined: Mon Aug 01, 2016 8:10 pm
Re: RTCLib - Trinket don't work correctly
These are compiler notes and warnings. The newer compiler version that accompanies Arduino IDE 2.0.2 is more strict about syntax. This version of the IDE has only come out of beta a month (or so) ago.
Make sure you are running the latest release from github of these libraries. It looks like your TinyWireM might be from a different library.
https://github.com/adafruit/Adafruit_BusIO
https://github.com/adafruit/TinyWireM
You could also create an issue about the compile warnings with the Arduino IDE 2.x with the respective repos.
Make sure you are running the latest release from github of these libraries. It looks like your TinyWireM might be from a different library.
https://github.com/adafruit/Adafruit_BusIO
https://github.com/adafruit/TinyWireM
You could also create an issue about the compile warnings with the Arduino IDE 2.x with the respective repos.
Please be positive and constructive with your questions and comments.