#NFC Reader

1 messages · Page 1 of 1 (latest)

lyric vapor
#

This is my Code that I'm trying to upload to ESP device, with error message

"INFO ESPHome 2023.12.9
INFO Reading configuration /config/esphome/nfc-2024.yaml...
WARNING GPIO8 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
Failed config

rc522_spi: [source /config/esphome/nfc-2024.yaml:50]

  • cs_pin: GPIO7
    on_tag:
    then:
    -
    Unable to find action with the name 'homeassistant.tag_scanned'.
    homeassistant.tag_scanned: !lambda |-
    " and this is the code im trying to instal "
---
substitutions:
  devicename: "nfc-scanner"
  friendly_name: "NFC Scanner"

packages:
  esphome: !include common/esphome.yaml
  api: !include common/api.yaml
  logger: !include common/logger.yaml

# Your Wi-Fi SSID and password
wifi:
  ssid: "xxxxxx"
  password: "xxxxxxx"

esphome:
  # Magic variables to get the ESP32C3 Super Mini to work
  name: nfc-2024
  friendly_name: nfc 2024
  platformio_options:
    board_build.f_flash: 40000000L
    board_build.flash_mode: dio
    board_build.flash_size: 4MB
 

esp32:
  variant: ESP32C3
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf

status_led:
  pin:
    number: GPIO8
    inverted: true




spi:
  clk_pin: GPIO4
  mosi_pin: GPIO6
  miso_pin: GPIO5

rc522_spi:
  cs_pin: GPIO7
  on_tag:
    then:
      - homeassistant.tag_scanned: !lambda 
"
#

And this is the original code as proposed by the project Creator

I don't have and don't use buzzer
But the rest is the same

---
substitutions:
  devicename: "nfc-scanner"
  friendly_name: "NFC Scanner"

packages:
  esphome: !include common/esphome.yaml
  api: !include common/api.yaml
  logger: !include common/logger.yaml
  wifi: !include common/wifi.yaml

esphome:
  # Magic variables to get the ESP32C3 Super Mini to work
  platformio_options:
    board_build.f_flash: 40000000L
    board_build.flash_mode: dio
    board_build.flash_size: 4MB
  on_boot:
    priority: 600
    then:
      - rtttl.play: 'short:d=4,o=5,b=100:16e6,16e6'

esp32:
  variant: ESP32C3
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf

status_led:
  pin:
    number: GPIO8
    inverted: true

output:
  - platform: ledc
    pin: GPIO3
    id: buzzer

rtttl:
  output: buzzer

spi:
  clk_pin: GPIO4
  mosi_pin: GPIO6
  miso_pin: GPIO5

rc522_spi:
  cs_pin: GPIO7
  on_tag:
    then:
      - rtttl.stop:
      - homeassistant.tag_scanned: !lambda 'return x;'
      - rtttl.play: 'short:d=4,o=5,b=100:16e6,16e6'