dnschneid / crouton

Chromium OS Universal Chroot Environment
https://goo.gl/fd3zc?si=1
BSD 3-Clause "New" or "Revised" License
8.57k stars 1.24k forks source link

Arduino clones: ch341.ko usbserial.ko #1368

Closed ingegno closed 9 years ago

ingegno commented 9 years ago

The Arduino IDE is not working with typical (legal) Arduino clones. After investigation, I attribute this to missing ch341.ko and usbserial.ko drivers. Is there a way to obtain these drivers or compile them somehow? Or can only Google do that.

HP chromebooks here for pupils, not much space to install a development version.

divx118 commented 9 years ago

You can compile them yourself see for example https://github.com/dnschneid/crouton/wiki/Build-chrome-os-kernel-and-kernel-modules For building modules I just use my main notebook (ubuntu 14.04 64 bit intel i7 12Gb ram), because the chromebook is a bit slow to do it. I also cross compile on it for arm kernel modules. A big problem is now disabling module locking to be able to load the kernel module. On dev channel this is not possible anymore (except making rootfs rw and change boot cmdline) and if it doesn't change soon also not on beta. See https://github.com/dnschneid/crouton/issues/1278 for the complete story.

ingegno commented 9 years ago

@divx118 Thanks for the info, it answers all my questions. I'll follow the guide to build these modules, as it is for pupils, compile once, and push to all of them. This issue can be closed, though it would be great if there was a repo somewhere where people can upload missing modules. Would save a lot of work.

divx118 commented 9 years ago

This issue can be closed, though it would be great if there was a repo somewhere where people can upload missing modules. Would save a lot of work.

Is a bit tricky, because you can also put some evil stuff in a module. However I have a repo for kernel headers. I also have some cifs modules available. If we get the possibility back to disable module_locking I want to give it some more structure and add some more useful modules.

bmcage commented 9 years ago

As module locking will stay, I opened an issue to have these modules: https://code.google.com/p/chromium/issues/detail?id=458785

divx118 commented 9 years ago

Module locking can still be disabled in dev mode, but we will need to turn of verified boot of the kernel. This wasn't needed before. See on how to do that https://github.com/dnschneid/crouton/wiki/Repack-kernel-to-Enable-VT_x-for-Virtualbox
@bmcage In your case it will be better to add the modules to the standard chromeos, so you won't need dev mode at all to use them. Thanks for posting the issue url to keep track.

divx118 commented 8 years ago

Since I got a few of those arduino uno with the CH341 I ran into the same issue now. I just used the kernel headers which can be installed from https://github.com/divx118/crouton-packages which also has the change-kernel-flags script to disable module_locking. After that download the source from http://www.wch.cn/download/CH341SER_LINUX_ZIP.html unzip:

$ cd ~/Downloads/CH341SER_LINUX
$ sudo apt-get install make
$ make
$ sudo insmod ch34x.ko

Note that this driver still isn't added to chromeos. Please star the issue https://code.google.com/p/chromium/issues/detail?id=458785 to perhaps make this happen in the future.

drinkcat commented 8 years ago

The ch341 kernel module has been added to Chromium OS kernels 3.8, 3.10, 3.14, and 3.18.

They will appear in Chrome OS from build >=7800.0.0 onwards (should be tomorrow's canary channel, but it will take a while to appear in dev/beta/stable channels, of course).

divx118 commented 8 years ago

@drinkcat thanks :)

DennisLfromGA commented 8 years ago

Saw that (Issue 458785) - great work Dr.Inkcat :+1:

bjpirt commented 8 years ago

Am I reading that issue correctly that support has now been merged in to Chromium OS?

I'm not fully sure on how the release process works but will all Chromebooks eventually update to include this?

divx118 commented 8 years ago

@bjpirt Yes, chromebooks that run the 3.8, 3.10,3.14 and 3.18 kernel So that would be almost all chromebooks, I believe some old ones are still on an ancient kernel before 3.8.11

bjpirt commented 8 years ago

Awesome, thanks - that makes my life a lot easier :-)

drinkcat commented 8 years ago

@bjpirt Yes, chromebooks that run the 3.8, 3.10,3.14 and 3.18 kernel So that would be almost all chromebooks, I believe some old ones are still on an ancient kernel before 3.8.11

All older chromebooks on 3.4 have been migrated to 3.8 a while back.

I'm not fully sure on how the release process works but will all Chromebooks eventually update to include this?

Yes, you can check http://cros-omahaproxy.appspot.com/, any release >=7800.0.0 will include the driver (so, nothing yet, unless you want to try canary channel).

divx118 commented 8 years ago

@drinkcat thanks for the info. I wasn't fully sure if all of them were migrated.

bjpirt commented 8 years ago

@drinkcat - thanks for the info, that's a very helpful list of devices. So if dev is on 7797, hopefully it should trickle through the release process and be included before too long.

bjpirt commented 8 years ago

I just spotted that the dev channel of Chrome OS is now at build 7821 so I thought I would give this a whirl to check and I'm please to report everything now seems to work well with CH340G based serial converters.

bjpirt commented 8 years ago

It's in stable now and seems to work for those who are interested.