esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

ai-tinker esp32-cam onboard camera ov2614 not work #127

Closed hellerxx closed 5 years ago

hellerxx commented 5 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.):

ESP (ESP32/ESP8266, Board/Sonoff):

ESP-32,Ai-tinker ESP32-CAM

Affected component:

https://beta.esphome.io/components/esp32_camera.html

Description of problem: The board pin connect in: https://github.com/donny681/ESP32_CAMERA_QR

Problem-relevant YAML-configuration entries:

esphome:
  name: door
  platform: ESP32
  board: esp-wrover-kit

wifi:
  ssid: "ssid"
  password: "pw"

esp32_camera:
  name: My Camera
  external_clock:
    pin: GPIO0
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  resolution: 640x480
  jpeg_quality: 10
  test_pattern: true

Traceback (if applicable):

INFO Reading configuration...
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[16:42:40]ets Jun  8��16 00:2&��SH
[16:42:40]rs���� (POWE���%UMQ�,boot:0x13B�A%}MQ}1ASH_BOOTJC��˙��ͥ�� 0, SPIW��xee
[16:42:40]cl�E���0x00)}drv:0x00�}����0x0b��_drv:��0,hd_drv'��0,wp_d.����0
[16:42:40]m���DOUT, ,�k��div:2C!�+��0x3�����bb���4
[16:42:40]load:0�fff001c,���928
[16:42:40]h�tail 12�����4
[16:42:40]l+��0x4007���,len:92�j
[16:42:40]load:0�0080400,���5860
[16:42:40]e���0x400��98
[16:42:40][I][logger:119]: Log initialized
[16:42:40][C][ota:479]: There have been 1 suspected unsuccessful boot attempts.
[16:42:40][I][application:055]: Running through setup()...
[16:42:40]SCCB_Write [ff]=01 failed
[16:42:40]SCCB_Write [12]=80 failed
[16:42:41][E][camera.c:1085] esp_camera_init(): Camera probe failed with error 0x20001
[16:42:41][E][esp32_camera:018]: esp_camera_init failed: ERROR
[16:42:41][E][component:151]: Component was marked as failed.
[16:42:41][C][wifi:027]: Setting up WiFi...
[16:42:41][D][wifi:246]: Starting scan...
[16:42:43][D][wifi:261]: Found networks:
[16:42:43][I][wifi:295]: - 'chouguagua' [redacted]▂▄▆█
[16:42:43][D][wifi:296]:     Channel: 10
[16:42:43][D][wifi:297]:     RSSI: -56 dB
[16:42:43][D][wifi:299]: - [redacted] [redacted]▂▄▆█
[16:42:43][D][wifi:299]: - [redacted] [redacted]▂▄▆█
[16:42:43][D][wifi:299]: - [redacted] [redacted]▂▄▆█
[16:42:43][D][wifi:299]: - [redacted] [redacted]▂▄▆█
[16:42:43][D][wifi:299]: - [redacted] [redacted]▂▄▆█
[16:42:43][D][wifi:299]: - [redacted] [redacted]▂▄▆█
[16:42:43][D][wifi:299]: - [redacted] [redacted]▂▄▆█
[16:42:43][D][wifi:299]: - [redacted] [redacted]▂▄▆█
[16:42:43][D][wifi:299]: - [redacted] [redacted]▂▄▆█
[16:42:44][D][wifi:299]: - [redacted] [redacted]▂▄▆█
[16:42:44][I][wifi:167]: WiFi Connecting to 'chouguagua'...
[16:42:44][I][wifi:340]: WiFi connected!
[16:42:44][C][wifi:228]:   SSID: [redacted]
[16:42:44][C][wifi:229]:   IP Address: 192.168.10.14
[16:42:44][C][wifi:231]:   BSSID: [redacted]
[16:42:44][C][wifi:232]:   Hostname: 'door'
[16:42:45][C][wifi:236]:   Signal strength: -57 dB ▂▄▆█
[16:42:45][C][wifi:237]:   Channel: 10
[16:42:45][C][wifi:238]:   Subnet: 255.255.255.0
[16:42:45][C][wifi:239]:   Gateway: 192.168.10.1
[16:42:45][C][wifi:240]:   DNS1: 1.1.1.1
[16:42:45][C][wifi:241]:   DNS2: 1.0.0.1
[16:42:45][C][api:023]: Setting up Home Assistant API server...
[16:42:45][C][ota:127]: Over-The-Air Updates:
[16:42:45][C][ota:128]:   Address: 192.168.10.14:3232
[16:42:45][C][ota:130]:   Using Password.
[16:42:45][I][application:089]: setup() finished successfully!
[16:42:45][I][application:097]: esphome-core version 1.13.0-dev compiled on Mar 14 2019, 16:29:34
[16:42:45][C][wifi:332]: WiFi:
[16:42:45][C][wifi:228]:   SSID: [redacted]
[16:42:45][C][wifi:229]:   IP Address: 192.168.10.14
[16:42:45][C][wifi:231]:   BSSID: [redacted]
[16:42:45][C][wifi:232]:   Hostname: 'door'
[16:42:45][C][wifi:236]:   Signal strength: -62 dB ▂▄▆█
[16:42:45][C][wifi:237]:   Channel: 10
[16:42:45][C][wifi:238]:   Subnet: 255.255.255.0
[16:42:45][C][wifi:239]:   Gateway: 192.168.10.1
[16:42:45][C][wifi:240]:   DNS1: 1.1.1.1
[16:42:45][C][wifi:241]:   DNS2: 1.0.0.1
[16:42:45][C][logger:142]: Logger:
[16:42:45][C][logger:143]:   Level: DEBUG
[16:42:45][C][logger:144]:   Log Baud Rate: 115200
[16:42:45][C][logger:145]:   Hardware UART: UART0
[16:42:45][C][esp32_camera:044]: ESP32 Camera:
[16:42:45][C][esp32_camera:045]:   Name: My Camera
[16:42:45][C][esp32_camera:046]:   Board Has PSRAM: NO
[16:42:45][C][esp32_camera:048]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[16:42:45][C][esp32_camera:049]:   VSYNC Pin: 25
[16:42:45][C][esp32_camera:050]:   HREF Pin: 23
[16:42:45][C][esp32_camera:051]:   Pixel Clock Pin: 22
[16:42:45][C][esp32_camera:052]:   External Clock: Pin:0 Frequency:20000000
[16:42:45][C][esp32_camera:053]:   I2C Pins: SDA:26 SCL:27
[16:42:45][C][esp32_camera:054]:   Reset Pin: -1
[16:42:45][C][esp32_camera:075]:   Resolution: 640x480 (VGA)
[16:42:45][E][esp32_camera:092]:   Setup Failed: ERROR
[16:42:45][C][api:099]: API Server:
[16:42:45][C][api:100]:   Address: 192.168.10.14:6053
[16:42:45][C][ota:127]: Over-The-Air Updates:
[16:42:45][C][ota:128]:   Address: 192.168.10.14:3232
[16:42:45][C][ota:130]:   Using Password.
[16:42:45][I][application:109]: Running through first loop()
[16:42:45][I][application:136]: First loop finished successfully!

