Chat freely about anything...

User avatar
By watusimoto
#72419 I'm running the following program, compiled in the Arduino IDE, on an NodeMCU 12e connected to my laptop via a USB cable, but otherwise not plugged into anything. This is of course just an example to illustrate the problem I have initializing the Wire library, not actual code I want to run.

Code: Select allvoid setup() {
   Serial.begin(115200);
   Serial.println("here 0");
   pinMode(6, INPUT);
   Serial.println("here 1");
   pinMode(6, OUTPUT);
   Serial.println("here 2");
   pinMode(6, INPUT_PULLUP);
   Serial.println("here 3");
}

void loop() {
   // Do nothing
}


And getting the following output:
Code: Select all⸮here 0
here 1

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v180000ca
~ld

This repeats every (approx) 6 seconds. Changing the 6s to 5s fixes the problem (except that I need to use pin 6).

My understanding is that setting the pinMode to OUTPUT is hanging, and the hardware watchdog is rebooting the device. But how can setting the pinMode hang?

Thanks!
User avatar
By McChubby007
#72420 My immediate feeling is that pin 6 is not what you think it is, and it is in fact a reserved or illegal pin number on your particular board. I would check the pinout of your specific board - I know there has been confusion over nodemcu pin identities in the past.