Wemos d1 mini pro + MFRC522 (stops reading)

161 views
Skip to first unread message

Robert Tomiczek

unread,
May 11, 2021, 6:29:00 AM5/11/21
to TasmotaUsers
  Hello,


I have connected Wemos D1 mini pro with MFRC522 + button + switch and put into mailbox to get information about new letter and to be able to open garden gate by MQTT and RFID.

However MFRC522 stops reading cards after anything is triggered (relay <via button/mqtt/web>; button; switch <detached from relay using rules>). Then after reboot it reads again until anything is triggered.

Previously I have used it with esp-rfid and everything was working fine, except that I hadn't opportunity to attach switch to detect letters. Ofc I tried disabling the switch but didn't help.

Philip Knowles

unread,
May 11, 2021, 7:24:39 AM5/11/21
to Robert Tomiczek, TasmotaUsers

Which GPIO have you attached the devices to?

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/283af7e7-ab5a-4d95-a504-fe3205bbaafbn%40googlegroups.com.

 

Robert Tomiczek

unread,
May 11, 2021, 8:03:03 AM5/11/21
to TasmotaUsers
Hi,

As on pictures below:
Przechwytywanie.PNGPrzechwytywanie.PNG

In addition: just found out that after detaching switch physically (not only in software) everything works correctly. But I don't understand why...
This is the switch I'm using. Both button and switch NO between GND and GPIO
Przechwytywanie.PNG

rules I'm using:
rule1 ON Switch1#state do Publish stat/%topic%/@ ON endon (sent mqtt informing about letter passing mailbox opening)
rule2 ON RC522#UID=******** DO power on ENDON ON RC522#UID=*********** DO power on ENDON (open gate based on rules to avoid situation when access stop working due to lot wifi signal)

Everything powered via 5v phone charger through micro USB.

Philip Knowles

unread,
May 11, 2021, 9:42:48 AM5/11/21
to Robert Tomiczek, TasmotaUsers

Do you have a pullup resistor on the GPIO? With a NO contact you need this.

Otherwise the GPIO will ‘float’ and can give strange results. ESP8266 GPIO are ON when the GPIO is at 0V and OFF when the GPIO is at Vcc

 

With a NC contact swap the positions of Vcc and 0V

 

Regards

 

Phil K

Sent from Mail for Windows 10

 

From: Robert Tomiczek
Sent: 11 May 2021 13:03
To: TasmotaUsers
Subject: Re: Wemos d1 mini pro + MFRC522 (stops reading)

 

Hi,

 

As on pictures below:

 

In addition: just found out that after detaching switch physically (not only in software) everything works correctly. But I don't understand why...

This is the switch I'm using. Both button and switch NO between GND and GPIO

 

rules I'm using:

rule1 ON Switch1#state do Publish stat/%topic%/@ ON endon (sent mqtt informing about letter passing mailbox opening)

rule2 ON RC522#UID=******** DO power on ENDON ON RC522#UID=*********** DO power on ENDON (open gate based on rules to avoid situation when access stop working due to lot wifi signal)

 

Everything powered via 5v phone charger through micro USB.

 

wtorek, 11 maja 2021 o 13:24:39 UTC+2 knowles...@gmail.com napisał(a):

Which GPIO have you attached the devices to?

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

 

From: Robert Tomiczek
Sent: 11 May 2021 11:29
To: TasmotaUsers
Subject: Wemos d1 mini pro + MFRC522 (stops reading)

 

  Hello,

 

 

I have connected Wemos D1 mini pro with MFRC522 + button + switch and put into mailbox to get information about new letter and to be able to open garden gate by MQTT and RFID.

 

However MFRC522 stops reading cards after anything is triggered (relay <via button/mqtt/web>; button; switch <detached from relay using rules>). Then after reboot it reads again until anything is triggered.

 

Previously I have used it with esp-rfid and everything was working fine, except that I hadn't opportunity to attach switch to detect letters. Ofc I tried disabling the switch but didn't help.

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/283af7e7-ab5a-4d95-a504-fe3205bbaafbn%40googlegroups.com.

 

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

Robert Tomiczek

unread,
May 11, 2021, 9:55:16 AM5/11/21
to TasmotaUsers
Internal input pull-up are activated in Tasmota software. (Button_n and Switch_n would be without input pull-up)

Philip Knowles

unread,
May 11, 2021, 10:28:39 AM5/11/21
to Robert Tomiczek, TasmotaUsers

The internal pull ups are ‘weak’ and the fact that disconnecting the switch makes a difference might point to that being the issue.

 

Sent from Mail for Windows 10

 

From: Robert Tomiczek
Sent: 11 May 2021 14:55
To: TasmotaUsers
Subject: Re: Wemos d1 mini pro + MFRC522 (stops reading)

 

Internal input pull-up are activated in Tasmota software. (Button_n and Switch_n would be without input pull-up)

wtorek, 11 maja 2021 o 15:42:48 UTC+2 knowles...@gmail.com napisał(a):

Do you have a pullup resistor on the GPIO? With a NO contact you need this.

Otherwise the GPIO will ‘float’ and can give strange results. ESP8266 GPIO are ON when the GPIO is at 0V and OFF when the GPIO is at Vcc

 

With a NC contact swap the positions of Vcc and 0V

 

Regards

 

Phil K

Sent from Mail for Windows 10

 

From: Robert Tomiczek
Sent: 11 May 2021 13:03
To: TasmotaUsers
Subject: Re: Wemos d1 mini pro + MFRC522 (stops reading)

 

Hi,

 

As on pictures below:

 

In addition: just found out that after detaching switch physically (not only in software) everything works correctly. But I don't understand why...

This is the switch I'm using. Both button and switch NO between GND and GPIO

 

rules I'm using:

Robert Tomiczek

unread,
May 11, 2021, 2:27:03 PM5/11/21
to Philip Knowles, TasmotaUsers
I will try to attach external 10k. However I don't have external pull-up on button neither, in both cases wires are twisted and their lenght differs maybe by 10cm. Let's see tomorrow if it helps

FransOv

unread,
May 22, 2021, 9:34:52 AM5/22/21
to TasmotaUsers
I also had a problem with the RC522 not reading the tags. Everything worked as expected when the reader was connected by short wires to the D1 mini. When I connected them via a longer cable, a 1.5 meter ethernet patch cable, the reader was detected at boot and the rule on boot that set the gain to 7 completed normally. However no tag could be read. The problem seems to be the reset line, RC522 Rst. When I disconnect that line, but keep the definition in the configuration, everything works again.
The MiFare RC522 documentation states about this line:
reset and power-down input:
power-down: enabled when LOW; internal current sinks are switched off, the oscillator
is inhibited and the input pins are disconnected from the outside world
reset: enabled by a positive edge.

I cannot explain why this works, I measured the voltage of the reset line at the reader and it is 3.3V, so high level. As far as I can see now, the readers functions normally, it cannot go to sleep, but I can live with that.
Op dinsdag 11 mei 2021 om 20:27:03 UTC+2 schreef r.tom...@gmail.com:
Reply all
Reply to author
Forward
0 new messages