I've recently picked up a device that happened to use a CH340 USB chip on it. Of course, for this to be able to work on the Raspberry Pi, I'd need to install the required driver for it.

I found the driver on this website, and followed the instructions on this github repository.

Unfortunately, this didn't work out, and it gave me the following error.

make    -C /lib/modules/4.1.19-v7+/build 
make[1]: *** /lib/modules/4.1.19-v7+/build: No such file or directory.  Stop.
Makefile:5: recipe for target 'default' failed
make: *** [default] Error 2

I've tried making a build directory in the /lib/modules/4.1.19-v7+/ directory, but all it does is search for a non-existant Makefile.

Here's what the Makefile looks like for anyone who would like to check it out.

KERNELDIR := /lib/modules/$(shell uname -r)/build
PWD :=$(shell pwd)
    $(MAKE) -C $(KERNELDIR) M=$(PWD)  
    rm -rf .tmp_versions Module.symvers *.mod.c *.o *.ko .*.cmd Module.markers modules.order
    modprobe usbserial
    insmod ch34x.ko
    rmmod ch34x
    obj-m := ch34x.o

I can't figure out what I'm doing wrong here, but I really need this driver to be installed.

This may be some useful information:

  • lsusb brings up this for the device: QinHeng Electronics HL-340 USB-Serial adapter.
  • I'm using a Raspberry Pi 2 with Raspbian Wheezy installed.
  • The actual device I'm using is a clone Arduino Nano device from amazon.
  • I'm trying to upload code to the Arduino using ino.

If any more information is needed, let me know.


"Of course, for this to be able to work on the Raspberry Pi, I'd need to install the required driver for it" have you tried it?

My Pi has drivers for CH340, as do most Linux distributions, although I cannot verify for obsolete, unsupported Wheezy distributions.

  • I have tried it, yes. The closest driver I could find was a ch341 driver. Doesn't seem to work. – Zachary Vincze May 20 '17 at 23:55
  • I agree with @Milliways. I use Jessie and have never had any problem with any of the Nanos I use with my Pis all around the solar power plant. I wonder what is making you think you need an extra driver? Are you looking in /dev for entries like ttyUSBx? That is how you know they have connected. If they do, then you don't need any extra hardware driver for USB serial support. – SDsolar May 21 '17 at 5:03
  • Error on my side. It wasn't an issue the drivers, it was an issue with what tool I was using to upload the code to the nano. Everything seems to work now. I apologize for this. – Zachary Vincze May 21 '17 at 14:18

The compilation instructions in https://github.com/aperepel/raspberrypi-ch340-driver is for its driver binary or source here.

You may follow the instructions and try again to install or compile the driver.

Hope this help.

  • There are more instructions towards the end of the README that talks about how to compile it from the source. Unfortunately, I wasn't able to install it as simple as the repo said it was. I received issues like most other people in the issues sections. This one in particular: github.com/aperepel/raspberrypi-ch340-driver/issues/3 – Zachary Vincze May 20 '17 at 20:39
  • @ZacharyVincze Not sure what you did. You tried to download ch34x.ko binary and install it by sudo insmod ch34x.ko? You got the error mentioned in ../issue/3 webpage while you were installing the driver instead of compiling it from source? – thewaywewere May 20 '17 at 22:09
  • I have done that, and I've gotten the issue which is why I tried to compile it from source. The issue I'm having is compiling it from source. – Zachary Vincze May 21 '17 at 2:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.