B4R Question need some help to connect esp8266 and rc522

omarruben

Active Member
Licensed User
Longtime User
using this code
B4X:
Sub Process_Globals
    Public Serial1 As Serial
    Private wifi As ESP8266WiFi
   
    Private rfid As MFRC522
    Private bc As ByteConverter
    Dim d1 As D1Pins
   
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    'example of connecting to a local network
    'If wifi.Connect2("SSID", "PASSWORD") Then
    '    Log("Connected to network")
    'Else
'        Log("Failed to connect to network")
'    End If
   
    rfid.Initialize(d1.D3, d1.D4, "rfid_CardPresent")
    rfid.LogVersion
   
End Sub

Sub rfid_CardPresent (UID() As Byte, CardType As Byte)
    Log("UID: ", bc.HexFromBytes(UID))
End Sub

I have an error :
Firmware Version: 0xFF = (unknown)
WARNING: Communication failure, is the MFRC522 properly connected?

I am using the connections based on the picture

2023-09-26 17_13_56-How to use RFID Reader with NodeMCU - RC522 RFID Reader Tutorial - YouTube...jpg
 

Attachments

  • 2023-09-26 17_13_56-How to use RFID Reader with NodeMCU - RC522 RFID Reader Tutorial - YouTube...jpg
    2023-09-26 17_13_56-How to use RFID Reader with NodeMCU - RC522 RFID Reader Tutorial - YouTube...jpg
    140.5 KB · Views: 66
Last edited:

omarruben

Active Member
Licensed User
Longtime User
got it : the pins are kind of backward, should be :


B4X:
    rfid.Initialize(d1.D4, d1.D3, "rfid_CardPresent")
 
Upvote 0
Top