USB to serial boards are necessary to program and debug boards, and/or access the serial console, and while they are very cheap, you may be in a situation where you don’t have any around, but you do have some Arduino compatible boards. It’s been possible to transform an Arduino board into a USB to TTL debug for several years using ArduinoSerialBypass.ino sketch, but I’ve been informed this also works on ESP8266 boards such as Wemos D1 Mini. The sketch could not be simpler:
1 2 3 4 5 6 7 8 9 |
void setup() { pinMode(0,INPUT); pinMode(1,INPUT); } void loop() { } |
The code simply makes sure that Tx and Rx pins are set as inputs in order not to disturb the serial connection as explained below: This code makes the Arduino not interfere with pins 0 and 1 which are connected to RX and TX on the FTDI chip. This allows the data coming from the FTDI USB 2 Serial chip to flow directly to another device. […]