I am beginner for NodeMcu. I brought a Adraxx ENTDEV019 ESP8266 NodeMcu WiFi Development Board
. I am trying to program with arduino Ide. I tried some basic examples. Below is code I am trying for the board. I am using Serial1 port for debug communication. I connected:
- Tx from board to Rx of Serial Adapter
- Rx from board to Tx of Serial Adapter
I tried this for different baud rates. I powered NodeMcu with external power bank,but I don't see correct output in Serial Monitor.
Same code works fine if I use Serial port instead of Serial1 and connect with USB cable to Computer.
#define LED D0
#define DBG_OUTPUT_PORT Serial1
// the setup function runs once when you press reset or power the board
void setup() {
DBG_OUTPUT_PORT.begin(9600);
DBG_OUTPUT_PORT.print("\n");
DBG_OUTPUT_PORT.setDebugOutput(true);
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
pinMode(LED, OUTPUT);
}
// the loop function runs over and over again forev`er
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(LED, HIGH);// turn the LED off.(Note that LOW is the voltage level but actually
delay(2000); // wait for a second
DBG_OUTPUT_PORT.print("Connected! IP address: \n");
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
digitalWrite(LED, LOW); // turn the LED on.
}
What mistake am I doing?
Serial
object but notSerial1
- therefore the question is off topic on SO, and perhaps better asked at electronics.stackexchange.com. Or just read the documentation (such as it is). You are to be connected to RXD0/TXD0 (the sameSerial
UART already exposed via the USB). Serial1 supports TX only on D4 according to the IOCONN block at github.com/nodemcu/nodemcu-devkit-v1.0/blob/master/…. – Clifford