I'm trying to make a serial connection between a BeagleBone and my laptop. This is similar to a set-up I've previously used successfully with an Arduino & the laptop. The problem is, while there's clearly a signal passing between the machines, the output seems corrupt.
The BB is connected to a Bluesmirf Silver on TX & RX lines.
I've written a class in Python to handle serial comms. This works fine when communicating between the BB and an Arduino, so I'm pretty convinced I've handled the setting up on pins, mux modes etc okay.
But the same code, when going via the Bluesmirf fails to work. With everything set to 19200 baud 8-N-1, text send from the BB to the laptop arrives as a series of 0xE0 characters. Changing the baud rate (and yes, I'm careful to change it at both ends) can change what appears on the laptop - sometimes nothing gets through, sometimes it's apparently random. Mostly, though, the bytes appear to have a high value. At 19200, the number of bytes shown coming through is two or three bytes more than the number of characters sent.
Having defined self.serPort as a serial port using Serial() (ie, PySerial), I use the following to send the text (which is passed as a string 'sendStr'):
self.serPort.write(sendStr.encode('utf-8', 'replace'))
I've tried using 'ascii' instead of 'utf-8'
In the same program, I send the same string in the same way to the Arduino, which echoes it back and everything works fine there. It's just the stuff that goes via the Bluesmirf that's causing me grief.
(For the record, on the laptop, a MacBook Pro, I'm using CoolTerm to send and receive. With my previous setup, with an Arduino communicating with the laptop via the Bluesmirf, the laptop was running a Processing sketch. I tried that same sketch with the BB setup, but still no joy).
Any ideas?