TagTuner icon indicating copy to clipboard operation
TagTuner copied to clipboard

Instable - Wifi disconnect when card reading

Open iambusdi opened this issue 7 months ago • 3 comments

Hi, first of all – thank you for this very cool project! I'm currently building a device for my kids' room and really enjoy working with it.

I’ve soldered all the parts and assembled everything into the 3D model you offered on ko-fi. In my workspace, the setup works perfectly. However, I'm encountering a strange issue when I move the device to my kids’ room:

🛠️ Problem Description When I place an NFC card on the reader, the music playback starts as expected – but then the Wi-Fi connection drops until I remove the card again. During this time:

  • The music continue playing.
  • Volume control doesn’t work either (due to the missing Wi-Fi connection, I assume).

To investigate further, I added a simple Wi-Fi signal quality sensor to the code. Here are the signal strengths I observed: workspace: ~ -60 dB Kids’ room: ~ -70 dB Both values seem relatively stable, though a bit weaker in the kids’ room.

Also the ping (every 1s) is gone and higher after removing the card for some time:

64 bytes from : icmp_seq=27179 ttl=64 time=84.394 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27180 ttl=64 time=102.638 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27181 ttl=64 time=9.436 ms      <- add card
Request timeout for icmp_seq 27182
....
Request timeout for icmp_seq 27209                                                      <- remove card
64 bytes from xx.xx.xx.xx: icmp_seq=27183 ttl=64 time=27819.006 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27184 ttl=64 time=26820.371 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27185 ttl=64 time=25815.771 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27186 ttl=64 time=24810.971 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27187 ttl=64 time=23814.802 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27188 ttl=64 time=22812.565 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27189 ttl=64 time=21808.458 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27190 ttl=64 time=20806.192 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27191 ttl=64 time=19804.780 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27192 ttl=64 time=18800.879 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27202 ttl=64 time=8845.367 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27211 ttl=64 time=103.726 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27212 ttl=64 time=116.920 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27213 ttl=64 time=144.283 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27214 ttl=64 time=54.370 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27215 ttl=64 time=2.547 ms
64 bytes from xx.xx.xx.xx: icmp_seq=27216 ttl=64 time=4.746 ms

❓ Do you have any idea how to solve this issue? Do you have any ideas what could cause this issue – especially the Wi-Fi disconnect triggered specifically by placing the NFC card? Could it be interference, shielding, or maybe power-related (tested different usb charger up to 10W)? I am using this esp32 mini USB-C version. https://www.amazon.de/dp/B0D7V9591B?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1

Thank you for your support!

🔧 Optional: Wi-Fi Quality Sensor Code If you're interested in adding a similar Wi-Fi signal check to your project, I based mine on the following config: https://github.com/jcallaghan/esphome-config

config file:

sensor:
  - <<: !include ../sensors/wifi_signal_percentage.yaml
  - <<: !include ../sensors/wifi_signal.yaml
    on_value:
      - component.update: sensor_wifi_signal_percentage

text_sensor:
  - <<: !include ../text_sensors/wifi_info.yaml

wifi_signal_percentage.yaml

---
# WiFi Signal Percentage Sensor
#
# A template sensor that calculates the Wi-Fi Signal Strength as a percentage.
#
# This template doesn't update by itself. It is used by:
# common/wifi.yaml
#
# https://esphome.io/components/sensor/wifi_signal.html
#
platform: template
id: sensor_wifi_signal_percentage
name: "WiFi Signal Percentage - ${name}"
icon: "mdi:wifi"
unit_of_measurement: "%"
update_interval: never
lambda: |-
  if (id(sensor_wifi_signal).state) {
    if (id(sensor_wifi_signal).state <= -100 ) {
      return 0;
    } else if (id(sensor_wifi_signal).state >= -50) {
      return 100;
    } else {
      return 2 * (id(sensor_wifi_signal).state + 100);
    }
  } else {
    return NAN;
  }

wifi_signal.yaml

# WiFi Signal Sensor
#
# The wifi_signal sensor platform allows you to read the signal strength of the
# currently connected WiFi Access Point.
#
# https://esphome.io/components/sensor/wifi_signal.html
#
platform: wifi_signal
id: sensor_wifi_signal
name: "WiFi Signal - ${friendly_name} (${system_id})"
update_interval: 300s

wifi_info.yaml

---
# WiFi Info Text Sensor
#
# The wifi_info text sensor platform exposes different WiFi information via
# text sensors.
#
# https://esphome.io/components/text_sensor/wifi_info.html
#
platform: wifi_info
ip_address:
  name: "IP Address - ${friendly_name} (${system_id})"
ssid:
  name: "SSID - ${friendly_name} (${system_id})"
bssid:
  name: "BSSID - ${friendly_name} (${system_id})"
mac_address:
  name: "MAC - ${friendly_name} (${system_id})"

iambusdi avatar Jun 11 '25 15:06 iambusdi

looks like this could be a similar issue https://github.com/adonno/tagreader/issues/222 i tested increasing the higher update_interval without effect.

It seems that the position of the NFC reader in the housing is too close to the ESP32. When I move it further away, the connection improves. Placing the card on top of the housing gives a better signal than placing it in the slot intended for the NFC card.

iambusdi avatar Jun 12 '25 11:06 iambusdi

I’ve moved the NFC reader away from the ESP32 inside your housing. It’s now mounted using one of the existing housing screws at the opposite edge. It seems to be more stable this way.

iambusdi avatar Jun 23 '25 06:06 iambusdi

Yeah I can second this. Ive stopped using the VPE one as I was getting disconnections and stuttering in the music. I dissassembled and moved the NFC reader away and it became stable.

RemakingEden avatar Sep 16 '25 12:09 RemakingEden

guys, I have not encountered any wifi issues but my signal is very strong across the house. It might be that NFC interferes with wifi somehow but there is really nothing in software I can do about it. You can try to physically separate nfc reader away from the esp board as you've tried. I would also recommend using a different esp board like xiao C6 since those D1 mini knockoffs can have very poor quality. XIAO C6 version is on the way!

luka6000 avatar Dec 20 '25 10:12 luka6000