• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Second USB serial port  (Read 2910 times)
khklatt
Newbie
*

Karma: 0
Posts: 11


View Profile
« on: July 04, 2009, 03:29:32 PM »

Am new to debian.  I  have been able to use a Windows terminal session to communicate with the Sheva, have a running
system,  installed gcc along with a few utilities on the Shiva.  Now attempting to use a USB-RS232 converter to communicate with an
external device (X-10) over a serial port.  The USB to RS-232 "dongle" seems to be recognised by the kernel.  Installed
setserial to set/define the comm parameters.  Also defined a getty in events.d at startup.

How do I know what ttyS has been assigned to the USB port?  Pretty sure  ttyS0  is the console port, and would expect ttyS1 to
be the second USB serial port.   I have minicom installed, and should be able to test the port.  No success so far.  Ideas welcome. 

>lsusb
Bus 001 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 001 Device 006: ID 05dc:a701 Lexar Media, Inc. JumpDrive FireFly
Bus 001 Device 005: ID 05dc:a701 Lexar Media, Inc. JumpDrive FireFly
Bus 001 Device 003: ID 0781:5406 SanDisk Corp. Cruzer Micro 1/4GB Flash Drive
Bus 001 Device 002: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
Bus 001 Device 001: ID 0000:0000 

root@toaster:~# setserial -a /dev/ttyS0
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x0000, IRQ: 33
        Baud_base: 12500000, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test

root@toaster:~# setserial -a /dev/ttyS1
/dev/ttyS1, Line 1, UART: 16550A, Port: 0x0000, IRQ: 34
        Baud_base: 12500000, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test

root@toaster:~# ps ax | grep ttyS1
 1283 ttyS1    Ss+    0:00 /sbin/getty 4800 ttyS1
 2289 pts/0    R+     0:00 grep ttyS1

I should be able to set ttyS1 to 4800 baud to communicate with the CMA10 X-10 control device..
Assuming protections are set correctly. 

KK
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #1 on: July 04, 2009, 10:23:40 PM »

I'm doing much the same thing you are (using a Prolific PL2303 Serial Port to connect to a CM11a X10 controller).  The serial port is recognized fine under Ubuntu, even with a USB Hub sitting between it and the Plug, but that was not the case under the Debian load that came with the Plug.  (To be honest, I can't say whether the Serial Port itself is a problem.  I know the Hub wasn't recognized and I upgraded the OS before I acquired the serial port.)  Since you seem to only have one serial port on your Plug, I believe you'll find the serial device you need to communicate with is called "/dev/ttyUSB0" if it is recognized.  If this /dev entry is not there after you plug in the USB serial port, you'll either have to define the hardware to Debian or upgrade.  I found after running the alpha-6 installer to upgrade, everything worked a lot better.

What I'm still a bit unclear about is how multiple serial ports are handled.  I plan to add a second port soon, and I'm sure it will become "/dev/ttyUSB1".  However, I've heard it is a tossup as to which physical port is associated with which device at boot time, and the ordering can change from boot to boot.  Can anyone with some experience with this shed some light on it?

BTW, what program are you using to talk to your port?  HeyU?  I'm using a much modified version of Dan Lanciani's TCP controller here, and so far it's been working quite well.
Logged

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #2 on: July 05, 2009, 01:31:10 AM »

device naming might shift during detection phase (but as long as you don't add, move, change your devices it shouldn't). If you need to make sure that you always get the same devicenames you can add custom udev rules. Base those rules on a unique criteria of the usb-serial converter and add another alias (myserial01).
Logged

khklatt
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #3 on: July 05, 2009, 08:17:19 AM »

I'm doing much the same thing you are (using a Prolific PL2303 Serial Port to connect to a CM11a X10 controller).  The serial port is recognized fine under Ubuntu, even with a USB Hub sitting between it and the Plug, but that was not the case under the Debian load that came with the Plug.  (To be honest, I can't say whether the Serial Port itself is a problem.  I know the Hub wasn't recognized and I upgraded the OS before I acquired the serial port.)  Since you seem to only have one serial port on your Plug, I believe you'll find the serial device you need to communicate with is called "/dev/ttyUSB0" if it is recognized.  If this /dev entry is not there after you plug in the USB serial port, you'll either have to define the hardware to Debian or upgrade.  I found after running the alpha-6 installer to upgrade, everything worked a lot better.

What I'm still a bit unclear about is how multiple serial ports are handled.  I plan to add a second port soon, and I'm sure it will become "/dev/ttyUSB1".  However, I've heard it is a tossup as to which physical port is associated with which device at boot time, and the ordering can change from boot to boot.  Can anyone with some experience with this shed some light on it?

BTW, what program are you using to talk to your port?  HeyU?  I'm using a much modified version of Dan Lanciani's TCP controller here, and so far it's been working quite well.

How did you run the alpha-6 installer?  apt-get ?

I am using heyu -- Not sure what Dan's TCP controller  is -- net based?  -- Could be a bit off topic, will take a look.. Thanks.  Least I
know it is possible.

KK
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #4 on: July 05, 2009, 06:45:08 PM »

Regarding the alpha-6 installer:

http://www.openplug.org/plugwiki/index.php/SheevaPlug_Installer
http://plugcomputer.org/plugforum/index.php?topic=355.0

Make sure you read through the forum thread carefully to see what kinds of problems (and solutions) others have had.  In particular, make sure you have good connectivity to the Console/JTAG:

http://plugcomputer.org/plugforum/index.php?topic=454.0

and can access the material on the thumb drive ("usb info", "usb part", etc.) before attempting the upgrade.  In particular, I had to explicitly reset the Plug before the upgrade to make it work.  (But, even if it fails, it's not fatal:  You can correct the problems and run the installer again.)  What you'll wind up with is a newer Uboot and a 2.6.30-rc6 Linux kernel -- not the latest, but one that is much better than the default load.

Regarding x10, I've uploaded the current version of x10d.c that I'm using to

http://cboh.org/SheevaPlug/x10d.c

Basically, if the program is invoked as "x10d", it assumes the role of a daemon server, connecting to the CM11a device, and listening for commands on a predefined port.  If invoked as simply "x10", it becomes a client of x10d, sending commands to the server.  I use cron in conjunctin with "x10" to control all my x10 devices.  x10d also maintains a memory of which devices are on and which are off, and this can be queried, either to see the state, or create more complicated requests.  It's pretty slick, and self-contained, but the downside is that I don't know of any good documentation for the software.  I've never tried HeyU, but understand it is a fairly popular controller program, and I suspect that if x10d can talk to the CM11a via the PL2303, that HeyU won't have a problem, either.

Good luck, and let us know how everything turns out for you.
Logged

OmahaVike
Newbie
*

Karma: 0
Posts: 8


View Profile
« Reply #5 on: July 23, 2009, 08:42:23 PM »

i had the same problem.  installed alpha-6, and everything worked perfectly (including heyu -- pointed at /dev/ttyUSB0).

here is the USB/Serial adapter that is working with the Sheeva:
SABRENT SBT-USC1K USB to Serial (9-pin) DB-9 RS-232 Adapter Cable (retail)
http://www.newegg.com/Product/Product.aspx?Item=N82E16812156003&Tpk=12-156-003

worked like a charm.  i'm LOVING this thing.
Logged

Pages: [1]
Print
Jump to: