1
votes

I have a NodeMCU board running the Lua interpreter, I can access the serial connection via the nodemcu-tool to input commands but when using the nodemcu-tool to upload or reset the filesystem it returns

[NodeMCU-Tool]~ Unable to establish connection [NodeMCU-Tool]~ Timeout, no response detected - is NodeMCU online and the Lua interpreter ready ?

2
What is the command that you're issuing?Marcel Stör
Hi, @marcel-stör, I have the same problem. I have a Wemos D1 mini, followed instructions on nodemcu.readthedocs.io (cloud build service, NodeMCU PyFlasher, and nodemcu-tool based on Node.js). Any command except accessing the terminal fails, for example: nodemcu-tool mkfs --connection-delay 1000 (it uses the project settings file .nodemcutool).MDr
[Continuing] The terminal connection gives some details such as: NodeMCU custom build by frightanic.com branch: master commit: 11592951b90707cdcb6d751876170bf4da82850d SSL: true modules: cron,file,gpio,http,i2c,mdns,mqtt,net,node,ow,pwm,sntp,tmr,uart,wifi,wifi_monitor,tls build created on 2019-01-06 12:35 powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9) lua: cannot open init.lua > Heap size:40816. MDr
Sorry, can't help, works for me. NodeMCU dev branch, nodemcu-tool 3.0.2, WeMos D1 mini Pro on macOS.Marcel Stör

2 Answers

0
votes

I might have an answer:

I ran into the same (or very, very similar) problem, on Mac OS X Mojave.

In the end, I reverted to completely uninstalling Node.js (this experience does not help convincing me of Node.js but that is another story) and start from scratch.

Even that did not help because I ran into trouble installing nodemcu-tool ...

Previously I installed it as a global package, and that somehow worked, but it caused me to always sudo my nodemcu-tool invocations - not a good thing!

In any case, sudo-ing plus the commandline parameter "--connection_delay" (or as a project setting, "connectionDelay") helped getting me going.

Until I messed up, and reinstalled everything from scratch. However, the key difference to the instructions for installing nodemcu-tool was adding the '--unsafe-perm' parameter to it, like so:

sudo npm install --unsafe-perm nodemcu-tool -g

That was to be able to get past the repeated installation errors for the serialport package...

IMO, relying on unsafe permissions (for what exactly, anyway!?) is, well, UNSAFE! GRRRRR

To the OP, make sure that:

  • you have installed Node.js and nodemcu-tool properly (download stable installer etc), and
  • that you use the --connection_delay parameter in each and every nodemcu-tool invocation!
0
votes

I had the same problem! The solution was to reset the board:

  1. Conect the board via USB and press FLASH + RST (two buttons on the board)
  2. relese FLASH
  3. relese RST

Now you can upload your sketch.

If it doesn't work try to disconnect all pins. In my case the GPIO4 was soldered to a LED-Strip and i it was imposible to load the sketch until i disconnected it.