Bluetooth by pybluez

Hi folks,

In my next project for the Jetson-Nano, I am working with a Bluetooth module Mate gold from Sparkfun and Teensy 4.0 sending raw data and I want to read it on python. So far looking on google I found that pybluez can do that job, but when I print the received package, it get split like this:

Trying to understand the issue I am sending the same data via USB at the same time:
My Teensy Code:
Arduino

Then I installed minicom and configured it to read the Bluetooth driver “rfcomm0”, this is how looks like:

Now, this is showing me that the problem looks like to be in python pybluez itself, however due to lack of info on google I can’t see what or where is the issue.

Does anyone had the same issue or know an alternative module that can be used with python to read the incoming package via Bluetooth without that odd split?

Thanks,

If someone else have this problem in the future, the solution that I have found is:

  1. Bind the connection with your Bluetooth device first on the terminal:
    sudo rfcomm0 bind 0 00:00:00:00:00:00 1
    where 00:00:00:00:00:00 is the mac address of your Bluetooth module.

  2. using pyserial:

import serial
BT = serial.Serial(/dev/rfcomm0’,baudrate=115200, timeout=5)
data = BT.readline().decode(‘utf-8’)
print(data)

Great! Thanks for the update!

Hey! Did you have to recompile your kernel to get rfcomm working, or did it work on the latest L4T out of the box? Thanks!