Skip to content

Instantly share code, notes, and snippets.

@switchtrue
Last active January 6, 2018 06:09

Revisions

  1. switchtrue revised this gist Jan 19, 2017. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion nodemuc.md
    Original file line number Diff line number Diff line change
    @@ -26,9 +26,14 @@ Install esptool:
    pip install esptool
    ```

    Erase:
    ```
    esptool.py --port /dev/tty.wchusbserialfd120 erase_flash
    ```

    Flash:
    ```
    esptool.py --port /dev/tty.wchusbserialfd120 --baud 115200 write_flash --flash_mode qio --flash_size 32m 0x0 esp8266-20160818-v1.8.3-35-g49dd532.bin --verify
    esptool.py --port /dev/tty.wchusbserialfd120 --baud 115200 write_flash --flash_size=detect 0 ~/Downloads/esp8266-20170108-v1.8.7.bin --verify
    ```

    Connect to the NodeMCU:
  2. switchtrue revised this gist Jan 19, 2017. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions nodemuc.md
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,13 @@ Install a serial driver for the NodeMCU from: [http://www.wch.cn/download/CH341S
    Plugin the NodeMCU and see if you can see it at `/dev/tty.wchusbserialfd120`
    **NOTE**: If you can't find it at the above locations try `ls /dev/cu.*` and see what else is available.

    **OSX Sierra Important Note**: After upgrading to Sierra plugging in my NodeMUC I kept getting Kernel panics and the laptop would restart. To fix this I uninstalled the original drivers with the following commands, restarted and then re-installed from the link above.
    ```
    sudo rm -rf /Library/Extensions/usbserial.kext
    sudo rm -rf /System/Library/Extensions/usb.kext
    # Restart computer now
    ```

    Grab firmware from here: https://micropython.org/download/

    Install pyserial:
  3. switchtrue revised this gist Aug 24, 2016. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions nodemuc.md
    Original file line number Diff line number Diff line change
    @@ -33,22 +33,22 @@ Might need to hit enter a few times at REPL to get `>>>`

    try it:
    ```
    print('Hello, World!')
    >>> print('Hello, World!')
    ```

    Connect to a network:
    ```
    import network
    n = network.WLAN(network.STA_IF)
    n.active(True)
    n.connect('<SSID>', '<password>')
    >>> import network
    >>> n = network.WLAN(network.STA_IF)
    >>> n.active(True)
    >>> n.connect('<SSID>', '<password>')
    ```

    Note: Don't get SSID and password wrong as it seems to indefinitely reconnect even after re-flashes and log to stdout, you can enter paste mode (ctrl+e) and enter the above code again to retry but its tricky.


    Start the Web REPL:
    ```
    import webrepl
    webrepl.start()
    >>> import webrepl
    >>> webrepl.start()
    ```
  4. switchtrue created this gist Aug 24, 2016.
    54 changes: 54 additions & 0 deletions nodemuc.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    NodeMCU mode: Keyes NodeMCU
    OS: Mac OS X (macOS)


    Install a serial driver for the NodeMCU from: [http://www.wch.cn/download/CH341SER_MAC_ZIP.html](http://www.wch.cn/download/CH341SER_MAC_ZIP.html)

    Plugin the NodeMCU and see if you can see it at `/dev/tty.wchusbserialfd120`
    **NOTE**: If you can't find it at the above locations try `ls /dev/cu.*` and see what else is available.

    Grab firmware from here: https://micropython.org/download/

    Install pyserial:
    ```
    pip install pyserial
    ```

    Install esptool:
    ```
    pip install esptool
    ```

    Flash:
    ```
    esptool.py --port /dev/tty.wchusbserialfd120 --baud 115200 write_flash --flash_mode qio --flash_size 32m 0x0 esp8266-20160818-v1.8.3-35-g49dd532.bin --verify
    ```

    Connect to the NodeMCU:
    ```
    screen /dev/cu.wchusbserialfd120 115200
    ```

    Might need to hit enter a few times at REPL to get `>>>`

    try it:
    ```
    print('Hello, World!')
    ```

    Connect to a network:
    ```
    import network
    n = network.WLAN(network.STA_IF)
    n.active(True)
    n.connect('<SSID>', '<password>')
    ```

    Note: Don't get SSID and password wrong as it seems to indefinitely reconnect even after re-flashes and log to stdout, you can enter paste mode (ctrl+e) and enter the above code again to retry but its tricky.


    Start the Web REPL:
    ```
    import webrepl
    webrepl.start()
    ```