$ xcode-select --install
$ brew tap homebrew/dupes
$ brew install binutils coreutils autoconf automake wget gawk libtool gperf gnu-sed --with-default-names grep bison libvorbis
$ export PATH=/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/gperf/bin:$PATH
Download and install macports https://www.macports.org/install.php
$ sudo port install git gsed gawk binutils gperf grep gettext py-serial wget libtool autoconf automake
製作一個 "case-sensitive"(可區分大小寫檔名)的虛擬磁碟,大小是 8GB:
$ hdiutil create ./eos.dmg -volname "esp-open-sdk" -size 8g -fs "Case-sensitive HFS+"
將 ESP8266 Open SDK 下載至此虛擬磁碟:
$ hdiutil mount ./eos.dmg
$ cd /Volumes/esp-open-sdk
$ git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
$ cd eos-open-sdk
編譯 "separated SDK":
$ make STANDALONE=n 如果不行就用$ make STANDALONE=y
根據畫面提示,修改 PATH 環境變數:
$ export PATH=/Volumes/ESPTools/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
編譯 NodeMCU Firmware
這裡提供一份事先編譯好的 NodeMCU firmware,可至node-wot下載。再依照以下說明,將 0x00000.bin 與 0x10000.bin 檔案燒錄至 NodeMCU 即可。
先安裝 pyserial 套件:
$ git clone https://github.com/pyserial/pyserial.git
$ cd pyserial/
$ sudo python setup.py install
下載 NodeMCU firmware 原始碼:
$ git clone https://github.com/nodemcu/nodemcu-firmware
編輯 app/include/user_config.h 檔案,將以下這一行的註解移除:
#define DEVKIT_VERSION_0_9 1
完成後開始編譯:
$ make
編譯完成後,得到以下二個檔案:
bin/0x00000.bin
bin/0x10000.bin
將以上二個檔案燒錄至 NodeMCU 更新即可。在 Linux 環境編譯 NodeMCU firmware,請另行參考這篇文章(#1)說明。
删除以前的firemware
esptool.py --port /dev/cu.SLAB_USBtoUART erase_flash
更新 NodeMCU Firmware
使用 NodeMCU firmware 的 esptool.py 工具,將編譯好的 firmware 檔案,下載至 NodeMCU。在 Mac 下使用 esptool.py 更新 NodeMCU firmware 時,需額外加上 -fm 與 -fs 二個參數:
$ cd /Volumes/esp-open-sdk/nodemcu-firmware
$ ./tools/esptool.py --port /dev/cu.SLAB_USBtoUART write_flash -fm=dio -fs=32m 0x00000 bin/0x00000.bin 0x10000 bin/0x10000.bin
$ brew tap homebrew/dupes
$ brew install binutils coreutils autoconf automake wget gawk libtool gperf gnu-sed --with-default-names grep bison libvorbis
$ export PATH=/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/gperf/bin:$PATH
Download and install macports https://www.macports.org/install.php
$ sudo port install git gsed gawk binutils gperf grep gettext py-serial wget libtool autoconf automake
製作一個 "case-sensitive"(可區分大小寫檔名)的虛擬磁碟,大小是 8GB:
$ hdiutil create ./eos.dmg -volname "esp-open-sdk" -size 8g -fs "Case-sensitive HFS+"
將 ESP8266 Open SDK 下載至此虛擬磁碟:
$ hdiutil mount ./eos.dmg
$ cd /Volumes/esp-open-sdk
$ git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
$ cd eos-open-sdk
編譯 "separated SDK":
$ make STANDALONE=n 如果不行就用$ make STANDALONE=y
根據畫面提示,修改 PATH 環境變數:
$ export PATH=/Volumes/ESPTools/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
編譯 NodeMCU Firmware
這裡提供一份事先編譯好的 NodeMCU firmware,可至node-wot下載。再依照以下說明,將 0x00000.bin 與 0x10000.bin 檔案燒錄至 NodeMCU 即可。
先安裝 pyserial 套件:
$ git clone https://github.com/pyserial/pyserial.git
$ cd pyserial/
$ sudo python setup.py install
下載 NodeMCU firmware 原始碼:
$ git clone https://github.com/nodemcu/nodemcu-firmware
編輯 app/include/user_config.h 檔案,將以下這一行的註解移除:
#define DEVKIT_VERSION_0_9 1
完成後開始編譯:
$ make
編譯完成後,得到以下二個檔案:
bin/0x00000.bin
bin/0x10000.bin
將以上二個檔案燒錄至 NodeMCU 更新即可。在 Linux 環境編譯 NodeMCU firmware,請另行參考這篇文章(#1)說明。
删除以前的firemware
esptool.py --port /dev/cu.SLAB_USBtoUART erase_flash
更新 NodeMCU Firmware
使用 NodeMCU firmware 的 esptool.py 工具,將編譯好的 firmware 檔案,下載至 NodeMCU。在 Mac 下使用 esptool.py 更新 NodeMCU firmware 時,需額外加上 -fm 與 -fs 二個參數:
$ cd /Volumes/esp-open-sdk/nodemcu-firmware
$ ./tools/esptool.py --port /dev/cu.SLAB_USBtoUART write_flash -fm=dio -fs=32m 0x00000 bin/0x00000.bin 0x10000 bin/0x10000.bin