A quick look at CH340 driver and Firefox touch input issues
2023-12-10
I'm currently rather busy with a new, secret-for-now project of mine and just don't have the time to write a proper article right now, so you'll have to do with this quick look addressing some computer issues I recently had. I'm personally running Linux Mint 21.2 right now, but from personal experience these problems affect almost all distributions and the fixes should therefore be rather universal...
If you have ever worked with cheap Arduino clones or other development boards from China, you're likely
familiar with the famous CH340 USB to serial adapter. I still remember what a pain it was to get it
running under Windows, but even here on the good side of operating systems we have to deal with an
annoying bug. If you plug a device with this chip in, it won't show up in your IDE and when you take a
look at the
lsusb
logs, you'll see that it indeed briefly shows up and then just disappears, which is even more confusing.
As it turns out, the correct driver for this chip is actually included in most Linux kernels, but gets
blocked by the braille display driver
brltty
. So, here's what to do:
- Check whether you need a braille display due to visual impairment.
- If the answer is yes, just buy an other device with a different USB to serial adapter - you won't easily get your current one working.
-
If the answer is no, simply purge the conflicting braille display driver via your package manager.
On Debian based systems run
sudo apt purge brltty
to do so.
The second issue I want to address regards Firefox's ability to deal with touchscreens on Linux. You see, I personally run a ThinkPad X390 Yoga for mobile work and note-taking with it's stylus and use the touchscreen occasionally to browse the web for facts and such while jotting down thoughts. By default, Firefox treats your touch input like any other mouse and therefore requires you to use the tiny scrollbar on the side and click links with your primary action button, which just isn't possible with your fingers. Luckily, there also is a rather easy fix for it:
-
Open
about:config
and change the value of the propertydom.w3c_touch_events.enabled
from2
to1
. - Close firefox and open a terminal with root privileges.
-
Append the line
MOZ_USE_XINPUT2 DEFAULT=1
to/etc/security/pam_env.conf
. - Reboot your system and you should be good to go.
These issues are obviously really specific, but if they annoy me there is at least a chance that they will also annoy some other people on the internet. If you are one of them and I was able to help you, feel free to leave a comment down below. Have a lovely day and I'll be back next week with a regular article...