A Couple of Clone Arduino Linux Issues

A Couple of Clone Arduino Linux Issues

The serial port appears for a single second, and then vanishes before you can upload any code.

This has been happening to me with Pop OS, but apparently also happens with other Ubuntu variants. I can’t believe what the cause is, but if you check dmesg and you will possibly find the following occurring :

[   98.044600] usb 3-2: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice=81.33
[   98.044606] usb 3-2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[   98.044607] usb 3-2: Product: USB Serial
[   98.046052] ch341 3-2:1.0: ch341-uart converter detected
[   98.046409] usb 3-2: ch341-uart converter now attached to ttyUSB0
[   98.608979] input: BRLTTY 6.4 Linux Screen Driver Keyboard as /devices/virtual/input/input41
[   98.887664] usb 3-2: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1
[   98.888541] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0

What we see happening is the OS finds the newly plugged in CH340 based serial device on your board and creates a new serial port, in my case, ttyUSB0. Excellent. But then, along comes “BRLTTY”. BRLTTY has decided it knows what this device is, removes the serial port and turns the device into an input / keyboard device. BRLTTY apparently knows best and claims all devices with the manufacturer / product ID of a USB to UART adapter chip, that is absolutely not always the product they think it is. This is really poor default behaviour, especially as this all happens silently. Apparently BRLTTY is accessibility software for the blind that is installed by default.

To solve the issue, assuming you’re not blind, simply type “sudo apt remove brltty” (without quotes) at the command line and it will be uninstalled, making the issue go away.

Not in Sync

The not in Sync error, where you get a repeated message such as the following :

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

… is an old one with many causes. One cause now seems to be that if you use a clone device, the Arduino IDE refuses to talk to it by default. The solution might be to change the “Processor” in the Tools menu to “ATmega328P (Old Bootloader)”. This would apply to boards such as Unos and Nanos. This might actually also apply to older genuine Arduino Boards.

As you might guess, I’ve had a slightly frustrating day. All I did was try to load a program into a clone board someone gave me the other day.

Leave a Reply