Hi, I am trying to use a DS3231 with ESP32, using Arduino IDE. with lib RCTlib installed, and loading the example, ds3231. I have the ESP32 board installed and can upload Blink to the ESP32 and it works.
When trying to upload the ds3231 example it fails with this message I don’t understand. Can anyone shine a light on this please.
C:\Users\Richard\Documents\Arduino\Sketches\libraries\RTClib\src\RTC_DS1307.cpp: In member function ‘void RTC_DS1307::writenvram(uint8_t, const uint8_t*, uint8_t)’:
C:\Users\Richard\Documents\Arduino\Sketches\libraries\RTClib\src\RTC_DS1307.cpp:109:47: error: invalid conversion from ‘const uint8_t* {aka const unsigned char*}’ to ‘uint8_t* {aka unsigned char*}’ [-fpermissive]
i2c_dev->write(buf, size, true, &addrByte, 1);
^
In file included from C:\Users\Richard\Documents\Arduino\Sketches\libraries\RTClib\src\RTClib.h:25:0,
from C:\Users\Richard\Documents\Arduino\Sketches\libraries\RTClib\src\RTC_DS1307.cpp:1:
C:\Users\Richard\Documents\Arduino\Sketches\libraries\Adafruit_BusIO/Adafruit_I2CDevice.h:15:8: note: initializing argument 1 of ‘bool Adafruit_I2CDevice::write(uint8_t*, size_t, bool, uint8_t*, size_t)’
bool write(uint8_t *buffer, size_t len, bool stop = true,
^
exit status 1
Error compiling for board DOIT ESP32 DEVKIT V1.
(Note: it loads OK if I use Platformio)
Hi.
You probably need to downgrade the ESP32 boards installation.
Go to Tools > boards > boards manager > ESP32 and downgrade.
That will probably solve the issue.
Regards,
Sara
Hi Sara, Thanks for your reply, My Esp32 board was at 1.0.4, so upgrade to 1.0.6 , (still the same so) downgraded to 1.0.2 and it’s still the same.
In the error it talks about a DS1307
C:\Users\Richard\Documents\Arduino\Sketches\libraries\RTClib\src\RTC_DS1307.cpp: In member function ‘void RTC_DS1307::writenvram(uint8_t, const uint8_t*, uint8_t)’:
This error comes up when just even verifying the code.
The RTClib Library is 2.0.3
Hi Sara, You have point me in the right direction.
Tried a combination. Result ESP32 Board latest version 1.0.6 with RTClib version 2.0.2
RTClib versions 2.0.2 or 2.0.3 causes the error.
many thanks