ESP32 crashes with Grow R503 fingerprint sensor

Hi guys,

I’m trying to make the Grow R503 work with my ESP32 WROOM-32, but it crashes. I’m using ESPHome version 2024.2.2

My configuration:

esphome:
  name: bearcave-entry

esp32:
  board: az-delivery-devkit-v4
  framework:
    type: arduino

# Enable logging
logger:

ota:
  password: "xxx"

wifi:
  ssid: "mynet"
  password: "xxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bearcave-Entry"
    password: "xxx"

mdns:
  disabled: false

uart:
  rx_pin: GPIO21
  tx_pin: GPIO22
  baud_rate: 57600

fingerprint_grow:
  sensing_pin: GPIO23
  on_finger_scan_invalid:
    - homeassistant.event:
        event: esphome.test_node_finger_scan_invalid
  on_finger_scan_matched:
    - homeassistant.event:
        event: esphome.test_node_finger_scan_matched
        data:
          finger_id: !lambda 'return finger_id;'
          confidence: !lambda 'return confidence;'
  on_finger_scan_unmatched:
    - homeassistant.event:
        event: esphome.test_node_finger_scan_unmatched
  on_finger_scan_misplaced:
    - homeassistant.event:
        event: esphome.frontdoor_finger_scan_misplaced
  on_enrollment_scan:
    - homeassistant.event:
        event: esphome.test_node_enrollment_scan
        data:
          finger_id: !lambda 'return finger_id;'
          scan_num: !lambda 'return scan_num;'
  on_enrollment_done:
    - homeassistant.event:
        event: esphome.test_node_enrollment_done
        data:
          finger_id: !lambda 'return finger_id;'
  on_enrollment_failed:
    - homeassistant.event:
        event: esphome.test_node_enrollment_failed
        data:
          finger_id: !lambda 'return finger_id;'

api:
  encryption:
    key: "xxx"
  services:
  - service: enroll
    variables:
      finger_id: int
      num_scans: int
    then:
      - fingerprint_grow.enroll:
          finger_id: !lambda 'return finger_id;'
          num_scans: !lambda 'return num_scans;'
  - service: cancel_enroll
    then:
      - fingerprint_grow.cancel_enroll:
  - service: delete
    variables:
      finger_id: int
    then:
      - fingerprint_grow.delete:
          finger_id: !lambda 'return finger_id;'
  - service: delete_all
    then:
      - fingerprint_grow.delete_all:

Both the power supply and touch induction power supply of the R503 are connected to 3.3V

Log:

