douglaslyon / java-simple-serial-connector

Automatically exported from code.google.com/p/java-simple-serial-connector
0 stars 0 forks source link

Occasionally losing first character on Mac OS 10.7 #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I have a java applet that reads barcode scans from the serial Port.  
Occasionally after a page refresh, the first scan will lose the first 
character.  This does not happen on windows 7.

What is the expected output? What do you see instead?
All the characters of the barcode.

What version of the product are you using? On what operating system?
Using 0.9 on Mac OS 10.7.  Have a serial->usb adapter on a barcode scanner.

Please provide any additional information below.
I essentially copied the code from the jssc-terminal demo app, but its running 
against the newest version of the jssc library.  The first character is only 
lost on the first scan on a page refresh, but not on every refresh - its 
intermittent.

I'm setting the parameters the same as jssc-terminal:
        private int baudRate = SerialPort.BAUDRATE_9600;
    private int dataBits = SerialPort.DATABITS_8;
    private int stopBits = SerialPort.STOPBITS_1;
    private int parity = SerialPort.PARITY_NONE;

To open the serial port i run the same code as jssc-terminal.  I've tried 
different types of flow control - having xonxoff off or on, enabling or 
disabling rts and dtr, but that seems to have no effect.

Original issue reported on code.google.com by johnegil...@gmail.com on 13 Apr 2012 at 1:22

GoogleCodeExporter commented 8 years ago
Have you tried to work with your code scanner in jssc-terminal placed on wiki 
page ? Send request and get answer.

Also, are you using separate_jvm key for your applet, it's very important. 

Original comment by scream3r.org@gmail.com on 15 Apr 2012 at 6:50

GoogleCodeExporter commented 8 years ago
Yes.  I tried using the jssc-terminal from the Mac.  It too loses the first 
character.  What I did was bring up the terminal applet, opened the port, and 
scanned a barcode.  This worked fine.  I closed the port and refreshed the 
page.  I opened the port again and scanned another barcode.  This time the 
first character was missing.

I'm including the separate_jvm key.  When i tried to remove it I got some issue 
about the DLL being in use, so I agree that it must be important.

Original comment by johnegil...@gmail.com on 19 Apr 2012 at 6:37

GoogleCodeExporter commented 8 years ago
Turns out it was due to the driver I was using.  I had an aten u232A 
serial->adapter.  I was using the pl2303 driver from prolific.  I switched to 
an open-source driver (in case anybody else with the same issue stumbles upon 
this, its available here: 
http://changux.co/osx-installer-to-pl2303-serial-usb-on-osx-lio.  The pre-10.7 
version is available here: http://osx-pl2303.sourceforge.net/).  This fixed the 
character loss problem.

However the open source driver calls the serial port 
"/dev/tty.PL2303-000012FD".  Doesn't get picked up by your port listing.  I 
used a symbolic link to get around that, but just something to think about I 
guess.

Original comment by johnegil...@gmail.com on 24 Apr 2012 at 6:21

GoogleCodeExporter commented 8 years ago
Ok, thank you for this information. Issue closed.

Original comment by scream3r.org@gmail.com on 26 Apr 2012 at 4:54