[Rxtx] Not receiving 0xa characters
Christoph Weiß
weissch at technikum-wien.at
Wed Nov 24 14:29:57 MST 2010
Guys,
I actually tried to reply about 12 hours ago, but as it seems this message
was for some reasons relayed to the moderators.
I found the error in my code and it was a very simple embarrassing one that
i always read over ... I shouldn't reuse demo code without checking it twice
:-/
I'm sorry for bothering you and want to say thanks for all the input when it
was all my fault.
Embarrassed regards,
Chris
On Wed, Nov 24, 2010 at 7:59 PM, <jfh at greenhousepc.com> wrote:
> Trent,
>
> On =some= POSIX systems the TERMIOS are reset. On many, they aren't, in
> order to avoid a number of other problems.
>
> It's always best, because of "lingering termios" problems to build a
> mostly-raw termios by hand. In the case of RXTX, the one problem I saw is
> that the port is initially set to B9600, which means any characters that are
> received immediately are mis-framed. I've seen this in my code where
> gibberish shows up in the initial stream.
> --
> Julie Haugh
> Senior Design Engineer
> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on
> Skype
>
>
> -------- Original Message --------
> Subject: Re: [Rxtx] Not receiving 0xa characters
> From: Trent Jarvi <tjarvi at qbang.org>
> Date: Wed, November 24, 2010 12:09 pm
> To: "rxtx at qbang.org" <rxtx at qbang.org>
>
>
> On POSIX (Mac, Linux, Solaris, ...) systems, RXTX explicitly sets the port
> to 'raw' after opening to avoid those translations/filters. We 'stomp' on
> the port to force it into a predictable configuration.
>
> term->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
> term->c_oflag &= ~OPOST;
> term->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
> term->c_cflag &= ~(CSIZE|PARENB);
> term->c_cflag |= CS8;
>
> On windows, RXTX may not be as robust and could probably use a code review
> by someone familiar with the structs (termios.c).
>
> I could imagine a driver on windows having unusual defaults RXTX does not
> override causing problems. There are not many drivers out there though.
> I've personally not run into the situation mentioned.
>
>
> On Wed, 24 Nov 2010, Kustaa Nyholm wrote:
>
> > Hi,
> >
> > have look at:
> >
> > http://linux.die.net/man/3/tcsetattr
> >
> > I think (without looking at txrx source code) that the port
> > is opened without correctly setting INLCR,ICRNL and/or IGNCR.
> > But that is Unix/Linux stuff and you are on windows. However,
> > I would suspect there is a similar feature and possibility
> > of a bug in rxtx on Windows too.
> >
> > The obvious workaround is to correct that in the source code
> > if you are able to recompile from source.
> >
> > The other possibility is to try to figure out why the
> > port in question defaults to eating LFs (0x0A).
> >
> > I had a program that had this same bug and hundreds of
> > people used it without a problem until on one Linux machine
> > it failed with similar symptoms to yours, only in my case
> > it was output.
> >
> > So you might be able to somehow configure the port to default to sensible
> > values so that even if rxtx does not set them correctly they
> > would be set correctly by default.
> >
> > Just 2 snt worth.
> >
> > br Kusti
> >
> >
> >
> >> From: Christoph Weiß <weissch at technikum-wien.at>
> >> Reply-To: <rxtx at qbang.org>
> >> Date: Tue, 23 Nov 2010 23:28:15 +0200
> >> To: <rxtx at qbang.org>
> >> Conversation: [Rxtx] Not receiving 0xa characters
> >> Subject: [Rxtx] Not receiving 0xa characters
> >>
> >> Dear all,
> >>
> >> I am currently trying to work with RxTx on a Windows 7 OS with JDK6
> installed.
> >> I can connect to a serial port created by a FTDI USB chip and send
> receive
> >> data from it. However it seems that I am not able to receive any
> characters
> >> with the value 0x0a (LF).
> >> Upon looking into the source code of the serial implementation I found
> that
> >> opening the port happens without the binary flag so I suppose that LF
> gets
> >> possibly eaten by the OS. Could this be the problem? Is such a problem
> known?
> >> Are there workarounds?
> >>
> >> Thanks in advance,
> >> best regards,
> >> Chris
> >
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx at qbang.org
> > http://mailman.qbang.org/mailman/listinfo/rxtx
> >
> ------------------------------
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
>
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qbang.org/pipermail/rxtx/attachments/20101124/8e2806a7/attachment-0632.htm>
More information about the Rxtx
mailing list