AndiDittrich / NodeMCU-Tool

:wrench: Upload + Manage Lua files on NodeMCU
https://www.npmjs.com/package/nodemcu-tool
MIT License
310 stars 54 forks source link

Unable to establish connection - timeout #57

Closed jonascoenen005 closed 5 years ago

jonascoenen005 commented 5 years ago

Hello,

I'm trying to upload init.lua file with the nodeMCU-tool with the following command: nodemcu-tool upload --port=/dev/tty.wchusbserial1430 init.lua

I'm getting the following error:

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

I already tried adding --connection-delay 50, didn't work I tried reflashing my ESP8266, didn't work.

How can i find the issue?

AndiDittrich commented 5 years ago

Hi @jonascoenen005 ,

did you try the nodemcu terminal mode ? does it work ? can you access your module via serial terminal ?

best regards, Andi

jonascoenen005 commented 5 years ago

I have tried the nodemcu terminal mode by doing nodemcu-tool terminal --port=/dev/tty.wchusbserial1430 and it hangs.

AndiDittrich commented 5 years ago

please try a standard serial terminal program like putty, hterm, minicom

LanFly commented 5 years ago
{
    "baudrate": "115200",
    "port": "/dev/tty.SLAB_USBtoUART",
    "minify": false,
    "compile": false,
    "keeppath": true
}

Have you tried setting the baud rate to 9600 or 115200? Save the above to the file .nodemcu and try again nodemcu-tool upload init.lua.

AsyDynamics commented 5 years ago

Getting same error, using firmware built online and luanode based on esp32. Tried solutions mentioned above but still not work

jonascoenen005 commented 5 years ago

Sorry for the late response, but i didn't try it anymore because i'm using ArduinoIDE to write/upload my scripts. However i also had an issue with the arduinoIDE, but it went away when i made a new NodeMCU custom build from the DEV branch (https://nodemcu-build.com/) perhaps you can try that

AndiDittrich commented 5 years ago

@AsyDynamics your issue seems to be esp32 related - not esp8266 (classic nodemcu lua) - it is currently in a very experimental state. please open a new issue to discuss your problem

micheldrescher commented 5 years ago

Hi, I saw a very similar issue on StackOverflow (https://stackoverflow.com/questions/53624685/cant-upload-to-the-nodemcu-lua). I had a very similar (if not identical) issue, and responded there. But I am happy to summarise here:

Your port seem to indicate you are running on a Mac, as I do, and the port where my ESP8266 (Wemos D1) was connected to looks very, very similar.

I had similar issues, which seem related to the unreliable way of how Node.js and particularly nodemcu-tool are installed on Mac OS X systems. Long story short, the way I had to invoke nodemcu-tool was to "sudo" it, f.i. "sudo nodemcu-tool fsinfo".

That is not desirable. The only way I was able to get past the problems was to:

Then I was able to use --connection_delay to connect to my ESP8266.

dacodekid commented 5 years ago

@AndiDittrich I can confirm that this is happing on esp8266 - tested on couple modules with no luck.

AndiDittrich commented 5 years ago

@dacodekid

the "issue" is not as simple and may not related to NodeMCU-Tool itself....it's a very generic error message which can have multiple causes depending on the hardware/serial drivers/...

therefore, i will close this issue right now - please open a custom report regarding your issue

best regards, Andi

ideal commented 3 years ago

image

I encountered the same problem on Mac OS with NodeMCU V1.2 ESP32. Has someone solved it? Thanks.