Hello
I want to connect two RFID readers to a single ESP32 module . So I have used the wiegand Liberary which I downloaded from here :
Then I used the liberary example and modified it for 2 readers .
#include <Wiegand.h>
WIEGAND wg0;
WIEGAND wg1;
void setup() {
Serial.begin(9600);
// default Wiegand Pin 2 and Pin 3 see image on README.md
// for non UNO board, use wg.begin(pinD0, pinD1) where pinD0 and pinD1
// are the pins connected to D0 and D1 of wiegand reader respectively.
wg0.begin(16,17);
wg1.begin(34,35);
}
void loop() {
if(wg0.available())
{
Serial.print("Wiegand HEX from RD1= ");
Serial.print(wg0.getCode(),HEX);
Serial.print(", DECIMAL = ");
Serial.print(wg0.getCode());
Serial.print(", Type W");
Serial.println(wg0.getWiegandType());
}
if(wg1.available())
{
Serial.print("Wiegand HEX from RD2= ");
Serial.print(wg1.getCode(),HEX);
Serial.print(", DECIMAL = ");
Serial.print(wg1.getCode());
Serial.print(", Type W");
Serial.println(wg1.getWiegandType());
}
}
I have connected my Node mcu module to the readers via a level converter . D16 and D17 are connected to reader 1 , D34 and D35 are connected to reader 2
The problem is that when reader 1 sends data sometimes the esp says that it is from reader 2 and vice versa. so I can’t understand which reader has read the card.
could you please help me find the problem ?