lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Installing a CP210x USB to Serial converter

Fri Apr 29, 2016 7:18 pm

dmesg | grep tty
usb 6-2: cp210x converter now attached to ttyUSB0


then I started Putty
Putty configuration
/dev/ttyUSB0 baud:9600

connect (open)

But it complains unable to open serial port.

User avatar
B.Goode
Posts: 10191
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Installing a CP210x USB to Serial converter

Fri Apr 29, 2016 8:21 pm

Maybe the user account you are using does not have permission to access /dev/ttyUSB0 ?

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

Re: Installing a CP210x USB to Serial converter

Fri Apr 29, 2016 9:30 pm

Yes, that's most likely. I've used CP210s without problems, and your system looks like it is doing the happy thing.

Check for this:

Code: Select all

$ groups
pi adm dialout cdrom sudo audio video plugdev games users netdev input indiecity
pi@rpi ~ $ ls -la /dev/ttyUSB0 
crw-rw---T 1 root dialout 188, 0 Mar 28 11:45 /dev/ttyUSB0
You need to be part of the ‘dialout’ group to have read/write access to the serial port.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Installing a CP210x USB to Serial converter

Sat Apr 30, 2016 11:09 pm

well, I did
groups
lilzz adm sudo dip plugdev lpadmin

so, I added

useradd -G dialout lilzz

but it complains
useradd: user 'lilzz' already exists

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Installing a CP210x USB to Serial converter

Sat Apr 30, 2016 11:17 pm

I can't add myself to dialout group.
sudo usermod -a -G dialout lilzz

then I check with groups
dialout still not there

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

Re: Installing a CP210x USB to Serial converter

Sun May 01, 2016 12:09 am

you need to log out and log back in again
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Installing a CP210x USB to Serial converter

Sun May 01, 2016 8:36 pm

OK, my putty is finally launched now.

but it's a blank. it has a small green rectangular shape and nothing else.

I try to type in something but nothing shown.

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

Re: Installing a CP210x USB to Serial converter

Mon May 02, 2016 3:27 am

Is the device you're talking to really 9600 baud?
Have you crossed TX with RX, and vice versa, to make the null modem connection work?
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Installing a CP210x USB to Serial converter

Mon May 02, 2016 7:45 pm

OK, I got something back like this.

But I can't type any command. What does this mean from the picture I shown? Is the communication OK? I attached a ESP8266 wifi module to the CP201x.
Attachments
putty1.jpeg
putty1.jpeg (8.42 KiB) Viewed 2959 times

DirkS
Posts: 10347
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Installing a CP210x USB to Serial converter

Mon May 02, 2016 8:17 pm

lilzz wrote:I attached a ESP8266 wifi module to the CP201x.
Apparently the default rate may depend on the firmware version (although the ones I have all started off at 9k6)
Try higher speeds, up to 115k2.
Another thing to be aware of is that ESPs expect a CR+LF for entering commands. I'm not sure if Putty does this by default.

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Installing a CP210x USB to Serial converter

Mon May 02, 2016 8:31 pm

That sort of error usually means the baud rate is wrong.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Installing a CP210x USB to Serial converter

Wed May 04, 2016 9:22 am

Ok, I set the baud rate to 115200, I see something now.

but I type AT, and hit enter button.

I expect to see OK as response but nothing happened.

what's CR+LF? same as enter button?
Attachments
putty2.jpeg
putty2.jpeg (10.14 KiB) Viewed 2810 times

DirkS
Posts: 10347
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Installing a CP210x USB to Serial converter

Wed May 04, 2016 9:45 am

lilzz wrote:what's CR+LF? same as enter button?
No, that depends on the system.
You will have to make Putty send both a carriage return and a linefeed when you hit enter.

IIRC There are settings in Putty about implied linefeed when sending, but I'm not 100% sure about that.

Return to “General discussion”