Short tip: brltty interferes with esptool.py under Pop!_OS

When using ESPHome or esptool.py under Pop!_OS 22.04 I recently encountered the problem that development boards (ESP8266, ESP32) could not be flashed:

 1$ esphome upload hurrdurr.yml
 2INFO Reading configuration hurrdurr.yml...
 3esptool.py v3.3.1
 4Serial port /dev/ttyUSB0
 5Connecting....
 6Chip is ESP8266EX
 7Features: WiFi
 8Crystal is 26MHz
 9...
10Writing at 0x000123da... (22 %)
11ERROR Running command failed: Could not configure port: (5, 'Input/output error')
12ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 460800 --port /dev/ttyUSB0 --chip esp8266 write_flash -z --flash_size detect 0x0 /home/[...]/firmware.bin locally.

In the kernel logs, the connected development board briefly appeared via the expected device node /dev/ttyUSB0, but then disappeared after a few seconds:

 1[ 133.972859] usb 1-2: new full-speed USB device number 7 using xhci_hcd
 2[ 134.122504] usb 1-2: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
 3[ 134.122510] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
 4[ 134.122513] usb 1-2: Product: CP2104 USB to UART Bridge Controller
 5[ 134.122515] usb 1-2: Manufacturer: Silicon Labs
 6[ 134.122517] usb 1-2: SerialNumber: 01EAFBD6
 7[ 134.126272] cp210x 1-2:1.0: cp210x converter detected
 8[ 134.127300] usb 1-2: cp210x converter now attached to ttyUSB0
 9[ 134.350687] usb 1-2: usbfs: interface 0 claimed by cp210x while 'brltty' sets config #1
10[ 134.352606] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0

After some research I found out that the tool brltty is apparently responsible for this. The background service controls braille displays in the text console and thus enables blind people to use the system outside the graphical user interface. In my case, disabling the service solved the problem:

1# systemctl disable --now brltty.service brltty-udev.service
2# systemctl mask brltty.service brltty-udev.service

The firmware could be transferred afterwards:

1$ esphome upload hurrdurr.yml
2INFO Reading configuration hurrdurr.yml...
3esptool.py v3.3.1
4Serial port /dev/ttyUSB0
5Connecting....
6Chip is ESP8266EX
7Features: WiFi
8Crystal is 26MHz
9...

Translations: