I2C Slave Library Not Working

matt-s-SNAP
Posts: 1
Joined: Thu Jan 13, 2022 8:21 pm

I2C Slave Library Not Working

Postby matt-s-SNAP » Thu Jan 13, 2022 8:30 pm

I'm trying to set up an Olimex-POE module to work as an I2C slave. The docs provide an example of an I2C slave programme (https://docs.espressif.com/projects/ard ... eslave-ino). However, when I try to compile it it gives me the error:

Code: Select all

'class TwoWire' has no member named 'slaveWrite'
If I comment that line out, it also gives me the compilation error

Code: Select all

sketch/Olimex_Module.ino.cpp.o:(.literal._Z5setupv+0x1c): undefined reference to `TwoWire::onReceive(void (*)(int))'
sketch/Olimex_Module.ino.cpp.o:(.literal._Z5setupv+0x20): undefined reference to `TwoWire::onRequest(void (*)())'
sketch/Olimex_Module.ino.cpp.o: In function `setup()':
<my sketch path>/Olimex_Module/Olimex_Module.ino:38: undefined reference to `TwoWire::onReceive(void (*)(int))'
<my sketch path>/Olimex_Module/Olimex_Module.ino:38: undefined reference to `TwoWire::onRequest(void (*)())'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board OLIMEX ESP32-PoE.
Given that this is example code, I'm not sure how it could be failing. Maybe it's not reading the ESP32 wire library correctly?
Any help would be greatly appreciated.

aahmed7
Posts: 1
Joined: Sun Apr 10, 2022 7:30 am

Re: I2C Slave Library Not Working

Postby aahmed7 » Sun Apr 10, 2022 8:06 am

You need to install the latest development branch for this to work.

Check the following:
https://docs.espressif.com/projects/ard ... rduino-ide

You need to add the Development release link in the arduino ide boards.json and install the release 2.0.1-rc1 or later as these methods were added in this release. check the tag here:

https://github.com/espressif/arduino-es ... 041acce830

Who is online

Users browsing this forum: No registered users and 89 guests