The most complex part of this build is flashing the firmware onto the NodeMCU. The firmware I am using is esp-link which is an open source project. The advantage of using this project is that, once the firmware is loaded, you can control all aspects of the WiFi module via a web interface, including baud rates, WiFi network names, passwords etc…
The main downside of the project is that it can be daunting to load the firmware initially. Most of the “scary” bits are made easier by using the NodeMCU as it includes a USB interface on board and this takes care of the majority of the “flashing” part of the firmware.
Start by downloading the release firmware from here. Note that for MS1, MS1/Extra running at 9600 baud the “release” version 2.0.14 works fine. At 115,200 baud though (MS2 and later) the release version gave me problems and flashing the latest “alpha” version fixed the issues.
Connect the NodeMCU to your Mac/PC using a USB cable. You will then need to identify the port your NodeMCU is connected on for later use. This guide is written from my experience using a Mac, Windows users will need to fill in some blanks themselves ! If any Windows users would care to write a “how to”, send me the details and I will add it to this page.
You will need to load the latest version of the python utilities for the ESP8266. The easiest way to do that is to use pip which is a python package installer.
Try issuing the following from your command line…
sudo pip install esptool
If this gives a “pip not installed” type error then you can install pip using…
sudo easy_install pip
sudo pip install esptool
You can test to see if it installed by simply running the following on the command line…
If you get a sensible response, you should be good to go ! Change directory to the directory you downloaded (and unarchived) the esp-link firmware into and you should then be able to run the following command, substituting the port for the port your NodeMCU is connected to… (replace the /dev/cu.SLAB_USBtoUART part). For the alpha version you will also need to change the boot_v1.6 to boot_v1.7
esptool.py --port /dev/cu.SLAB_USBtoUART --baud 230400 write_flash -fs 32m -ff 80m 0x00000 boot_v1.6.bin 0x1000 user1.bin 0x3fc000 esp_init_data_default.bin 0x3fe000 blank.bin
Once complete, test it is working by connecting to the WiFi that the module is broadcasting (ESP_xxxxxx) and point your browser at http://192.168.4.1/
If successful you will see a welcome screen for ESP-Link. The only change you need to make, using this web interface, is to change the baud rate to match your ECU. in the menu, choose µC Console and change the baud rate on that screen.