-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[st25r] Add ST25R3916 NFC reader documentation #6428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: current
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,120 @@ | ||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||
| description: "Instructions for setting up ST25R NFC reader components in ESPHome" | ||||||||||||||||||||||||||||||||||||||
| title: "ST25R NFC Reader" | ||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| import APIRef from '@components/APIRef.astro'; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| <span id="st25r-component"></span> | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| ## Component/Hub | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| The `st25r` component allows you to use STMicroelectronics ST25R3916 family NFC readers | ||||||||||||||||||||||||||||||||||||||
| ([datasheet](https://www.st.com/resource/en/datasheet/st25r3916.pdf)) | ||||||||||||||||||||||||||||||||||||||
| with ESPHome. This component is a global hub that establishes the connection to the ST25R3916 via | ||||||||||||||||||||||||||||||||||||||
| [SPI](/components/spi) and detects ISO 14443A (NFC-A) tags with multi-tag anticollision support | ||||||||||||||||||||||||||||||||||||||
| for 4-byte, 7-byte, and 10-byte UIDs. | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| ## Over SPI | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| ```yaml | ||||||||||||||||||||||||||||||||||||||
| spi: | ||||||||||||||||||||||||||||||||||||||
| clk_pin: GPIO19 | ||||||||||||||||||||||||||||||||||||||
| miso_pin: GPIO10 | ||||||||||||||||||||||||||||||||||||||
| mosi_pin: GPIO18 | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| st25r_spi: | ||||||||||||||||||||||||||||||||||||||
| cs_pin: GPIO6 | ||||||||||||||||||||||||||||||||||||||
| irq_pin: GPIO7 | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
| clk_pin: GPIO19 | |
| miso_pin: GPIO10 | |
| mosi_pin: GPIO18 | |
| st25r_spi: | |
| cs_pin: GPIO6 | |
| irq_pin: GPIO7 | |
| clk_pin: GPIO18 | |
| miso_pin: GPIO19 | |
| mosi_pin: GPIO23 | |
| st25r_spi: | |
| cs_pin: GPIO5 | |
| irq_pin: GPIO4 |
Copilot
AI
Apr 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example uses GPIO6/GPIO7 for cs_pin/irq_pin, which are typically reserved for SPI flash on many ESP32 boards. Consider switching to GPIOXX placeholders or known-safe pins to prevent users copy/pasting a non-working configuration.
| cs_pin: GPIO6 | |
| irq_pin: GPIO7 | |
| cs_pin: GPIOXX | |
| irq_pin: GPIOYY |
Copilot
AI
Apr 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rf_power range is written as 0--15, which reads like a typo. Consider changing to 0-15 (or 0..15) to avoid confusion.
| - **rf_power** (*Optional*, int): TX driver strength 0--15 (15 = maximum range). Defaults to `15`. | |
| - **rf_power** (*Optional*, int): TX driver strength 0-15 (15 = maximum range). Defaults to `15`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logger level guidance conflicts with the sample output
Line 99 asks for DEBUG, but the sample shown is an INFO log. Please align the instruction and sample level so users know what to expect.
Suggested doc tweak
-To find your tags' UIDs, set up the component with the logger at DEBUG level. When you hold a tag
+To find your tags' UIDs, set up the component with the logger at INFO level (or lower). When you hold a tag
near the reader, you will see a log message like:🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/content/docs/components/binary_sensor/st25r.mdx` around lines 99 - 104,
The doc currently tells users to set the logger to DEBUG but shows an example
log with an INFO level; update the doc so the levels match by either changing
the instruction from "DEBUG" to "INFO" or changing the sample log prefix from
"[st25r:INFO]" to "[st25r:DEBUG]"; ensure the text around the "Tag selected:
0410A7675F6180 (SAK=0x00)" sample and the instruction mentioning logger level
use the same level term so users know what to expect.
Copilot
AI
Apr 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section says to set the logger to DEBUG to find UIDs, but the example log line shown is at INFO level ([st25r:INFO] ...). Please reconcile these (either adjust the recommended logger level or update the example) so readers know which level is actually required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intro describes this as the
st25rcomponent, but the configuration examples usest25r_spi:. To avoid confusing users, please align the wording and examples (similar to PN532/RC522 docs, which explicitly describe the*_spihub component name used in YAML).