* Fwd: Fwd: Re: pl2303 linux driver does not work
[not found] <5459A26A.2080204@grapecity.mn>
@ 2014-11-05 4:11 ` Batdelger.O
2014-11-05 4:29 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Batdelger.O @ 2014-11-05 4:11 UTC (permalink / raw)
To: linux-serial
Thank you for your quick response.
It's just simple python code. I'm not sure if flow control is correct.
I also used gtkterm and tried by every option. I'm new at usbserial
devices. How to know how should it be?
import time
import serial
import sys
ser = serial.Serial(
port='/dev/ttyUSB0',
baudrate=4800,
parity=serial.PARITY_ODD,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
# timeout=0
)
# RTS 0 DTR 1. not sure it's correct one. I tried by reverse.
ser.setRTS(False)
ser.setDTR(True)
print ser.isOpen()
ON="\x1B\x5D"
ser.write(ON)
ser.flushOutput()
print "after write"
# read = ser.read()
# sys.stdout.write("RECEIVED:" + read + "\n")
ser.close()
--
Best regards,
Batdelger.O R&D engineer
Grapecity Mongolia LLC
On 2014.11.05 10:25, Greg KH wrote:
> On Wed, Nov 05, 2014 at 09:37:59AM +0800, Batdelger.O wrote:
>> Hello
>> Hope you guys are doing great.
>> I've got problem with pl2303 Linux driver. In a nutshell, my mission is to
>> control magnetic card reader/writer with PL-2303 XA / HXA chip from the
>> Linux. I'm using Ubuntu 14.04(kernel version: 3.13.0-39-generic). Everything
>> is going fine. Giving no errors. Writing data via usb-serial seems to work.
>> But the device is not receiving data. If that issue familiar with you,
>> please give me advice.
> How exactly are you "writing data"? And have you set up flow control
> properly?
>
> thanks,
>
> greg k-h
>
--
Best regards,
Batdelger.O R&D engineer
Grapecity Mongolia LLC
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fwd: Fwd: Re: pl2303 linux driver does not work
2014-11-05 4:11 ` Fwd: Fwd: Re: pl2303 linux driver does not work Batdelger.O
@ 2014-11-05 4:29 ` Greg KH
2014-11-06 2:28 ` Batdelger.O
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2014-11-05 4:29 UTC (permalink / raw)
To: Batdelger.O; +Cc: linux-serial
On Wed, Nov 05, 2014 at 12:11:00PM +0800, Batdelger.O wrote:
>
> Thank you for your quick response.
> It's just simple python code. I'm not sure if flow control is correct. I
> also used gtkterm and tried by every option. I'm new at usbserial devices.
> How to know how should it be?
>
> import time
> import serial
> import sys
>
> ser = serial.Serial(
> port='/dev/ttyUSB0',
> baudrate=4800,
> parity=serial.PARITY_ODD,
> stopbits=serial.STOPBITS_ONE,
> bytesize=serial.EIGHTBITS,
> # timeout=0
That's a slow baud rate, do you mean that slow?
> )
>
> # RTS 0 DTR 1. not sure it's correct one. I tried by reverse.
> ser.setRTS(False)
> ser.setDTR(True)
Does your device support hardware flow control?
>
>
> print ser.isOpen()
>
> ON="\x1B\x5D"
> ser.write(ON)
> ser.flushOutput()
> print "after write"
> # read = ser.read()
> # sys.stdout.write("RECEIVED:" + read + "\n")
> ser.close()
Try using minicom to see if you can properly connect to your device
first, before trying to write your own code from "scratch", to determine
that the device works.
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Fwd: Fwd: Re: pl2303 linux driver does not work
2014-11-06 3:36 ` Greg KH
@ 2014-11-05 19:58 ` Batdelger.O
0 siblings, 0 replies; 5+ messages in thread
From: Batdelger.O @ 2014-11-05 19:58 UTC (permalink / raw)
To: 'Greg KH'; +Cc: linux-serial
I'm sorry. E-mail subject was wrong. I just wanted to find good direction.
Ok, I'll try by minicom.
--
Best regards,
Batdelger.O R&D engineer
Grapecity Mongolia
-----Original Message-----
From: Greg KH [mailto:greg@kroah.com]
Sent: Thursday, November 6, 2014 11:36 AM
To: Batdelger.O
Cc: linux-serial@vger.kernel.org
Subject: Re: Fwd: Fwd: Re: pl2303 linux driver does not work
On Thu, Nov 06, 2014 at 10:28:40AM +0800, Batdelger.O wrote:
>
> >On Wed, Nov 05, 2014 at 12:11:00PM +0800, Batdelger.O wrote:
> >>Thank you for your quick response.
> >>It's just simple python code. I'm not sure if flow control is
> >>correct. I also used gtkterm and tried by every option. I'm new at
usbserial devices.
> >>How to know how should it be?
> >>
> >> import time
> >> import serial
> >> import sys
> >>
> >> ser = serial.Serial(
> >> port='/dev/ttyUSB0',
> >> baudrate=4800,
> >> parity=serial.PARITY_ODD,
> >> stopbits=serial.STOPBITS_ONE,
> >> bytesize=serial.EIGHTBITS,
> >> # timeout=0
> >That's a slow baud rate, do you mean that slow?
> Actually, baud rate is 9600. 4800 was one of my attempts.
> >> )
> >>
> >> # RTS 0 DTR 1. not sure it's correct one. I tried by reverse.
> >> ser.setRTS(False)
> >> ser.setDTR(True)
> >Does your device support hardware flow control?
> I think so. The Features section of device doc contains line:
>"Automatic hardware flow control with CTS/RTS ". But I'm not sure. How to
know exactly it does?.
You usually need to set this up on the device itself. The manual for the
device should say how to do this.
> >>
> >> print ser.isOpen()
> >>
> >> ON="\x1B\x5D"
> >> ser.write(ON)
> >> ser.flushOutput()
> >> print "after write"
> >> # read = ser.read()
> >> # sys.stdout.write("RECEIVED:" + read + "\n")
> >> ser.close()
> >Try using minicom to see if you can properly connect to your device
> >first, before trying to write your own code from "scratch", to
> >determine that the device works.
> Device is working fine on windows 7. My simple python scripts is
> working fine without setting any options except port name (on win7).
Again, please try running minicom on Linux which sets up the line settings
in a "known manner" before blaming the kernel driver :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fwd: Fwd: Re: pl2303 linux driver does not work
2014-11-05 4:29 ` Greg KH
@ 2014-11-06 2:28 ` Batdelger.O
2014-11-06 3:36 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Batdelger.O @ 2014-11-06 2:28 UTC (permalink / raw)
To: Greg KH; +Cc: linux-serial
> On Wed, Nov 05, 2014 at 12:11:00PM +0800, Batdelger.O wrote:
>> Thank you for your quick response.
>> It's just simple python code. I'm not sure if flow control is correct. I
>> also used gtkterm and tried by every option. I'm new at usbserial devices.
>> How to know how should it be?
>>
>> import time
>> import serial
>> import sys
>>
>> ser = serial.Serial(
>> port='/dev/ttyUSB0',
>> baudrate=4800,
>> parity=serial.PARITY_ODD,
>> stopbits=serial.STOPBITS_ONE,
>> bytesize=serial.EIGHTBITS,
>> # timeout=0
> That's a slow baud rate, do you mean that slow?
Actually, baud rate is 9600. 4800 was one of my attempts.
>> )
>>
>> # RTS 0 DTR 1. not sure it's correct one. I tried by reverse.
>> ser.setRTS(False)
>> ser.setDTR(True)
> Does your device support hardware flow control?
> I think so. The Features section of device doc contains line: "Automatic hardware flow control with CTS/RTS
> ". But I'm not sure. How to know exactly it does?.
>
>>
>> print ser.isOpen()
>>
>> ON="\x1B\x5D"
>> ser.write(ON)
>> ser.flushOutput()
>> print "after write"
>> # read = ser.read()
>> # sys.stdout.write("RECEIVED:" + read + "\n")
>> ser.close()
> Try using minicom to see if you can properly connect to your device
> first, before trying to write your own code from "scratch", to determine
> that the device works.
Device is working fine on windows 7. My simple python scripts is
working fine without setting any options except port name (on win7).
>
> greg k-h
>
--
Best regards,
Batdelger.O R&D engineer
Grapecity Mongolia LLC
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Fwd: Fwd: Re: pl2303 linux driver does not work
2014-11-06 2:28 ` Batdelger.O
@ 2014-11-06 3:36 ` Greg KH
2014-11-05 19:58 ` Batdelger.O
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2014-11-06 3:36 UTC (permalink / raw)
To: Batdelger.O; +Cc: linux-serial
On Thu, Nov 06, 2014 at 10:28:40AM +0800, Batdelger.O wrote:
>
> >On Wed, Nov 05, 2014 at 12:11:00PM +0800, Batdelger.O wrote:
> >>Thank you for your quick response.
> >>It's just simple python code. I'm not sure if flow control is correct. I
> >>also used gtkterm and tried by every option. I'm new at usbserial devices.
> >>How to know how should it be?
> >>
> >> import time
> >> import serial
> >> import sys
> >>
> >> ser = serial.Serial(
> >> port='/dev/ttyUSB0',
> >> baudrate=4800,
> >> parity=serial.PARITY_ODD,
> >> stopbits=serial.STOPBITS_ONE,
> >> bytesize=serial.EIGHTBITS,
> >> # timeout=0
> >That's a slow baud rate, do you mean that slow?
> Actually, baud rate is 9600. 4800 was one of my attempts.
> >> )
> >>
> >> # RTS 0 DTR 1. not sure it's correct one. I tried by reverse.
> >> ser.setRTS(False)
> >> ser.setDTR(True)
> >Does your device support hardware flow control?
> I think so. The Features section of device doc contains line: "Automatic hardware flow control with CTS/RTS
>". But I'm not sure. How to know exactly it does?.
You usually need to set this up on the device itself. The manual for
the device should say how to do this.
> >>
> >> print ser.isOpen()
> >>
> >> ON="\x1B\x5D"
> >> ser.write(ON)
> >> ser.flushOutput()
> >> print "after write"
> >> # read = ser.read()
> >> # sys.stdout.write("RECEIVED:" + read + "\n")
> >> ser.close()
> >Try using minicom to see if you can properly connect to your device
> >first, before trying to write your own code from "scratch", to determine
> >that the device works.
> Device is working fine on windows 7. My simple python scripts is working
> fine without setting any options except port name (on win7).
Again, please try running minicom on Linux which sets up the line
settings in a "known manner" before blaming the kernel driver :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-06 3:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <5459A26A.2080204@grapecity.mn>
2014-11-05 4:11 ` Fwd: Fwd: Re: pl2303 linux driver does not work Batdelger.O
2014-11-05 4:29 ` Greg KH
2014-11-06 2:28 ` Batdelger.O
2014-11-06 3:36 ` Greg KH
2014-11-05 19:58 ` Batdelger.O
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.