# USB Serial convetor - Linpus (Fedora)



## dave66 (Nov 21, 2008)

Hi All,

I'm new to TSF and also Linux, so I'm hoping some of the gurus here can help me.

As I say I'm new to Linux but working to get to grip with things. We have a new project started whereby we are porting our existing code from an Embedded system to a netbook environment, Acer Aspire One which is running Linpus Lite (Commercial Fedora). Anyhow the Aspire One does not come with serial ports and we have to have at least one serial port for our application to capture data from a weigh scale.

So I've got a USB to Serial convertor cable from Aten, it's using the PL2303 chipset. I have now successfully installed the cable and when I run dmesg I can see the device is connected and drivers are loaded "pl2303 converter now attached to ttyUSB0".

I have few issues:

1. I need a way to test that it is indeed working, so I was wondering if there is an application I can run on Linux (similar to Hyperterminal) so that I can capture the data from the scales or other serial device.

2. Within Linux, is there a method to configure the COM port. I have created a symbolic link (ln -s /dev/ttyUSB0 com1) but I've now idea how to configure the port to 9600,n,8,1.

3. I have a utility written for Windows which we use to upload data from our Embedded system and while I can get the application to execute using Wine, the serial comms is not working. Initially the application could not "see" the com port, however I found that if I created a symbolic link "ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1" that the application now sees the port and I believe tries to communicate using it. But I don't know if the communication is failing because the port is not actually working or because it's not configured correctly. 

Any suggestions/guidance would be most welcome.

Thanks

David


----------



## lensman3 (Oct 19, 2007)

The port configuration is done through the "setserial" program. Do a "man 8 setserial". When I used to get on the Internet with a modem it worked great. I'm not sure if setserial will work with wine though. Setserial generally works with the COM ports.

I am under the belief that the current 2.6.27 (fedora 9 64) use polling to process interrupts. I'm not sure how setserial can install an interrupt driven driver. I currently have all my serial ports (and parallel) turned off in my BIOS.

Sorry I can't be of more help.


----------



## dave66 (Nov 21, 2008)

lensman3 said:


> The port configuration is done through the "setserial" program. Do a "man 8 setserial". When I used to get on the Internet with a modem it worked great. I'm not sure if setserial will work with wine though. Setserial generally works with the COM ports.
> 
> I am under the belief that the current 2.6.27 (fedora 9 64) use polling to process interrupts. I'm not sure how setserial can install an interrupt driven driver. I currently have all my serial ports (and parallel) turned off in my BIOS.
> 
> Sorry I can't be of more help.


Thanks for the reply. I have now discovered the the Acer Aspire One with Linpus does not have either setserial or getserial available. So I'll need to work out how to get them installed.


----------



## lensman3 (Oct 19, 2007)

Look at the "stty" command. This can also set serials. It is hard to use (in my opinion). 

Unfortunately you have to figure out the "raw" and "cooked" modes. Raw is whatever comes in from the serial port is tranfered as is. Cooked is the driver can change (cook) some of the characters before they passed out of the kernel.

stty will be found on ALL unix/Linix versions, but each will be just different enough nothing will work between hardware manufacturers.


----------



## ciotog (Nov 25, 2008)

Cutecom is pretty easy to use, but somewhat limited:
http://cutecom.sourceforge.net/

I prefer using cu, which is part of uucp. It's a little trickier to set up, but worth the simplicity in the end.


----------



## ciotog (Nov 25, 2008)

If you do decide to go with uucp, here's an example configuration:

File /etc/uucp/port:

```
#
# /dev/ttyUSB0 at 9600
#
port		usbtoserial0_9600
type		direct
device		/dev/ttyUSB0
speed		9600
hardflow	false
```
File /etc/uucp/sys:

```
#
# /dev/ttyUSB0 at 9600
#
system		[email protected]
port		usbtoserial0_9600
time		any
```
You would then open up a terminal emulator and run the following:

```
cu [email protected]
```
and you're good to go. To disconnect, type "~.". For help with other commands, type "~?".

I find this much easier to use than minicom.


----------

