espressif/esp32-camera

Camera cannot use existing I2C port

s60sc opened this issue · 2 comments

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

camera_probe() in esp_camera.c allows existing I2C port to be used if config->pin_sccb_sda set to -1

    if (config->pin_sccb_sda != -1) {
        ESP_LOGD(TAG, "Initializing SCCB");
        ret = SCCB_Init(config->pin_sccb_sda, config->pin_sccb_scl);
    } else {
        ESP_LOGD(TAG, "Using existing I2C port");
        ret = SCCB_Use_Port(config->sccb_i2c_port);
    }

Actual behavior (suspected bug)

However camera initialisation fails with error 0x102 because:

void *perimanGetPinBus(uint8_t pin, peripheral_bus_type_t type)

expects a uint8_t pin value

[  1222][E][esp32-hal-periman.c:180] perimanGetPinBus(): Invalid pin: 255
[  1222][E][esp32-hal-gpio.c:176] __digitalWrite(): IO 255 is not set as GPIO.
[  1328][E][esp32-hal-periman.c:180] perimanGetPinBus(): Invalid pin: 255
[  1328][E][esp32-hal-gpio.c:176] __digitalWrite(): IO 255 is not set as GPIO.

Error logs or terminal output

Steps to reproduce the behavior

 camera_config_t config;
  config.pin_sccb_sda = -1;

Project release version

arduino core v3.1.1

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Windows

Operating system version

Windows 11

Shell

ZSH

Additional context

No response

error comes from Arduino. You need to provide your Arduino code to check what you are doing wrong.

This issue appears to be stale. Please close it if its no longer valid.