ESP-01

By default, ESP-01 comes with an AT controllable firmware on board which is sufficient for sending raw TCP over WiFi. The module can also be flashed using the Arduino IDE.

Where we bought ours: https://www.aliexpress.com/item/Free-shipping-ESP8266-serial-WIFI-wireless-module-wireless-transceiver/32341788594.html

Follow the schematics: http://codeclub.cornwall.ac.uk/edenofthings/files/ESP-01FactSheet.pdf

You should use an external power supply for the ESP-01, as often USB UART adapters do not supply sufficient power.

Testing

Make sure to test your USB UART adapter first.

Baud rate should be either 9600, 57600 or 115200 (newest versions). After sending AT, you should get OK. You can use this library to test your module: https://github.com/guyz/pyesp8266 A list of AT commands can be found here: https://nurdspace.nl/ESP8266#AT_Commands

Output of our module was:

DEBUG:root:2nd boot version : 1.6
DEBUG:root:  SPI Speed      : 40MHz
DEBUG:root:  SPI Mode       : QIO
DEBUG:root:  SPI Flash Size & Map: 8Mbit(512KB+512KB)

UART Bridge

Source: https://github.com/jeelabs/esp-link/blob/master/FLASHING.md#initial-serial-flashing

0. Hook up ESP-01 for flashing.
1. Get esptool: ''brew install python@2; pip install esptool''
2. Press and hold reset. While holding, press flash. Let go of both.
3. Run ''esptool.py -cesp8266 --port /dev/tty.wchusbserial1410 --baud 460800 write_flash -fs 8m -ff 40m  0x00000 boot_v1.6.bin 0x01000 user1.bin 0xFC000 esp_init_data_default.bin 0xFE000 blank.bin'' 
(You can get the bin files here: https://github.com/jeelabs/esp-link/releases)  
4. Connect to the web interface using AP to set wifi credentials.
5. ''sudo apt-get install socat'' on device that will be connected via wifi to uart endpoint.
6. ''sudo socat pty,link=/dev/ttyTCP0,ignoreeof,user=pi,group=dialout,mode=777,raw,echo=0 tcp:192.168.2.4:23'' will add a local serial port which is actually the esp connected over wifi 

Application: CNC.js

One really useful application is to connect the CNCs xPro controller to a remote computer without using USB.

1. Follow https://cnc.js.org/docs/rpi-setup-guide/
2. Point your browser to the Raspis IP