Reasonable
Posts: 49
Joined: Sun Apr 20, 2014 8:12 pm

Connecting Arduino clone to Raspberry Pi CH340G chipset

Mon Jan 11, 2016 6:41 am

Has anyone successfully connected an arduino clone based on CH340G USB chipset to Raspberry Pi? Do you have step-by-step instructions for installing the USB driver? I found a couple examples on the web but getting compilation errors.

User avatar
hansotten
Posts: 300
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Mon Jan 11, 2016 10:59 am

No problem here. Just plugged in a Nano, driver loaded automatically.

pi@raspberrypibplus ~ $ lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter

pi@raspberrypibplus ~ $ ls /dev/ttyU*
/dev/ttyUSB0

And with Arduino IDE uploaded the blink example, blink - blink ....
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

Reasonable
Posts: 49
Joined: Sun Apr 20, 2014 8:12 pm

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Mon Jan 11, 2016 4:05 pm

Are you on Jessie or Wheezy? I'm running Wheezy and maybe that's why it doesn't work. Also, ch340 is listed as a non-supported chipset on Linux peripherals. I've tried 3 nanos and none of them show up after I run lsusb.

Massi
Posts: 1678
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Mon Jan 11, 2016 4:19 pm

sorry for the (probably incredibly stupid) question: is it possible to connect straight the arduino to the raspi using serial port? I mean to load code on the arduino.. without using a usb2serial adapter

User avatar
hansotten
Posts: 300
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Mon Jan 11, 2016 4:20 pm

Linux raspberrypibplus 3.18.11+ #781 PREEMPT Tue Apr 21 18:02:18 BST 2015 armv6l GNU/Linux
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

User avatar
hansotten
Posts: 300
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Mon Jan 11, 2016 4:22 pm

Massi wrote:sorry for the (probably incredibly stupid) question: is it possible to connect straight the arduino to the raspi using serial port? I mean to load code on the arduino.. without using a usb2serial adapter
That is possible, once you manage to have Linux stop using it as console.

That will work only for Arduino's without builtin USB serial, which most do except e.g. the Micro's
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

Massi
Posts: 1678
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Mon Jan 11, 2016 4:35 pm

hansotten wrote:That is possible, once you manage to have Linux stop using it as console.
This should be a matter of:

Code: Select all

sudo systemctl disable serial-getty@ttyAMA0.service
isn't it? (on jessie)

should i see something in the arduino ide when connected in this way?
because i tried (with no much committment, i admit) with a clone i had in my "box of toys" and could see only grayed out "serial port"..

User avatar
hansotten
Posts: 300
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Mon Jan 11, 2016 4:41 pm

Massi wrote:
hansotten wrote:That is possible, once you manage to have Linux stop using it as console.
This should be a matter of:

Code: Select all

sudo systemctl disable serial-getty@ttyAMA0.service
isn't it? (on jessie)

should i see something in the arduino ide when connected in this way?
because i tried (with no much committment, i admit) with a clone i had in my "box of toys" and could see only grayed out "serial port"..
Better use raspi-config to disable the console.
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

User avatar
jackokring
Posts: 815
Joined: Tue Jul 31, 2012 8:27 am
Location: London, UK
Contact: ICQ

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Mon Jan 11, 2016 5:00 pm

Removing some /boot/cmdline.txt references, and a bit of raspi-config fiddling should free the serial. And you might need to disconnect the signals from the "atmel" TX and RX pins from the serial to USB chip. And pay attention to not connecting 5v to 3.3v maximum voltage pins.
Pi[NFA]=B256R0USB CL4SD8GB Raspbian Stock.
Pi[Work]=A+256 CL4SD8GB Raspbian Stock.
My favourite constant 1.65056745028

User avatar
hansotten
Posts: 300
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Mon Jan 11, 2016 6:18 pm

jackokring wrote:Removing some /boot/cmdline.txt references, and a bit of raspi-config fiddling should free the serial. And you might need to disconnect the signals from the "atmel" TX and RX pins from the serial to USB chip. And pay attention to not connecting 5v to 3.3v maximum voltage pins.
True, the signals coming from the Arduino serial are +5v, a voltage divider may be enough to protect the RPi. The 3.3V from RPi to Arduino is no problem.
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

Reasonable
Posts: 49
Joined: Sun Apr 20, 2014 8:12 pm

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Mon Jan 11, 2016 7:25 pm

hansotten wrote:Linux raspberrypibplus 3.18.11+ #781 PREEMPT Tue Apr 21 18:02:18 BST 2015 armv6l GNU/Linux
So, this looks like a Wheezy, correct? Any idea what I can do to get the ch340 recognized on my system? I made sure to get the latest updates already.

Reasonable
Posts: 49
Joined: Sun Apr 20, 2014 8:12 pm

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Tue Jan 12, 2016 5:01 am

The same issue with jessie

Reasonable
Posts: 49
Joined: Sun Apr 20, 2014 8:12 pm

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Tue Jan 12, 2016 6:45 am

Close to figuring this out. When I connect the nano with a 3-inch cable it shows up on the Pi but none of the other cables work :cry:
:?:

User avatar
scruss
Posts: 1670
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Thu Feb 18, 2016 9:20 pm

Reasonable wrote:Any idea what I can do to get the ch340 recognized on my system?

Code: Select all

sudo modprobe ch341
perhaps?
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
gatherer
Posts: 14
Joined: Sat Oct 17, 2015 2:31 pm

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Sat Dec 16, 2017 10:21 pm

Hi,

did:

sudo modprobe ch341

no apparent result

did: dmesg

saw:

registered new interface driver ch341
USB Serial support registered for ch341-uart

But still doesn't work.

Kernel 4.9.59-v7+

.?

User avatar
scruss
Posts: 1670
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Sun Dec 17, 2017 2:16 am

what does it say below the “USB Serial support registered for ch341-uart”?

what device are you expecting to appear? It should be /dev/ttyUSB*
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
gatherer
Posts: 14
Joined: Sat Oct 17, 2015 2:31 pm

Re: Connecting Arduino clone to Raspberry Pi CH340G chipset

Sun Dec 17, 2017 6:59 pm

Hi,

Sorry for the fuzz. It’s working perfect with a new cable.

Thank you

Return to “Troubleshooting”

Who is online

Users browsing this forum: 5ft24dave, Bing [Bot], ejolson, fred44nl and 64 guests