Weird situation that when I enable oled wifi fails to send data

RyanDe
Posts: 3
Joined: Fri Jan 24, 2025 6:45 pm

Weird situation that when I enable oled wifi fails to send data

Postby RyanDe » Wed Jan 29, 2025 7:24 pm

I'm stumped. The wifi posts data to a service and is working well so I then add a display to get some feedback. After I setup the oled the post starts to fail, it starts to send data but then stops and eventually fails. If I remove the oled init, it works again. By debugging I've tracked it down to the esp_lcd_new_panel_io_i2c call, if that's called then the post will fail to send. If I return before that everything works as expected (besides oled). At first I thought memory but I have plenty of free stack/heap that I can tell as this is what it looks like before the wifi post and it doesn't fail on out of memory. This is a xiao esp32s3 chip, maybe something up with hardare? Interference with i2c? Power?

Code: Select all

 (2280) I2S_MIC: Free stack space: 1032
I (2281) NETWORK: Free heap size: 7360908
I (2285) I2S_MIC: Free PSRAM: 7320516

Code: Select all

[ 12409][E][NetworkClientSecure.cpp:244] write(): Closing connection on failed write
[ 12418][W][HTTPClient.cpp:602] sendRequest(): Failed to send chunk! Lets wait a bit
[ 12525][E][HTTPClient.cpp:606] sendRequest(): Failed to send chunk!
[ 12531][W][HTTPClient.cpp:1421] returnError(): error(-3): send payload failed
[ 12539][E][NetworkClient.cpp:323] setSocketOption(): fail on 0, errno: 9, "Bad file number"

Code: Select all

  esp_lcd_panel_io_handle_t io_handle = NULL;
  esp_lcd_panel_io_i2c_config_t io_config = {
      .dev_addr = EXAMPLE_I2C_HW_ADDR,
      .scl_speed_hz = EXAMPLE_LCD_PIXEL_CLOCK_HZ,
      .control_phase_bytes = 1,               // According to SSD1306 datasheet
      .lcd_cmd_bits = EXAMPLE_LCD_CMD_BITS,   // According to SSD1306 datasheet
      .lcd_param_bits = EXAMPLE_LCD_CMD_BITS, // According to SSD1306 datasheet
      .dc_bit_offset = 6,                     // According to SSD1306 datasheet
                                              // .flags = {
                                              //     .disable_control_phase = true,
                                              // },
  };
  ESP_LOGI(TAG, "Free heap size: %u", (unsigned int)esp_get_free_heap_size());
  int ret = esp_lcd_new_panel_io_i2c(i2c_bus, &io_config, &io_handle);
  ESP_LOGW(TAG, "%d", ret);
  ESP_ERROR_CHECK(ret);
  ESP_LOGI(TAG, "Free heap size: %u", (unsigned int)esp_get_free_heap_size());
What's odd is I've tried both the arduino secure client as well as just idf directly, same result. I even tried a different endpoint since the first was sending a lot of data through a json payload so I sent it via post intead. Same result, fails to send if the oled is enabled.

It's powered by usb so I can't imagine it's a power issue, I don't have the tools to check this easily though. Any thoughts?

Who is online

Users browsing this forum: No registered users and 90 guests