Skip to content

Wireless serial with esp8266

m-kozlowski edited this page Feb 14, 2019 · 2 revisions

I was going to drill a hole in the case to install usb type b port, but I thought it might be a good idea to give a chance to spare esp-8266 and create wireless serial bridge. It works amazingly well so far, so I've decided to share my setup.

Installation

  1. flash https://github.com/jeelabs/esp-link/
  2. Configure WIFI connection
  3. Connect pins to ISP header (GND, RX, TX)
  4. Steal some current to power esp. I'm using C20 pad, where pull-up resistor from cold-junction mod goes
  5. find some nice spot to stick esp board to the case. I've wrapped it with some kapton to avoid short circuit and zip tied to vent holes
  6. reassemble, power on and test it:) esp-link listens on port 23

OTA upgrades (kind of)

After entering bootloader it is possible to flash new firmware over WIFI. What I needed to do is:

  1. create virtual com port
    socat pty,link=/dev/virtualcom0,raw,echo=0,ignoreeof tcp:esp-link:23
    
  2. change port in Makefile
    -FLASH_TTY := /dev/ttyUSB0
    +FLASH_TTY := /dev/virtualcom0
    
  3. make sure esp-link uses correct baud for flashing (57600). Instruction says it's set up in uC Console tab in web interface
  4. make flash
    Flashing T-962-controller.hex to /dev/virtualcom0
    ./lpc21isp "./build/T-962-controller.hex" /dev/virtualcom0 57600 11059
    lpc21isp version 1.97
    File ./build/T-962-controller.hex:
            loaded...
    Start Address = 0x000000C4
            converted to binary format...
            image size : 78552
    Image size : 78552
    Synchronizing (ESC to abort).................................... OK
    Read bootcode version: 13
    2
    Read part ID: LPC2134, 128 kiB FLASH / 16 kiB SRAM (0x0002FF12)
    Will start programming at Sector 1 if possible, and conclude with Sector 0 to ensure that checksum is written last.
    Erasing sector 0 first, to invalidate checksum. OK
    Sector 1: ...............................................................................................
    <...>
    Sector 0: ..............................................................................................
    Download Finished... taking 112 seconds
    Now launching the brand new code
    
  5. Restart using power switch

Caveats

  1. Connecting with telnet didn't work for me, because it terminates lines with or , and UE firmware expects only
  2. using "terminals" that send data as you type won't work either, because of #131. nc works fine.