nodemcu-devkit icon indicating copy to clipboard operation
nodemcu-devkit copied to clipboard

Cannot flash firmware on Mac OS X

Open squix78 opened this issue 9 years ago • 18 comments

How can I flash firmware on the devkit from a Mac OS X? I succesfully installed the driver from here http://raysfiles.com/drivers/ch341ser_mac.zip and can talk with the ESPlorer to the AT firmware. But for some strange reason flashing does't work. To do this I press the flash button while powering up and run the esptool.py as I do when I flash any other ESP8266... Might this be an issue with the CH340G serial-to-usb converter?

squix78 avatar Feb 26 '15 20:02 squix78

same problem here ...

gorhgorh avatar Mar 18 '15 14:03 gorhgorh

I tried to investigate this: themadinventor/esptool#26 - if you don't mind testing 77400 baud, do you see the same values for boot mode? Works OK with an external UART.

However, looking at #5 - that might be the source of the problem.

abl avatar Apr 17 '15 05:04 abl

On Mac OS X, once the driver CH341SER_MAC_ZIP is installed, has you launched on Terminal sudo nvram boot-args="kext-dev-mode=1"?

rei-vilo avatar Apr 17 '15 11:04 rei-vilo

Without that argument the kext won't install; with the kext not installed, you won't see a port. Since AT commands work, well, it's not the unsigned kext.

I'm also seeing the exact same problem with a different (signed) driver; AT commands (and other UART work after boot) works fine, flashing doesn't.

abl avatar Apr 17 '15 22:04 abl

same problem here with Repleo Drivers.

caquino avatar Apr 26 '15 00:04 caquino

Hi I got v0.9 and plugged in to my mac but get cant auto detect firmware because mcu didn't send a proper reply. AT commands gets timed out obviously. Port is open with 9600. Pls help.

magalage avatar Apr 30 '15 03:04 magalage

The default tool esptool doesn't work but pyesptool works fine. Give it a try.

rei-vilo avatar Apr 30 '15 05:04 rei-vilo

@rei-vilo Where are you getting this pyesptool?

AddoSolutions avatar May 01 '15 13:05 AddoSolutions

@AddoSolutions Check https://github.com/themadinventor/esptool and http://embeddedcomputing.weebly.com/nodemcu-board.html for more pointers.

rei-vilo avatar May 01 '15 14:05 rei-vilo

rei-vilo - thanks for the reply. I really couldn't figure out the pyesptool and got it flashed using my Ubuntu machine. Thanks now I can see you have given the link to pyesptool. What I think it's the USB to serial driver issue in OSX. In Ubuntu esprool.py works like a charm. Just plug the devkit and execute the esptool.py command.

magalage avatar May 01 '15 20:05 magalage

You're welcome!

Actually, esptools.py works very well on Mac OS X, provided libusb —and the CH340 serial to USB driver for the NodeMCU board— have been installed.

What doesn't work with the NodeMCU board is esptools.

rei-vilo avatar May 01 '15 21:05 rei-vilo

esptools.py was patched to support this board since this issue was opened so that might be part of it.

abl avatar May 02 '15 07:05 abl

Funny, for me the latest version of esptool.py still doesn't work on Mac. I can see the Repleo-Port, so this is not the problem. Which version of the Nodemcu board do you use? I have a V0.9. rei-vilo and abl: can you describe your setup?

squix78 avatar May 03 '15 12:05 squix78

Here are the details:

  • NodeMCU board 0.9 05/12/2014 from http://nodemcu.com/index_en.html#fr_54747661d775ef1a3600009e
  • firmware from http://bbs.espressif.com/viewforum.php?f=5
  • esptool.py, no release number, from https://github.com/themadinventor/esptool
  • Python 2.7 as esptool.py doesn't run on Python 3.0
  • pyserial release 2.6 from https://pypi.python.org/pypi/pyserial
  • CH340 driver release 1.1 from http://www.wch.cn/download/CH341SER_MAC_ZIP.html
  • Mac OS X 10.10.3

Also, make sure power can deliver up to 350 mA. Flashing and reboot seem to require a lot of power.

rei-vilo avatar May 03 '15 15:05 rei-vilo

@squix78 Take a look at this https://github.com/themadinventor/esptool/issues/36#issuecomment-102634652 , I just commented a workaround which is working under OS X, using a CH341 with Repleo driver, maybe it works for you too.

bender-2000 avatar May 16 '15 15:05 bender-2000

esptool rendered nodeMCU unhappy flashed the FW ok, but after reset ESPlorer could not connect to the board.

followed @LucasG2000 post only with slight change (I pressed Flash button only). After that press Reset button and ESPlorer is good to go.

running OSX 10.10.3

tomasinouk avatar Jun 10 '15 11:06 tomasinouk

Turns out my problem was with the mac driver, after updating it it looks like it works like a charm now! Thanks :)

AddoSolutions avatar Jul 17 '15 18:07 AddoSolutions

i can confirm too that updating mac driver can help there: http://www.mblock.cc/posts/run-makeblock-ch340-ch341-on-mac-os-sierra

sombriks avatar Dec 06 '16 05:12 sombriks