Unable to read serial/uart pins

I am unable to read the serial pins in the NodeMCU Lua environment. I have only been able to read the USB serial port.
I have connected a serial adapter to the rx, tx, and g pins.
I have tried this code:
I enter text in the ESplorer console and it does read that. It doesn't read anything I send over a serial adapter plugged into the rx/tx/g pins.
I disconnected the USB cable and powered it with the serial adapter. Nothing was sent using this code. I tried `uart.write(0,` and `uart.write(1,`.
How do I read the pin serial ports instead of the usb serial port?
I have connected a serial adapter to the rx, tx, and g pins.
I have tried this code:
Code: Select all
uart.on("data","\n",function(data) print("receive from uart:", data) end, 0)
I enter text in the ESplorer console and it does read that. It doesn't read anything I send over a serial adapter plugged into the rx/tx/g pins.
Code: Select all
uart.write(0, "hello")
I disconnected the USB cable and powered it with the serial adapter. Nothing was sent using this code. I tried `uart.write(0,` and `uart.write(1,`.
How do I read the pin serial ports instead of the usb serial port?