Left here for archival purposes.

User avatar
By djtaylor
#24986 Hi,

I've got a problem with some MQTT code whereby it ONLY works when the nodeMCU is connected via USB, and ESPlorer (v0.2.0-rc2) is connected. If I leave the board connected to the laptop, but close the ESPlorer connection, again, it won't connect to the MQTT broker (nodeMCU actually crashes and restarts). If I plug the board into an external power supply, again, it doesn't connect to the broker (again nodeMCU crashes and restarts).

Things I've tried include:

1. ensuring init.lua runs (after an initial 5 second pause)
2. removing all non-essential code which could somehow have an effect on the code (even down to basic print statements)
3. ensuring there is a wireless connection before making the connect call

The nodeMCU is flashed with: nodemcu_float_0.9.6-dev_20150704.bin - I presume this is the latest one to use?

Its just so strange because the exact same code runs completely fine when the board is connected and ESPlorer is running (and connected).

Has anyone come across this before?
User avatar
By TerryE
#25013 Sounds to me like you've got a noisy external power supply. Have you got decent cap between Vcc and GND? e.g. 220µF
User avatar
By djtaylor
#25031 Hi.

Thanks for the reply - as I'm new to this stuff, I'm not 100% sure what you mean - are you saying I need to place a capacitor between ground and the 3.3V pins? If so, which pins as there are 4 sets on the nodeMCU?

Its worth noting that I have tried 4 different USB power supplies (with different amp outputs), 4 different USB cables, plus 2 battery based power supplies as well.

In addition, the nodeMCU connects to the broker when ESPlorer is connected to the nodeMCU. If I "close" the connection via ESPlorer, but leave the USB cable in the laptop port, it fails.

Grateful for any more help!

Thanks