Additional information and things you've tried:

OttoWinter commented 5 years ago

The camera is completely handled by the esp32-camera library, so any issue would be upstream there.

The issue must be somewhere in the i2c or powerdown related pins - looking at this example the power down pin does exist at pin GPIO32. Can you try enabling that?

hellerxx commented 5 years ago

yap! working!! lose the powerdown pin in .yaml. now, how to use the camera in webstream or homeassistant? the component example not stated and the camera working in 800x600, but 1024x768 or higher, the board run-time error.

[00:04:27]e���0x��‚�98C�[I][logger:119]: Log initialized [00:04:27][C][ota:479]: There have been 1 suspected unsuccessful boot attempts. [00:04:27][I][application:055]: Running through setup()... [00:04:27][E][camera.c:233] camera_fb_init(): Allocating 153 KB frame buffer Failed [00:04:27][E][camera.c:1007] camera_init(): Failed to allocate frame buffer [00:04:27]E (182) gpio: gpio_isr_handler_remove(380): GPIO isr service is not installed, call gpio_install_isr_service() first [00:04:27][E][camera.c:1104] esp_camera_init(): Camera init failed with error 0x101 [00:04:27][E][esp32_camera:018]: esp_camera_init failed: ESP_ERR_NO_MEM [00:04:27][E][component:151]: Component was marked as failed.

OttoWinter commented 5 years ago

how to use the camera in webstream or homeassistant?

for that you need to use a dev homeassistant instance for now. The camera integration in HA has not been merged yet. You need to install HA from this PR: https://github.com/home-assistant/home-assistant/pull/22107/files

and the camera working in 800x600, but 1024x768 or higher, the board run-time error.

The error you're seeing means your module does not have enough RAM for that resolution. For higher resolutions you need boards with external PSRAM.

OttoWinter commented 5 years ago

I will close this issue because the camera is working. If something else turns up re-open it.

hellerxx commented 5 years ago

The borad has PSRAM is not running,In Borad PSRAM chip is IPS6404LSQ. I try to other Borad model in list by M5Stack-fire; fm-devkit; esp32dev;node32s. I use it running by ESP-WHO at the 1600X1200 ,but in esphome not identifythe PSRAM chip, log: [C][esp32_camera:044]: ESP32 Camera: [C][esp32_camera:045]: Name: My Camera [C][esp32_camera:046]: Board Has PSRAM: NO

hellerxx commented 5 years ago

@OttoWinter

hellerxx commented 5 years ago

ok,thx~ add a borad list for best