Author Topic: NodeMCU / Arduino / ESP8266 - wont run on its own?  (Read 3755 times)

0 Members and 1 Guest are viewing this topic.

Offline TomS_Topic starter

  • Frequent Contributor
  • **
  • Posts: 846
  • Country: gb
NodeMCU / Arduino / ESP8266 - wont run on its own?
« on: January 10, 2019, 09:06:17 am »
Hi all.

Normally, I work directly with MCUs like PICs etc, but I needed to whip something up that had wifi connectivity, and using an ESP8266 based product and the Arduino IDE seemed to be a good way to do that.

I bought some NodeMCU boards off Amazon, they seem to have a 12E on them.

I have a problem, however, where they just dont seem to "run by themselves". By this I mean:

* When I write code and upload via the Arduino IDE, they will boot and start operating every time
* If I take a board that has had code uploaded to it, and plug it in to a USB power adapter somewhere, it doesnt seem to run

I have an RTC hooked up via I2C which generates a once per minute interrupt which causes the ESP to send off a small amount of data which gets logged on a Raspberry Pi, but I dont see these logs coming in unless I am effectively running it in a development environment.

Does anyone know what is causing this? It kind of defeats the purpose of building something that can then be tucked away and forgotten about, if they are going to need constant attention. :-//

I have sometimes randomly been able to get them to boot, but its very infrequent.

Thanks!
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4245
  • Country: us
Re: NodeMCU / Arduino / ESP8266 - wont run on its own?
« Reply #1 on: January 10, 2019, 10:05:49 am »
The ESP8266 has some requirements for the state of certain pins to cause booting.  I think on a NODEMCU those pins are normally manipulated by the Serial/USB controller, and if it's not in use you may need some pullups or something...https://www.forward.com.au/pfod/ESP8266/GPIOpins/index.html


 
The following users thanked this post: TomS_

Offline JackJones

  • Regular Contributor
  • *
  • Posts: 229
  • Country: fi
Re: NodeMCU / Arduino / ESP8266 - wont run on its own?
« Reply #2 on: January 10, 2019, 10:16:59 am »
https://www.forward.com.au/pfod/ESP8266/GPIOpins/index.html

Quote
How to use
GPIO0, GPIO2 and GPIO15 pins
as Outputs and Inputs on ESP8266 modules

Funnily enough, I also usually just use microcontrollers directly but needed something with wifi without a hassle. I bought one of those e-paper driver boards with an ESP-12F built in, and the schematic it has does have pull ups for GPIO0, GPIO2 and GPIO15 which the link mentions. So probably try pullups on those pins?

Edit: Here's a link to the schematic: https://www.waveshare.com/w/upload/7/7e/ESP8266_e-paper.pdf
« Last Edit: January 10, 2019, 10:19:13 am by JackJones »
 
The following users thanked this post: TomS_

Offline mauroh

  • Frequent Contributor
  • **
  • Posts: 292
  • Country: it
    • Mauro Pintus
Re: NodeMCU / Arduino / ESP8266 - wont run on its own?
« Reply #3 on: January 10, 2019, 10:21:26 am »
+1 for westfw statement.

The NodeMCU board have all the needed pullups, and should take care of the boot and upload sequence, but try watching this 2 videos to be sure everything is as you expect.

Troubleshooting NodeMCU (ESP8266) Arduino Uploads


How To: Pick the right pins on the NodeMCU ESP8266 and ESP32


Mauro
 
The following users thanked this post: TomS_, Naguissa

Offline TomS_Topic starter

  • Frequent Contributor
  • **
  • Posts: 846
  • Country: gb
Re: NodeMCU / Arduino / ESP8266 - wont run on its own?
« Reply #4 on: January 10, 2019, 11:33:44 am »
Brilliant! Thanks everyone. I will look in to these and report back.  :-+
 

Offline TomS_Topic starter

  • Frequent Contributor
  • **
  • Posts: 846
  • Country: gb
Re: NodeMCU / Arduino / ESP8266 - wont run on its own?
« Reply #5 on: January 10, 2019, 01:28:30 pm »
Looks like problem solved!

I have my interrupt connected to pin D3, which apparently causes a boot failure if pulled low (lo and behold, active low interrupt!). So if I had powered the unit down to relocate it elsewhere, and in that time an interrupt had been generated, upon re-applying power the pin would have been pulled low.  |O

Removing the jumper wire from this pin allowed it to boot, after which I could reconnect it.

So now I just need to play around with my pin assignments to make sure it will always come back up without having to go through that procedure.  :palm:

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf