Flashing AI-Think NodeMCU Boards

I ordered a handful of the cheapest nodemcu boards I could find from ebay. A couple of weeks later I got a nodemcu 'like' board from a company callsed AI-THINKER. The boards following instructions written on the back of them:

1. Install CH340G driver.
2. Use 9600bps baud rate.
3. Connect to WiFi.

I tried playing with two of the boards, powering them up and searching for wifi networks showed a network with a name like:

AI-THINKER_238810
AI-THINKER_23A9BF

Connecting to the wifi was fine, but I didn't really know what they expected me to do. nmap'ing the device has no results and an hour googling didn't really show up anything. Connecting over serial resulted in some noise then nothing.

I was going to flash micropython anyway, so lets do that.

Flash micropython

Connecting to the nodemcu board over serial spits out some gibberish no matter the baud rate I pick.

$ sudo cu -l /dev/ttyU1 -s 76800
Connected
Sd3²ì{£P:ýCê
ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 1856, room 16 
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8 
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8 
tail 0
chksum 0x79
csum 0x79

2nd boot version : 1.5
  SPI Speed      : 40MHz
  SPI Mode       : DIO
  SPI Flash Size & Map: 8Mbit(512KB+512KB)
jump to run user1 @ 1000

êñ+Pr-r+§(r

SD«¢hJëÙ-$xùÊkPx\)§k ¢ÀjtNü

Some time with a scope reveals the board is starting up at one rate then switching to another. The rate switch means the esptool is unable to do automatic baud rate detection.

With that we can flash the boards:

erase the flash
esptool.py --port /dev/tty.wchusbserial1420 erase_flash

flash the image
esptool.py --port /dev/tty.wchusbserial1420 --baud 76800 write_flash --flash_size=8m 0 esp8266-2016-05-03-v1.8.bin

reset the board

cu -l /dev/tty.wchusbserial1420 -s 115200
MicroPython v1.8.2 on 2016-08-05; ESP Module with ESP8266
Type "help()" for more information.
>>> 

blog morning

Posted on