Talk to Arduino and ESP32 from the Browser with the Web Serial API
For years, talking to a microcontroller meant installing an IDE, a terminal program or a driver-specific tool. The Web Serial API lets a web page open a serial…
"The board doesn't show up" is one of the most common and most frustrating problems in robotics. The cause is rarely the board itself; it is usually the cable, a driver, a permission or another program holding the port. This guide works through the causes in the order that finds them fastest, on Linux, Windows and macOS.
Before blaming software, check that the operating system notices the board when you plug it in.
sudo dmesg -w, then plug the board in. You should see a new USB device and a line naming its serial port, such as ttyUSB0 or ttyACM0. lsusb lists connected USB devices.ls /dev/cu.* before and after plugging in.If nothing at all happens, suspect the cable first. Many USB cables carry power only: the board's LED lights up, but there are no data wires. Try a cable you know transfers data, then a different USB port, avoiding unpowered hubs.
Boards either have a USB-to-serial converter chip or a microcontroller with USB built in. The chip decides the driver and the port name:
| Chip / type | Found on | Linux port | Driver notes |
|---|---|---|---|
| CH340 / CH341 (WCH) | Many Arduino clones, ESP32 and ESP8266 boards | /dev/ttyUSB0 | Built into Linux. Windows usually needs the WCH driver. |
| CP2102 / CP2104 (Silicon Labs) | Many ESP32 development boards | /dev/ttyUSB0 | Built into Linux. Windows may need the Silicon Labs driver. |
| FT232 (FTDI) | USB-serial cables, older boards | /dev/ttyUSB0 | Usually built in everywhere. |
| Native USB (CDC ACM) | Arduino Uno R4, Leonardo, ESP32-S3/C3 boards using their own USB | /dev/ttyACM0 | No driver needed. |
On macOS, the ports appear as /dev/cu.usbserial-…, /dev/cu.wchusbserial… or /dev/cu.usbmodem…. Use the cu. names rather than the tty. ones for connecting.
Serial devices belong to the dialout group. If opening the port fails with "permission denied", add yourself to it and log out and back in (a new terminal is not enough):
sudo usermod -aG dialout $USER
Check with groups. Avoid running your tools with sudo as a workaround; it creates root-owned files and hides the real problem.
On some Ubuntu versions, the brltty package (a driver for Braille displays) claims devices with the same USB ID as common CH340 boards, and the serial port vanishes a moment after it appears. dmesg shows brltty taking the interface. If you don't use a Braille display, removing the package fixes it: sudo apt remove brltty.
ModemManager probes new serial devices to see whether they are modems, sending them commands for several seconds. A udev rule can tell it to ignore your board (see below), or you can remove ModemManager on robots that don't need it.
With two or more USB-serial devices, the numbering depends on plug-in order. Use the stable names in /dev/serial/by-id/, or create your own name with a udev rule. For example, /etc/udev/rules.d/99-robot.rules:
SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="robot_mcu", ENV{ID_MM_DEVICE_IGNORE}="1"
Find your device's IDs with lsusb, then reload with sudo udevadm control --reload-rules && sudo udevadm trigger. The board is now always /dev/robot_mcu, which is what your ROS launch files should use. If two identical boards share the same IDs, match on ATTRS{serial} as well.
sudo fuser /dev/ttyUSB0 shows which process holds it. Two programs reading the same port each get part of the data, which looks like corruption.
For years, talking to a microcontroller meant installing an IDE, a terminal program or a driver-specific tool. The Web Serial API lets a web page open a serial…
You connect to a board, open the serial monitor, and get a screen of question marks, boxes and random symbols, or nothing at all. Almost every time, the cause…
Many robots split the work between a computer running ROS 2 and a microcontroller that drives the motors and reads the encoders. The serial link between them…
Printing sensor values over serial is the quickest way to see what a robot's microcontroller is doing. Done carelessly, it gives you a wall of numbers you…
If you have any query or problem
feel free to contact us
email: [email protected]
Comments 0