Jump to content

Hey everyone
I just learnt about NodeMCU and got myself a few to play with and turn into a few things.

They arrived the other day, so I connected one up, loaded up the Arduino IDE and did the usual first thing, loaded the blink sample
But I cant get it to work

Googling around I found that my chip looks different to the ones shown online (Doesn't have the WiFi chip from what I can tell) so not sure if thats part of my issues?

I have followed a number of tutorials online, but nothing seems to be working for me.

The code compiles and seems to upload fine to the chip, but when I put the LED across the pins, it just glows very dim.
I ahve tried different pins and different code examples but nothing seems to work.

Any help / input would be great?
Thanks in advance

Link to comment
https://linustechtips.com/topic/940064-nodemcu-help-please/
Share on other sites

Link to post
Share on other sites

Iv used a few different codes, and cant remember what they all were
Heres the last two I used

And I think I used D0 as well at one point
And something about LED_BUILTIN for the pinMode?
 

void setup() {
  pinMode(D7, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(D7, LOW);   // Turn the LED on (Note that LOW is the voltage level
                                    // but actually the LED is on; this is because 
                                    // it is active low on the ESP-01)
  delay(1000);                      // Wait for a second
  digitalWrite(D7, HIGH);  // Turn the LED off by making the voltage HIGH
  delay(2000);                      // Wait for two seconds (to demonstrate the active low LED)
}
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

 

Link to comment
https://linustechtips.com/topic/940064-nodemcu-help-please/#findComment-11464620
Share on other sites

Link to post
Share on other sites

1 minute ago, Pangea2017 said:

Take a look at the schematic: https://github.com/nodemcu/nodemcu-devkit-v1.0/blob/master/NODEMCU_DEVKIT_V1.0.PDF

The LED is on page 6. It is connected to GPIO 16 which is pin d0. GPIO13 does not have a LED build in.

Can you might post a pic of your chip since you think that it looks different then a node mcu.

 

ps. is the node mcu your first board?

Sorry should have said
I tried with both the onboard led and a external led and couldnt get either to work.
So yes I would have done GPIO 16 / D0 to begin with, then moved onto the external led on another GPIO port with no luck as well.

Iv used raspberry pi heaps in the past (Not arduino I know) and a few ardunio kits (LED cubes and such), but this is my first standalone board

IMG_20180622_125131.jpg

Link to comment
https://linustechtips.com/topic/940064-nodemcu-help-please/#findComment-11464632
Share on other sites

Link to post
Share on other sites

2 minutes ago, Pangea2017 said:

But your board might does not have this led like my lolin or i just don't see where they have placed the second led.

Thats what I was thinking
I may have gotten a off brand version, which has the components hard wired on, rather than the wifi shield.
And no extra LED
Hence why I moved to the external LED on one of the other pins (Which is where the led just glows at half power rather than flashing)

Ill try your code in a few moments and see what happens

Link to comment
https://linustechtips.com/topic/940064-nodemcu-help-please/#findComment-11464682
Share on other sites

Link to post
Share on other sites

7 minutes ago, Pangea2017 said:

The ESP8266 is a bit different then the usual arduino board. yield, esp.wdtfeed, delay(0) are good if you have a WDT reset. Other things like disabling the interrupts in the background should not be forgotten if you code. The good you will learn this over time without a hassle. 

 

CAM00062.thumb.jpg.ffd9d30f4b06aee08a8b6ee82aaade54.jpg 

 

On the LEFT a node mcu and on the right a lolin (does not have the led)  which is nearly identical. What you have should be same but they saved some money by soldering the components which are under the metal shield directly to the pcb and replacing some smd.

 

try this code: 

tested it on the node mcu and it blinks with 2Hz.


void setup() {
  // put your setup code here, to run once:
  pinMode(D0, OUTPUT);
  digitalWrite(D0, HIGH);
}

void loop() {
  while(1) { 
    digitalWrite(D0, HIGH);
    delay(500);
    digitalWrite(D0, LOW);
    delay(500);
  }
}

 

Code was uploaded
No flashing LED

Tried putting a led across D0 and Ground, and it just stays lit.

Link to comment
https://linustechtips.com/topic/940064-nodemcu-help-please/#findComment-11464693
Share on other sites

Link to post
Share on other sites

3 minutes ago, Pangea2017 said:

connect a jumper cable from D0 to A0.


void setup() {
  // put your setup code here, to run once:
  pinMode(D0, OUTPUT);
  pinMode(A0, INPUT);
  Serial.begin(9600);
}

void loop() {
  while(1) { 
    digitalWrite(D0, HIGH);
    delay(500);
    Serial.print(millis());
    Serial.print(" high: ");
    Serial.println(analogRead(A0));
    digitalWrite(D0, LOW);
    Serial.print(millis());
    Serial.print(" low: ");
    Serial.println(analogRead(A0));
    delay(500);
  }

 

And where do i read the output from?

Link to comment
https://linustechtips.com/topic/940064-nodemcu-help-please/#findComment-11464709
Share on other sites

Link to post
Share on other sites

5 minutes ago, Pangea2017 said:

1. this is not the latest arduino ide (not important, this would have a clear output button)

2. No plan why serial out is not working. Your serial connection should work as. Normally this looks like this if the baud rate is wrong but you have 9600 in the serial monitor and 9600 in the code. COM6 is your ESP?

3. do you have wifi or better a notebook/pc with wifi?

Oh yes sorry, read somewhere that going back a few versions can fix some issues.
(also get the same output on 1.8.5)

COM6 as attached

and yes have a laptop with wifi

Capture.JPG

Link to comment
https://linustechtips.com/topic/940064-nodemcu-help-please/#findComment-11464755
Share on other sites

Link to post
Share on other sites

51 minutes ago, Pangea2017 said:

@pomtom44 downgrading the ESP-core can help. I have one programm which only runs at 2.2.0 or below but not with 2.3.0, 2.4.0. and 2.4.1 and i don't know why or how to debug it.

What you can try is flashing (again) the bootloader to the broken esp. https://nodemcu.readthedocs.io/en/latest/en/flash/

Keep in mind that you might need to pull GPIO 0 manually to low. If this not help figure it out with the seller since the postage would be higher then the value of a esp8266 board.

I cant seem to get it to flash
Different methods result in different errors
Flash Timeout
Cant Connect
etc

Im just going to assume its DOA and try get a replacement

Link to comment
https://linustechtips.com/topic/940064-nodemcu-help-please/#findComment-11464908
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×