Open CSHaze opened 2 years ago
Hi @CSHaze , Have you checked what's on the lines by a logic analyzer? And are the lines pulled up by resistors correctly?
Michael
Hi @ginkgm, unfortunately I do not have access to a logic analyzer.
The Htu21d board I am using has built in pull up resistors. I have also tried unsoldering them and using the esp32-s3 internal pull ups and neither seems to work on the esp32-s3. The weird thing is, everything works correctly on the old esp32 I have. I am trying to swap to the newer s3 board.
I should be getting a bme280 board in the next couple days and I will test with that.
Are there differences in the i2c config or calls between the esp32 and esp32-s3? I did not see any differences in the docs.
It might not be the cause of the issue here, but could you try to zero-initialize the config structure (i2c_config_t) before filling it?
Currently there is a field clk_flags
which isn't initialized and may contain random value from the stack.
Hi @ginkgm and @igrr. I just received a couple bme280 modules and i2c seems to be working fine.
Maybe I just have a couple of shoddy HTU21d modules. It is a little weird they seemed to work on the old esp32 though. Maybe due to differences in the internal clocks between the new and old esp32s?
We are also seeing some I2C issues on ESP32-S3, though it's in comparison with ESP32-S2. Specifically, LC709203, an I2C battery meter, does not work reliably. It can work longer at slow I2C bus speeds (tested at 10kHz) but eventually produces I2C protocol errors. Other devices such as MSA301 or BNO055 (which can do clock stretching) seen OK at normal speeds. We're still trying to characterize the problem.
(EDITED several times after I got a better comparison trace)
LC709203F comparison: maybe seeing a clock-stretching handling issue?
The first four transactions work, then the sensor does a long clock stretch. The clock stretch works on the S2 (bottom trace), but not the S3 (top trace)
Note that SDA goes high in the bad trace, which is odd.
I tried setting a 0.1sec I2C timeout, did not seem to help.
I cannot reproduce https://github.com/espressif/esp-idf/issues/8741#issuecomment-1124457602 in Arduino on S3, using https://github.com/adafruit/Adafruit_LC709203F/tree/master/examples/LC709203F_demo and removing the delay in loop()
. There are clock-stretches, but they don't cause issues above. The example above is from CircuitPython, which has an extra task and some other complications.
Hello,
I have same issue with ESP32-S3 Arduino IDE, i2C plug to lcd screen.
Hello, I just got a ESP32-S3HDevKitv1, and can't connect a I2C device to it. Can any one point me an example of how to configure the pins for I2C communication
same for me with heltec wifi kit 32 V3, no platformio module found for i2c but in arduino it is working with V3
Hey how did you configure pin 15&16 as i2c pins in ESP32-S3-Wroom-1, or are they by default i2c pins. Please help!!
Hi, on the heltec I used
`i2c:
sda: GPIO17 scl: GPIO18
scan: false frequency: 50khz`
Hi riker65,
could you please post a full code example for Heltec boards? I tried to establish I2C connections to a BME280 sensor on CubeCell HTTC AB-02 and an ESP32 LoRa board (both V3) but nothing works. I always get "no I2C device found" I tried the second I2C channel which should be SDA = pin9 and SCL = pin8. I also tried different I2C scanners and was wondering why they couldn't find the build in OLED display ..
Hi
see here,
just my prototype to get it working
hope this helps
pasting it as code leads to strange formating
here without code tags
---again: strange format. How do I supress those formating tags?
unfortunately have to redo it without the # inside
`#https://forum.hassiohelp.eu/d/536-display-oled-su-esp32-con-esphome
esphome: name: heltec2 platform: ESP32 board: esp32-s3-devkitc-1
wifi: ssid: !secret wifi_ssid password: !secret wifi_password
ap: ssid: "Oled2 Fallback Hotspot" password: "xxxx" captive_portal:
logger:
ota:
web_server: port: 80
switch:
platform: gpio pin: number: 36 id: mode restore_mode: RESTORE_DEFAULT_OFF
platform: gpio
name: "LED_Int"
pin:
number: 35
id: LED_Int
icon: "mdi:gate"
inverted: false
restore_mode: RESTORE_DEFAULT_OFF
i2c:
sda: GPIO17 scl: GPIO18 scan: false frequency: 50khz
font:
time:
display:
platform: ssd1306_i2c model: "SSD1306 128x64" reset_pin: GPIO21
address: 0x3C setup_priority: 0 id: my_display pages:
mqtt: broker: 192.168.0.1 username: !secret mqtt_user password: !secret mqtt_password
text_sensor:
@riker65 Not relevant here. ESPHome currently uses Arduino as core unless you explicitly define otherwise. Your question should be on their project instead.
I simply want to comment that I have observed similar issues as well where certain i2c chips behave differently between Wroom-32 and Wroom-S2/S3 as well. Specifically VL6180X chips and i2c touch panel. It renders those devices completely unusable on newer ESP32 so I look forward to seeing what you find.
Environment
Problem Description
I2C device communication that works on the standard ESP32 does not work on the ESP32-s3.
Expected Behavior
I would expect I2C functionality to work similarly on both devices.
Actual Behavior
I2C writes work correctly on the standard ESP32 but do not work on the ESP32-s3.
Steps to reproduce
Note: I have tried other libraries, communication calls, and configurations (pullups, clk freq, gpio, etc) through IC2, all of which are unable to write to the device. I figured this was the simplest example.
Code to reproduce this issue