Inspired by #ESPecially Easy AVR Programming I started playing around with ESP-Link a bit. As mentioned in the readme you can point some programs (e.g. Avrdude, PuTTY) directly at the ESP8266's telnet socket but as far as I can tell most others (e.g. Termite, Arduino, ESPlorer) will only work with serial ports. Therefore a tunnel from a virtual serial port to the ESP's telnet port is required.
Some quick googling revealed com0com/com2tcp and socat should accomplish just that on Windows and Linux, respectively. It wasn't immediately obvious to me how to set up com0com so I made a detour over this other program also called COM2TCP. It was really easy to set up and worked right out of the box but unfortunately free usage is limited to 45 days so I went back and decided to figure out com0com.
This is how to set up com0com and com2tcp in Windows:
- Download com0com from the main project page (same link as above) and install it. During the setup I chose not to install any port pairs. I also got a couple of error messages but continued anyway.
- Download com2tcp executable (the one that's part of com0com) from the projects file section. The zip file containing the exe also hast a brief readme on this process.
- Set up a port pair by starting com0com's Setup Command Prompt (found in the start menu or as setupc.exe in com0com's folder in Program Files) and running the following commands:
install PortName=COMx PortName=CNCB0where you replace the x with the number of an unused COM port. This also gave me an error message and I again continued.
updateSame thing here with the error messages and continuing. After this step you should see the ports with the defined names in the device manager.
- Set up com2tcp by opening the folder containing com2tcp.exe in a command prompt (I just open the folder and enter cmd in the address bar). Similar to the instructions from the readme run
com2tcp.exe --baud 115200 --ignore-dsr --telnet \\.\CNCB0 [your ESP's IP] 23
It should respond with some information and some OK's and the connection should be good to go.
To set up the tunnel in Linux just install socat
sudo apt-get install socat
sudo socat pty,link=/dev/ttySx tcp:[your ESP's IP]:23
To test the connection you can open the virtual COM port (your COMx) with your favorite terminal program, send something and verify the output of the ESP.