Closed TiborUdvari closed 1 year ago
Hi Tibor,
On Mac OS you should use the Virtual COM Port (e.g. /dev/tty.BITalino...).
Best regards, Hugo Silva
On 21/04/2021, at 07:46, Tibor Udvari @.***> wrote:
I'm trying the example and I'm getting
This platform does not support bluetooth connection. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Hi Hugo,
I also meet with the problem, bitalino cannot successfully connect with my computer. I have tried the two bitalino macAddress "/dev/tty.BITalino-XX-XX" "/dev/cu.BITalino-XX-XX"
After using the device = BITalino(macAddress) it will have no response.
my macos is the latest version ventura 13.0.1
@hugoslv
Hi piaoziyue,
In Ventura (at to some extent Monterrey), bluetooth performance has been a source of many headaches. I was able to reproduce your problems some of the times. On other occasions, re-pairing the device using the system manager seems to solve the problem.
I am also getting the same error code
_" File "/Users/craigvear/PycharmProjects/jess_plus/bitalino.py", line 93, in init raise Exception(ExceptionCode.INVALIDPLATFORM) Exception: This platform does not support bluetooth connection."
Examining BITalino script there seems to be no provision for a Mac OS platform ("Darwin") (lines 82 - 93)
if checkMatch: if platform.system() == "Windows" or platform.system() == "Linux": try: import bluetooth except Exception as e: raise Exception(ExceptionCode.IMPORT_FAILED + str(e)) self.socket = bluetooth.BluetoothSocket(bluetooth.RFCOMM) self.socket.connect((macAddress, 1)) self.wifi = False self.serial = False else: raise
Exception(ExceptionCode.INVALID_PLATFORM)``
Is there a Mac OS specific solution?
On MacOS the find device method is not available since the connection is made using the Virtual COM Port (e.g. /dev/tty.BITalino...).
I understand. Can you advise a fix around, as the API seems to ignore darwin OS as an option.
Line 114-119 is the connection flow for macOS, since the regex fails. It connects using serial.Serial method in line 117.
Thanks. But how do I get it to not raise an exception at line 113 ? As the logic stands if checkMatch = True and if platform != "windows" or "linux" then it raises an INVALID PLATFORM error.
Sorry, I'm not understanding your question. The checkMatch will only the True when passing a MAC address, which is not supported on MacOS. It will return None if a /dev/tty.BITalino virtual com port is passed.
For example:
print(re.match(regCompiled, "/dev/tty.bitalino-DevB")) None print(re.match(regCompiled, "00:00:00:00:00:00")) <re.Match object; span=(0, 17), match='00:00:00:00:00:00'>
Ahhh - That is clear now. And it works. Thank you for your patience.
I have tried re-pair the device and it may work (once in 10 times). And every time I re-run my code I should re-pair the device several times. It's very unreliable...
Unfortunately, with the new release of MacOS, the serial port method to connect to Bitalino is broken.
We recommend using Plux Pythons API to interact with your BITalino.
I'm trying the example and I'm getting