...
[18:03:53][I][logger:359]: Log initialized
[18:03:53][C][ota:483]: There have been 1 suspected unsuccessful boot attempts.
[18:03:53][D][esp32.preferences:114]: Saving 1 preferences to flash...
[18:03:53][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[18:03:53][I][app:029]: Running through setup()...
[18:03:53][C][uart.arduino_esp32:077]: Setting up UART...
[18:03:53][C][fingerprint_grow:055]: Setting up Grow Fingerprint Reader...
[18:03:53][D][fingerprint_grow:205]: Checking password
[18:03:53][D][fingerprint_grow:210]: Password verified
[18:03:53][D][fingerprint_grow:233]: Getting parameters
[18:03:53][D][fingerprint_grow:236]: Got parameters
[18:03:53][D][fingerprint_grow:258]: Getting fingerprint count
[18:03:53][D][fingerprint_grow:261]: Got fingerprint count
[18:03:53][C][wifi:038]: Setting up WiFi...
[18:03:53][C][wifi:051]: Starting WiFi...
[18:03:53][C][wifi:052]:   Local MAC: B0:A7:32:D7:52:00
[18:03:54][D][wifi:459]: Starting scan...
[18:03:54][D][fingerprint_grow:098]: Scan and match
[18:03:54][D][fingerprint_grow:129]: Getting image 1
[18:03:54][D][fingerprint_grow:141]: Finger Misplaced
[18:03:54][W][component:214]: Component fingerprint_grow took a long time for an operation (0.09 s).
[18:03:54][W][component:215]: Components should block for at most 20-30ms.
[18:03:56][D][fingerprint_grow:098]: Scan and match
[18:03:56][D][fingerprint_grow:129]: Getting image 1
[18:03:56][D][fingerprint_grow:141]: Finger Misplaced
[18:03:56][W][component:214]: Component fingerprint_grow took a long time for an operation (0.09 s).
[18:03:56][W][component:215]: Components should block for at most 20-30ms.
[18:03:57][D][fingerprint_grow:098]: Scan and match
[18:03:57][D][fingerprint_grow:129]: Getting image 1
[18:03:57][D][fingerprint_grow:141]: Finger Misplaced
[18:03:59][D][fingerprint_grow:098]: Scan and match
[18:03:59][D][fingerprint_grow:129]: Getting image 1
[18:03:59][D][fingerprint_grow:141]: Finger Misplaced
[18:04:00][W][component:214]: Component fingerprint_grow took a long time for an operation (0.17 s).
[18:04:00][W][component:215]: Components should block for at most 20-30ms.
[18:04:00][D][wifi:474]: Found networks:
[18:04:00][I][wifi:518]: - 'mynet2' (8C:FD:DE:33:AC:4C) ▂▄▆█
[18:04:00][D][wifi:519]:     Channel: 5
[18:04:00][D][wifi:520]:     RSSI: -62 dB
[18:04:00][D][wifi:523]: - 'SXX' (90:17:3F:25:99:00) ▂▄▆█
[18:04:00][D][wifi:523]: - 'mynet' (D4:6E:0E:27:D4:2F) ▂▄▆█
[18:04:00][D][wifi:523]: - 'Telekom-Rf2yN5' (78:65:59:5C:98:5A) ▂▄▆█
[18:04:00][D][wifi:523]: - 'Zxk' (AA:01:12:08:5C:EA) ▂▄▆█
[18:04:00][D][wifi:523]: - 'dlink-x' (10:62:EB:09:F9:A6) ▂▄▆█
[18:04:00][I][wifi:304]: WiFi Connecting to 'mynet2'...
[18:04:00][I][wifi:591]: WiFi Connected!
[18:04:00][C][wifi:409]:   Local MAC: B0:A7:32:D7:52:00
[18:04:00][C][wifi:414]:   SSID: 'mynet2'
[18:04:00][C][wifi:415]:   IP Address: 192.168.1.162
[18:04:00][C][wifi:417]:   BSSID: 8C:FD:DE:33:AC:4C
[18:04:00][C][wifi:418]:   Hostname: 'bearcave-entry'
[18:04:00][C][wifi:420]:   Signal strength: -59 dB ▂▄▆█
[18:04:00][C][wifi:424]:   Channel: 5
[18:04:00][C][wifi:425]:   Subnet: 255.255.255.0
[18:04:00][C][wifi:426]:   Gateway: 192.168.1.1
[18:04:00][C][wifi:427]:   DNS1: 192.168.1.1
[18:04:00][C][wifi:428]:   DNS2: 0.0.0.0
[18:04:00][D][wifi:600]: Disabling AP...
[18:04:00][C][ota:096]: Over-The-Air Updates:
[18:04:00][C][ota:097]:   Address: bearcave-entry.local:3232
[18:04:00][C][ota:100]:   Using Password.
[18:04:00][C][ota:103]:   OTA version: 2.
[18:04:00][C][api:025]: Setting up Home Assistant API server...
[18:04:00][I][app:062]: setup() finished successfully!
[18:04:01][I][app:102]: ESPHome version 2024.2.2 compiled on Mar 10 2024, 17:34:33
[18:04:01][C][wifi:577]: WiFi:
[18:04:01][C][wifi:409]:   Local MAC: B0:A7:32:D7:52:00
[18:04:01][C][wifi:414]:   SSID: 'mynet2'
[18:04:01][C][wifi:415]:   IP Address: 192.168.1.162
[18:04:01][C][wifi:417]:   BSSID: 8C:FD:DE:33:AC:4C
[18:04:01][C][wifi:418]:   Hostname: 'bearcave-entry'
[18:04:01][C][wifi:420]:   Signal strength: -61 dB ▂▄▆█
[18:04:01][C][wifi:424]:   Channel: 5
[18:04:01][C][wifi:425]:   Subnet: 255.255.255.0
[18:04:01][C][wifi:426]:   Gateway: 192.168.1.1
[18:04:01][C][wifi:427]:   DNS1: 192.168.1.1
[18:04:01][C][wifi:428]:   DNS2: 0.0.0.0
[18:04:01][C][logger:447]: Logger:
[18:04:01][C][logger:448]:   Level: DEBUG
[18:04:01][C][logger:449]:   Log Baud Rate: 115200
[18:04:01][C][logger:451]:   Hardware UART: UART0
[18:04:01][C][uart.arduino_esp32:137]: UART Bus 1:
[18:04:01][C][uart.arduino_esp32:138]:   TX Pin: GPIO22
[18:04:01][C][uart.arduino_esp32:139]:   RX Pin: GPIO21
[18:04:01][C][uart.arduino_esp32:141]:   RX Buffer Size: 256
[18:04:01][C][uart.arduino_esp32:143]:   Baud Rate: 57600 baud
[18:04:01][C][uart.arduino_esp32:144]:   Data Bits: 8
[18:04:01][C][uart.arduino_esp32:145]:   Parity: NONE
[18:04:01][C][uart.arduino_esp32:146]:   Stop bits: 1
[18:04:01][C][fingerprint_grow:443]: GROW_FINGERPRINT_READER:
[18:04:01][C][fingerprint_grow:444]:   System Identifier Code: 0x0000
[18:04:01][C][fingerprint_grow:446]:   Touch Sensing Pin: GPIO23
[18:04:01][C][fingerprint_grow:447]:   Update Interval: 0.5s
[18:04:01]Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
[18:04:01]
[18:04:01]Core  1 register dump:
[18:04:01]PC      : 0x4016651b  PS      : 0x00060530  A0      : 0x800d8832  A1      : 0x3ffb2740  
WARNING Decoded 0x4016651b: esphome::sensor::Sensor::get_state() const at /home/laci/projects/esphome/.esphome/build/bearcave-entry/src/esphome/components/sensor/sensor.cpp:86
[18:04:01]A2      : 0x00000000  A3      : 0x3f40106e  A4      : 0x000001bf  A5      : 0x3f4010ea  
[18:04:01]A6      : 0x00000000  A7      : 0x3fe00000  A8      : 0x800e03d1  A9      : 0x3ffb26d0  
[18:04:01]A10     : 0x00000004  A11     : 0x3f40106e  A12     : 0x000001bf  A13     : 0x3f4010ea  
[18:04:01]A14     : 0x00ff0000  A15     : 0xff000000  SAR     : 0x0000001f  EXCCAUSE: 0x0000001c  
[18:04:01]EXCVADDR: 0x00000024  LBEG    : 0x40089961  LEND    : 0x40089971  LCOUNT  : 0xfffffff0  
[18:04:01]
[18:04:01]
[18:04:01]Backtrace:0x40166518:0x3ffb27400x400d882f:0x3ffb2760 0x40166739:0x3ffb27b0 0x400deb89:0x3ffb27d0 0x400e0eba:0x3ffb2800 0x400e9b19:0x3ffb2820 
WARNING Found stack trace! Trying to decode it
WARNING Decoded 0x40166518: esphome::sensor::Sensor::get_state() const at /home/laci/projects/esphome/.esphome/build/bearcave-entry/src/esphome/components/sensor/sensor.cpp:86
WARNING Decoded 0x400d882f: esphome::fingerprint_grow::FingerprintGrowComponent::dump_config() at /home/laci/projects/esphome/.esphome/build/bearcave-entry/src/esphome/components/fingerprint_grow/fingerprint_grow.cpp:449 (discriminator 2)
WARNING Decoded 0x40166739: esphome::Component::call_dump_config() at /home/laci/projects/esphome/.esphome/build/bearcave-entry/src/esphome/core/component.cpp:78
WARNING Decoded 0x400deb89: esphome::Application::loop() at /home/laci/projects/esphome/.esphome/build/bearcave-entry/src/esphome/core/application.cpp:108
WARNING Decoded 0x400e0eba: loop() at /home/laci/projects/esphome/.esphome/build/bearcave-entry/bearcave-entry.yaml:105
WARNING Decoded 0x400e9b19: loopTask(void*) at /home/laci/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:50
[18:04:01]
[18:04:01]
[18:04:01]
[18:04:01]
[18:04:01]ELF file SHA256: 0000000000000000
[18:04:01]
[18:04:01]Rebooting...
[18:04:01]ets Jul 29 2019 12:21:46
[18:04:01]
[18:04:01]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[18:04:01]configsip: 0, SPIWP:0xee
[18:04:01]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[18:04:01]mode:DIO, clock div:2
[18:04:01]load:0x3fff0030,len:1184
[18:04:01]load:0x40078000,len:13132
[18:04:01]load:0x40080400,len:3036
[18:04:01]entry 0x400805e4
[18:04:01][I][logger:359]: Log initialized
...

As you can see, fingerprint detection works, but the board crashes until it settles in safe mode.

Thanks in advance!