I want to connect a long range RFID card reader unit to NodeMCU (12E) board and read the card number. The RFID reader board has a RS485 output port and when I connect this board to my laptop using a RS485 to USB converter, I get the card number using a RealTerm/CoolTerm program.
I was just wondering how I can directly connect the RFID reader board to NodeMCU and read the card number.
I did the following so far, any help in this regard will be much appreciated -
- Connected RFID board with a RS485 to USB converter
- Used a female to female USB connector and connected (1) with NodeMCU at the other end(via micro usb port on NodeMCU)
Written a very simple arduino sketch to read the serial data as -
#define BUZZER 4 void setup() { Serial.begin(9600); // Init Serial } void loop(){ if (Serial.available()) { tone(BUZZER, 5000); delay(1000); noTone(BUZZER); } }
However, the buzzer gives no sound.
My questions are -
Is this the right way of reading data from the card reader via RS485 port ?
Why the data is not received in NodeMCU while I can see it on the terminal program on my laptop
Is there any arduino sketch that I can refer to to read the card number in NodeMCU ?