in reply to Using Device::SerialPort
If I had to guess, looking at your data, I'm guessing that it's 7 bits, even parity. So the characters with an odd number of bits (a, k) are coming through looking fine, and the ones with an even number of bits (c) parity are coming in with the high bit set. Setting the high bit on 'c' gives 0xe3, and I'm betting some unicode translation is occurring to give you the gibberish where the 'c' should be.
I'd try dumping the individual bytes you get for $saw to see the actual bytes Device::SerialPort is giving you. You can also just try changing the parity and word size to see if it fixes things up for you.
Note: It's been a good few years since I had to deal with parity & such, so I may have even/odd mixed up in my head, so I'd suggest setting data bits to 7 and try both and see if one works the way you expect.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Device::SerialPort
by Anonymous Monk on Feb 11, 2015 at 15:03 UTC |