Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By manny009
#63503 So i'm trying to connect an RFID reader to the ESP8266-01.

I have connected the TX pin of the RFID reader to the RX on the ESP module.
Am I right in saying that the RX and TX pins on the ESP module are only used for programming/flashing the module?

In which case I should be connecting the TX pin of the reader to the GPIO2 pin of the ESP module instead?

If so how would I read the data form the GPIO2 pin?
Can someone explain what can be connected to the GPIO pins as I can only see the "LED on/off' example online and not something like a sensor input.


Thanks
User avatar
By martinayotte
#63507 No, TX/RX can be used for any kind of serial communication, you just need to have some kind of jumper or switch on RX to temporarily disconnect your RFID if you wish to upload new firmware.
User avatar
By manny009
#63510 Hmmm Interesting.

Then how can I read the data conning into the ESP RX pin?

Right now asking it to read the UART but am getting nothing out from it.

ie.

#include <ESP8266WiFi.h>
const char* ssid = "xxxxxxx";//type your ssid
const char* password = "xxxxxxx";//type your password

char val = 0; //variable to store the char read from the RFID button
/*Using RFID ID-12 to read unique character that is assigned to each RFID button or tag*/

void loop () {
//read the serial port
if(Serial.available() > 0)
val = Serial.read(); //read from one char from the ID-12 and store it
Serial.print(val); //display the char in the serial monitor
}

This should be right because when I use this code on an Arduino, The serial monitor reads the Arduino UART and print the tag info.