• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 using DS3231

Q&A Forum › Category: ESP32 › ESP32 using DS3231
0 Vote Up Vote Down
Richard Funnell asked 3 years ago

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)

4 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

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

0 Vote Up Vote Down
Richard Funnell answered 3 years ago

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

0 Vote Up Vote Down
Richard Funnell answered 3 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.