-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wire i2cread returned error 263 with periodic polling #8056
Comments
can you try installing the core from git and specifically using the |
How to install a custom version of esp32 arduino on Linux? I've cloned the repo to |
mkdir -p ~/Arduino/hardware/espressif
git clone https://github.com/espressif/arduino-esp32 -b esp-idf-v5.1-libs ~/Arduino/hardware/espressif/esp32
cd ~/Arduino/hardware/espressif/esp32/tools
python3 get.py |
Thanks for the snipped, it worked out. But I'm getting other errors:
|
So if I set 1000 Hz freq, what
? |
|
Should be |
Something fishy is going on:
I know about
Of course, that's what I'm doing in the code. |
@dizcza you can check this updated example for use: https://github.com/espressif/arduino-esp32/blob/esp-idf-v5.1-libs/libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino |
Well, the RepeatTimer example has the very same behavior:
Note that you need to add a small delay, say 100 ms, after And the timer callback, of course, is never executed. |
Looks like I'm reaping arduino bugs today! |
Hi, I have the same sporadic error with Adafruit_MCP23X17 lib, doing constant mcp.digitalRead(i). |
Hi, I found myself in a similar situation. The problem in my case is that the I2C timeout is fixed to 1 second, the value set by Hint in the source code is here: #define I2C_CMD_ALIVE_INTERVAL_TICK (1000 / portTICK_PERIOD_MS)
esp_err_t i2c_master_cmd_begin(i2c_port_t i2c_num, i2c_cmd_handle_t cmd_handle, TickType_t ticks_to_wait)
{
...
if (wait_time - ticks_start > ticks_to_wait) { // out of time
wait_time = I2C_CMD_ALIVE_INTERVAL_TICK;
} else {
wait_time = ticks_to_wait - (wait_time - ticks_start);
if (wait_time < I2C_CMD_ALIVE_INTERVAL_TICK) {
wait_time = I2C_CMD_ALIVE_INTERVAL_TICK;
}
}
...
} It seems the IDF I2C driver is overriding user specified timeout with a fixed timeout of 1000 milliseconds. That's awful, because it must be fixed there before you can get it working properly on the Arduino framework now. In my case I'm using a modified version of SoftwareWire, until I find a better solution. |
@ppescher thanks, this has been driving me crazy. |
Hello, there's no branch |
@matiasbarone I believe that branch has been merged into Master. https://github.com/espressif/arduino-esp32/releases/tag/3.0.0-alpha2 |
Thanks. I used the banch But I still geting the error 263
Im ussing a ESP32-S2 with:
|
Sanity check: are IO pins 8, 9 available on S2 version? On my ESP32-32UE WROOM module GPIO 6-11 are connected to internal flash. |
Nothing changed in v5.1 with regards to the I2C timeout issue: Whatever timeout you pass to that function, no less than 1 second timeout is used when waiting for the I2C transaction to complete. I think we should really open an issue in the esp-idf repository for this. |
@ppescher Good analysis. I encourage you to open an issue there. |
I'm using the ESP32-S2-SOLO module. GPIO8 and GPIO9 are free. Checking this I notice that my circuit is conected to pin8 and pin9 that are GPIO15, GPIO16.
Thanks. |
I have same issue on ESP32-S3 with 2.0.11. What is really strange is SDA acts like SCL (checked with scope) meaning it has constant clock and SDA is actually looking licke clock while trying to do periodic (using Adafruid ADXL335 library). SCL seems to be dead flat. What is even more bizzare I only send request once per 500ms and data is being sent constantly for some reason - setTimeOut also does nothing. Stranger even is the fact that pinout is correct as sensor reports correctly and swapping them around causes .begin() to fail! Same board with ESP32 with same parts works correctly. #define I2C_SCL 42
#define I2C_SDA 41 |
m5unified works lovyan is broken - i2c issue espressif/arduino-esp32#8056
Board
Frogboard
Device Description
A regular Frogboard.
Hardware Configuration
SDA: 21
SCL: 22
Version
v2.0.4
IDE Name
Arduino IDE
Operating System
Ubuntu 22.04
Flash frequency
Default
PSRAM enabled
no
Upload speed
921600
Description
Polling an I2C sensor (Sensirion SDP810-125) at 1000 Hz
Could be related to #7209 --> It's not a library- or sensor-specific issue.
I mean, it's the Wire issue - one of the most used components of ESP32 arduino.
I have no problems whatsoever running a corresponding code with ESP-IDF v5.1 & master branch with the same I2C clock speed and timer interrupt (it works even at higher sampling rates: up to 1900 Hz, the sensor limit).
Sketch
Install https://github.com/UT2UH/SDP3x-Arduino.
SDPSampler.cpp
:SDPSampler.h
:Debug Message
Expected: no errors.
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: