LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installling a Driver on Linux Lite from a Zip File
#1
I apologize for being new to Linux, but I'm tying to install a USB device driver for an aftermarket Arduino UNO Board.  This board requires what is called a CH340 serial driver.

I downloaded the driver in a zip file from here:
USB CH341/CH340 LINUX  URL to zip file - http://www.5v.ru/zip/ch341ser_linux.zip

I downloaded this zip file and unzipped it.  It produces three files. 

1. A very short "Readme" file. 
2. A Makefile
3. and a ch34x.c file.

Here's the content of the Readme file:

// ChangeLog
// 1.0 - 1.1  modified to solve transmition between ch341 and ch341

Instructions

Note: 1.Please run followed executable programs as root privilege
      2.Current Driver support versions of linux kernel range from 2.6.25 to 3.9.10
      3.Current Driver support 32bits and 64bits linux systems

Usage:
(load or unload linux driver of CH34x)
//compile
#make
//load ch34x chips driver
#make load
//unload ch34x chips driver
#make unload

The following is the content of the Makefile file:

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


The ch34x.c file contains a large source code of C programming language.  I can also open that in a text editor and read it, but it's quite large so I won't copy and paste it here.

~~~~~~~

In any case, I don't know what to do with these files?  If I click on the Makefile it just opens in the text editor.

QUESTION: How do I go about actually installing this driver?

I imagine I need to use the terminal and type in commands, but I've never installed anything like this before so I don't know how to do this.

Also if it's possible to just use the command line to do something like $ sudo apt-get install CH340 driver that would be great, but I don't know how to do that either.  This is why I downloaded the zip file in the first place.

Thanks for any help.
Reply
#2
I'm fooling around trying things, but I have no clue what I'm doing:

This is my command prompt when I'm in the directory with the make file:

james-cq57@Presario-CQ57:~/Documents/Projects Archives/1040 Arduino/CH340 Driver for Linux/CH341SER_LINUX$

So just ignore all that garbage:  Wink

After looking around on Google I decided to try to just type in the command "make" to launch the make program.

james-cq57@Presario-CQ57:~/Documents/Projects Archives/1040 Arduino/CH340 Driver for Linux/CH341SER_LINUX$ make
make -C /lib/modules/4.4.0-112-generic/build  M=/home/james-cq57/Documents/Projects Archives/1040 Arduino/CH340 Driver for Linux/CH341SER_LINUX 
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-112-generic'
make[1]: *** No rule to make target 'Archives/1040'.  Stop.
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-112-generic'
Makefile:5: recipe for target 'default' failed
make: *** [default] Error 2
james-cq57@Presario-CQ57:~/Documents/Projects Archives/1040 Arduino/CH340 Driver for Linux/CH341SER_LINUX$

As you can see I'm already getting errors.  So I'm going to stop here until I figure out what's going on.
Reply
#3
I finally figured it out by trial and error.  8)

I came to the realization that the // in the read-me instructions represents comments.
And then I figured the # needed to be used in front of the make command.

So I just typed in #make

Nothing happened other than I got a clean prompt back with no error codes.

Then I typed in #make load

Again nothing happened other than I got a clean prompt back with no error codes.

So then I plugged in the Arduino board and by golly it works now.  So that must have worked.

Seems to me the system should have at least returned something like "done" to let you know it actually did something.

Anyway, it seems to be working now so I'll mark this thread "solved".

It took me several hours just to figure this all out.  Argggghhhhh! 

Such simple stuff can be overwhelming when you have no clue what you're doing.
Reply
#4
I'm curious.  Did the Install Drivers link on the Welcome screen not offer what you needed?
Reply
#5
(02-11-2018, 11:09 AM)RandomBoy link Wrote: I'm curious.  Did the Install Drivers link on the Welcome screen not offer what you needed?

I didn't think to try that.  I clicked on the box to not show the welcome screen every time I boot up, I'm not sure how to get it back.

In any case, this particular CH340 serial driver is supposed to be hard to come by according to everything I've read about it.  I used the link that came with the Arudino boards I have.  These are "After-market" Arduino boards so they don't use the standard interface.

In any case, it turned out to be really simple.  I just opened a terminal in the folder where the makefile file was and then typed in the following two commands:

#make

#make install

And apparently that did it.

By the way, it's working perfectly now.  I was able to upload some of my programs to my Arduino board and those programs run just fine.  So apparently I'm all set now.

Although if there is a better way to do this it would be nice to know.  I'm converting over a couple notebook computers to Linux Lite so I'll need to update the drivers on them too.  I'll give the update drivers a shot on one of those. 

I suppose I'll need to plug the Arduino board into the computer when I do that so it recognizes that something needs a driver?

The way I did it just now I didn't even have the Arduino board plugged in when installing the driver.

I'll give the Install Drivers a shot on my other Linux Notebook and if I remember I'll report back on whether or not that worked.
Reply
#6
I know this is marked solved, but I'm curious why you had to install a CH340 driver. Every version of linux I've tried (I use an arduino too) has recognised the serial device as soon as it was plugged in. IIRC the arduino website states that windows needs a driver but not linux. You just add user (yourself) to the dialout group for permission reasons. I only run Linux Lite now and for every version, that is all I needed to do.

Setting up arduino on linux, see,

http://https://www.arduino.cc/en/Guide/Linux

1) Lenovo T520 i5 LL3.8 8GB ram, fast & stable
2) Medion P4 32bit LL3.8 1GB ram, quite fast & stable
3) eeePC 901 32bit LL3.8 1GB ram, fast & stable
4) eeePC 701 32bit LL3.8 1GB ram, slower & stable but small and light enough to travel with me to New Zealand when visiting family in Blenheim.
Reply
#7
[member=296]justme2[/member],

These are "After-market" Arduino boards (made in China) so they don't use the standard Arduino interface.

I had to install the CH340 driver on Windows too.  This isn't a Linux problem.  It's unique to these special boards.
The manufacture of these boards includes the link to this driver for Windows, Linux and Apple.

The only reason I was having a problem on Linux is because I didn't know how to install the driver from the zip file.

It's working now. That's the good part.  Smile

If you have a standard Arduino board you don't need the CH340 driver.

Reply
#8
(02-11-2018, 12:35 PM)Robo_Pi link Wrote: [member=296]justme2[/member],

These are "After-market" Arduino boards (made in China) so they don't use the standard Arduino interface.

.......

If you have a standard Arduino board you don't need the CH340 driver.

But I still don't understand - my arduinos are cheap direct from china too! No matter, glad its working. Smile
1) Lenovo T520 i5 LL3.8 8GB ram, fast & stable
2) Medion P4 32bit LL3.8 1GB ram, quite fast & stable
3) eeePC 901 32bit LL3.8 1GB ram, fast & stable
4) eeePC 701 32bit LL3.8 1GB ram, slower & stable but small and light enough to travel with me to New Zealand when visiting family in Blenheim.
Reply
#9
I'm not clear about what's going on either.  I was getting into robotics in 2015 pretty seriously.  I bought tons of stuff at that time.  I think I currently have over a dozen Arduino UNO boards.  They were like $6 a piece so I bought a bunch just to play with at that price.  8)

I'm glad I did too because I can't find them that cheap anymore.  Anyway I'm just now getting back into it.  I just happened to remember that these boards had to have a special driver for some reason.  It took me a while to find the information again, but fortunately I was able to find it from Amazon where the product information was still there with the link to the driver files.

Anyway, it's great to get these board back up and running.  They are all coming back to "life" now.  And I'm re-organizing all my code sketches trying to get back into it.

I also have four Mega boards, they too use these special CH340 serial drivers too.  Not sure why.  But I got them back up and running too.

I was also working with Raspberry Pi's back then too.  I have one B+ and four A+ cards.  I use the B+ to set things up initially and then switch over to the lower power A+ for the actual projects.  The A+ has a single USB port which I use a WiFi dongle on so I can communicate with my robot using my Notebook computer.  The Raspberry Pi has most of the programs, but I use the Notebook to tell it what to do, and get information back about how well the task is going.

I'm getting back into that too, and it's going to be yet another "learning curve" just to get back to where I was.  I haven't gotten the Raspberry Pi out yet.  I'm just now working on catching back up to where I was with the Arduino boards.

My original plan was to use the Raspberry Pi as the "Main Brain" of the robot, and have a few Arduino boards on the robot too for specialized task.  The Raspberry Pi would then instruct the Arduino boards what to do and then be freed up to monitor other things.

It's a pretty nice scheme.  Too bad I had gotten out of it.  Life sometimes interferes with the fun projects we try to do.  ;D

I'm just glad to get these boards back up and running.  I was afraid that I would have forgotten how to program them.  But fortunately once I looked at the sketches everything made perfect sense.  So that's a good sign.  I was afraid it might all look like Greek by now.

I hope I can catch back up on where I was with the Raspberry Pi just as easily.  I had it connected via Remote Desktop to my Notebook and I was starting to learn Python since that's what people seem to like to program in on the Raspberry Pi.  It will be a while before I get back into that.  I have a bit more to catch up on with the Arduino projects first.

Right now I'm mainly trying to organize all my old sketches and find the best versions of each project.  Once I get things weeded down to just the good stuff, I'll move on to seeing if I can catch back up on the Raspberry Pi.  I'll need to get re-organized with that stuff too.

Fortunately I kept pretty good notes, and left a lot of detailed comments in my code.  So that helps a LOT.
Reply
#10
[member=7348]Robo_Pi[/member]
Coincidence, I bought my chinese boards in 2016, I guess there are numerous clone versions and manufacturers so that may be the reason for our different outcomes. I believe that arduino is totally open source but CH340 code is closed source. I can't remember where I bought them from, either Amazon or more likely eBay but I do remember them delivered in an airmail package from China and wondered how a profit was made on such a cheap purchase with free post & packaging. Delivery was quoted as something around 30 to 45 days but they arrived in about 5 days! Go figure!

(I also work with raspberry pi,  python and the amazing ESP8266-12F wifi chips.)
1) Lenovo T520 i5 LL3.8 8GB ram, fast & stable
2) Medion P4 32bit LL3.8 1GB ram, quite fast & stable
3) eeePC 901 32bit LL3.8 1GB ram, fast & stable
4) eeePC 701 32bit LL3.8 1GB ram, slower & stable but small and light enough to travel with me to New Zealand when visiting family in Blenheim.
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)