this post was submitted on 07 Jul 2024
9 points (84.6% liked)

Linux

48190 readers
979 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Hi all, I've recently switched over to Linux Mint from Windows 10 and I'm having trouble installing a CH340 driver from Sparkfun. I've managed to unzip the contents and have it in this location: /home/user/Downloads/CH341SER_LINUX. I've tried running the files using the ./ command for both the ch34x.c and Makefile but ran into a bash issue which I'm stuck trying to figure out. Could someone please tell me how to make it work? I've already looked up a couple of different videos on Youtube but they kind of skip the explanation of how to install this driver on Linux in favor of Windows and MacOS.

Please see the attached image for the response I get in the terminal.

UPDATE: It turns out I had a bad micro USB cable. Most of the ones I was using to connect to an ESP32 board were charge only. Mint apparently had the driver for this all along. Thanks for the help everyone.

top 19 comments
sorted by: hot top controversial new old
[–] [email protected] 12 points 4 months ago (2 children)

Why are you trying to install a driver for a CH340? The driver is already built into the kernel. Just plug it in and it will work.

[–] [email protected] 2 points 4 months ago (1 children)

This.

However sometimes the user can't access the device. Depending on your system, I recommend adding your user to the dialout/serial group.

I.e. quick online search

[–] [email protected] 1 points 4 months ago

Another issue is that brltty can take over the serial port. The easiest fix is to just uninstall it if you don't use a braille display.

[–] [email protected] 1 points 4 months ago (1 children)

Like nearly all drivers lol

Drivers I needed to pay special attention to:

  • NVidia (we all know the official stance on that topic)
  • e1000e needs patching because my Laptops NIC somehow reports the wrong NVM checksum
  • Some obscure chinese "USB to DVI-D" adapter
  • The fingerprint sensor in my Laptop, as it's still experimental
[–] [email protected] 2 points 4 months ago* (last edited 4 months ago)

Drawing tablet drivers!

To be fair, it actually does work out of the box, but shortcut mapping doesn't really work well outside of the buttons on the pen itself and pressure curves isn't customizable yet, at least on KDE.

[–] [email protected] 11 points 4 months ago* (last edited 4 months ago) (1 children)

Please dont follow windows workflows.

If you run a random script with or without sudo, you can easily get malware or break your system.

A .c file is also not ran, it is a C source file and needs to be compiled

i.e. you are doing something completely wrong and followed some strange advice.

Instead,

  1. Try if the USB cable is the only issue
  2. Drivers are in the kernel, so you cannot just install them
  3. Ask Linux Mint people how to do this, or Ubuntu or Debian people (the distros are related)
[–] [email protected] 3 points 4 months ago

I agree with your sentiment. Just one small thing: .c files are usually C source code, and are meant to be compiled into binaries.

It doesn't change OP's situation at all though.

[–] [email protected] 1 points 4 months ago* (last edited 4 months ago) (1 children)

*.c files are C source files, you can't run these directly. Run the makefile with sudo make or sudo make install (assuming you have make installed) to build (or build and install) the driver.

edit: Oops didn't read far enough into your post, you've already tried make. What error does it give you?

[–] [email protected] 0 points 4 months ago (1 children)

I get this as a result:

user@user-System-Product-Name:~/Downloads/CH341SER_LINUX$ sudo make Makefile

make: Nothing to be done for 'Makefile'.

[–] [email protected] 3 points 4 months ago* (last edited 4 months ago)

You don't pass in Makefile to make as it will read that file automatically. Nor you need sudo with make as compiling doesn't need any special privileges.

Step:

  1. make: compile the code to binary
  2. sudo make install: install the binary to your system
[–] [email protected] 1 points 4 months ago* (last edited 4 months ago)

The driver should already be installed but there seems to be an issue with brltty registering the corresponding USB ID when they shouldn't. You can probably fix it by following this guide: https://koen.vervloesem.eu/blog/how-to-stop-brltty-from-claiming-your-usb-uart-interface-on-linux/ (or this one: https://unix.stackexchange.com/a/670637)

Edit: Perhaps this has since been fixed in Mint 21 / Ubuntu 22.04.

[–] [email protected] 0 points 4 months ago (1 children)

I did what abominable_panda suggested and it returned a "wait_queue_t" and a couple of pointer type errors. I'm not sure if that's something that could be fixed with installing something else, but I'm not at all familiar with troubleshooting on this OS yet. The troubleshooting part you mentioned is if it successfully installed but there are issues. It doesn't quite explain the initial installation part.

As for cmnybo's question, I'm trying to program a ESP32 module with the Arduino IDE. I've tried just plugging it in and hoping the driver would already be installed but lsusb doesn't show it on the results.

[–] [email protected] 2 points 4 months ago (2 children)

If it's not showing up in lsusb and there is no activity in syslog when connecting or disconnecting it, then the problem is not a driver. It's likely a bad cable or you got a dead module.

[–] [email protected] 1 points 4 months ago

True, the device should absolutely be shown on lsusb

[–] [email protected] 1 points 4 months ago

You're right about the bad cable. I have a collection of about 10 USB A to USB micro cables and only one of them showed up on lsusb! Thanks for the advice!