<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[AtomS3R M12 camera sync lines and image quality issue with esphome]]></title><description><![CDATA[<p dir="auto">I'm trying to install esphome and I'm experiencing very poor camera image quality (the horizontal line is scanning from top to bottom and the vertical lines seems to be sync lines).<img src="/assets/uploads/files/1773834378794-capture-3.jpg" alt="capture (3).jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">The demo application that came with the device had much better image quality, so I'm reasonably sure it's not the hardware.</p>
<p dir="auto">Here's my yaml config, it's based on the official example (<a href="https://docs.m5stack.com/en/homeassistant/camera/atoms3r_m12" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.m5stack.com/en/homeassistant/camera/atoms3r_m12</a>):</p>
<pre><code>esphome:
  name: atoms3r-m12
  friendly_name: M5Stack AtomS3R M12
  on_boot:
    priority: 800
    then:
      - lambda: |-
          gpio_set_direction(GPIO_NUM_18, GPIO_MODE_OUTPUT);
          gpio_set_level(GPIO_NUM_18, 0);  
          vTaskDelay(pdMS_TO_TICKS(1500)); 
esp32:
  variant: esp32s3
  framework:
    type: esp-idf

# Enable logging
logger:
  level: DEBUG   

# Enable Home Assistant API
api:
  encryption:
    key: "42....0="

ota:
  - platform: esphome
    password: "T.....t"

wifi:
  ssid: secret_ssid
  password: secret_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Camera Fallback Hotspot"
    password: "sRgT7413"

external_components:
  - source: github://DennisGaida/m5stack-atoms3r-components@main
    components: [bmi270_bmm150]

captive_portal:

web_server:
  port: 80

psram:
  mode: octal
  speed: 80MHz 

i2c:
  - id: BMi270
    sda: GPIO45
    scl: GPIO0
  - id: camera_i2c
    sda: GPIO12
    scl: GPIO9
    frequency: 100kHz  
    timeout: 10ms        
    scan: true          

sensor:
  - platform: bmi270_bmm150
    i2c_id: BMi270
    address: 0x68
    update_interval: 5s
    acceleration_x:
      name: "BMI270 Accel X"
    acceleration_y:
      name: "BMI270 Accel Y"
    acceleration_z:
      name: "BMI270 Accel z"
    gyroscope_x:
      name: "BMI270 Gyro X"
    gyroscope_y:
      name: "BMI270 Gyro Y"
    gyroscope_z:
      name: "BMI270 Gyro z"
    temperature:
      name: "BMI270 Temperature"
  - platform: wifi_signal
    name: "WiFi Signal"
    update_interval: 60s
    unit_of_measurement: "dBm"
    accuracy_decimals: 0

text_sensor:
  - platform: wifi_info
    ip_address:
      name: "IP Address"
    ssid:
      name: "Connected SSID"
    mac_address:
      name: "MAC Address"

button:
  - platform: restart
    name: "Restart ESP"

esp32_camera:
  name: "OV3660 Camera"
  external_clock:
    pin: GPIO21
    frequency: 20MHz
  i2c_id: camera_i2c
  data_pins: [GPIO3, GPIO42, GPIO46, GPIO48, GPIO4, GPIO17, GPIO11, GPIO13]
  vsync_pin: GPIO10
  href_pin: GPIO14
  pixel_clock_pin: GPIO40
  resolution: 640x480
  jpeg_quality: 15
  test_pattern: True

esp32_camera_web_server:
  - port: 8080
    mode: stream
  - port: 8081
    mode: snapshot
</code></pre>
<p dir="auto">Here's an extract from the build log with issues:</p>
<pre><code>Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyACM0 with baud rate 115200
[13:37:49.066]e:123]: Unsuccessful boot attempts: 0
[13:37:49.066][D][esp32.preferences:153]: Writing 1 items: 0 cached, 1 written, 0 failed
[13:37:49.066][I][app:091]: Running through setup()
[13:37:49.066][I][i2c.idf:206]: Performing bus recovery
[13:37:49.074][I][i2c.idf:206]: Performing bus recovery
[13:37:49.075][E][i2c.idf:243]: Recovery failed: SCL is held LOW on the bus
[13:38:00.278][C][component:278]: Setup i2c took 11203ms
[13:38:01.778][C][component:278]: Setup esphome.coroutine took 1499ms
[13:38:01.780][C][bmi270_bmm150:483]: Setting up BMI270 ...
[13:38:01.782][D][bmi270_bmm150:491]: Soft reset...
[13:38:01.785][D][text_sensor:113]: 'MAC Address' &gt;&gt; 'B4:3A:45:BE:18:4C'
[13:38:02.167][C][component:278]: Setup esp32_camera took 380ms
[13:38:02.177][C][wifi:610]: Starting
[13:38:02.231][D][wifi:1263]: Starting scan
[13:38:02.233][C][component:278]: Setup wifi took 65ms
[13:38:02.240][W][component:422]: api set Warning flag: unspecified
[13:38:02.245][I][app:138]: setup() finished successfully!
</code></pre>
<pre><code>[13:38:03.794][C][i2c.idf:093]: I2C Bus:
[13:38:03.794][C][i2c.idf:094]:   SDA Pin: GPIO12
[13:38:03.794][C][i2c.idf:094]:   SCL Pin: GPIO9
[13:38:03.794][C][i2c.idf:094]:   Frequency: 100000 Hz
[13:38:03.794][C][i2c.idf:100]:   Timeout: 10000us
[13:38:03.798][C][i2c.idf:107]:   Recovery: failed, SCL is held low on the bus
[13:38:03.798][C][i2c.idf:114]: Results from bus scan:
[13:38:03.798][C][i2c.idf:116]: Found no devices
[13:38:03.813][C][psram:016]: PSRAM:
[13:38:03.814][C][psram:019]:   Available: YES
[13:38:03.815][C][psram:021]:   Size: 8192 KB
</code></pre>
<p dir="auto">Things I already tried:</p>
<ul>
<li>Changing up and down clock frequencies</li>
<li>activating/deactivating aec/agc, changing aec/agc settings</li>
<li>changing brightness</li>
<li>Messing around with the lambda (this got rid of the "Recovery: failed, SCL is held low" but the camera issue remains):</li>
</ul>
<pre><code>          // 1. Enable I2C/Sensor Power (GPIO18 LOW)
          gpio_set_direction(GPIO_NUM_18, GPIO_MODE_OUTPUT);
          gpio_set_level(GPIO_NUM_18, 0);  
          
          // 2. Hardware Reset the Camera (GPIO38)
          // The sensor needs a LOW pulse to reset properly.
          gpio_set_direction(GPIO_NUM_38, GPIO_MODE_OUTPUT);
          gpio_set_level(GPIO_NUM_38, 0); // Reset active
          vTaskDelay(pdMS_TO_TICKS(100));
          gpio_set_level(GPIO_NUM_38, 1); // Reset released
          
          // 3. Give the hardware time to stabilize after power-up
          vTaskDelay(pdMS_TO_TICKS(1000));
</code></pre>
<ul>
<li>Disabling sensors</li>
</ul>
<p dir="auto">Any help in fixing the issue would be appreciated.</p>
]]></description><link>https://community.m5stack.com/topic/8142/atoms3r-m12-camera-sync-lines-and-image-quality-issue-with-esphome</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 16:41:48 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/8142.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Mar 2026 12:13:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to AtomS3R M12 camera sync lines and image quality issue with esphome on Thu, 19 Mar 2026 08:45:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/shaulliv" aria-label="Profile: shaulliv">@<bdi>shaulliv</bdi></a><br />
I also tried changing the following settings:</p>
<pre><code>  frame_buffer_count: 2
  frame_buffer_location: dram
</code></pre>
<p dir="auto">and</p>
<pre><code>priority: 1000
</code></pre>
<p dir="auto">lowered resolution to 320X240.<br />
and</p>
<pre><code>External_Clock frequency: 8MHz
</code></pre>
<p dir="auto">All without success.</p>
]]></description><link>https://community.m5stack.com/post/30790</link><guid isPermaLink="true">https://community.m5stack.com/post/30790</guid><dc:creator><![CDATA[shaulliv]]></dc:creator><pubDate>Thu, 19 Mar 2026 08:45:23 GMT</pubDate></item></channel></rss>