Jump to content

Recommended Posts

Posted

Has anyone encountered issues establishing Bluetooth connections to Spike Prime or RI5 Hubs with third party tools or via Python’s ‘PySerial’ module?

Python programs appear to connect to the /dev/cu.xxxxxxx and/or /dev/tty.xxxxxx devices whether Mac side bluetooth is turned on or not (they don’t throw exceptions etc.) but rarely establish a working connection, even though it always seems to think it has successfully opened a connection. I think I have managed to send messages via serial.write() just once.

I also have a very useful app called ‘Serial’ which is a powerful Mac terminal emulator. I have managed to establish a working bluetooth connection to a hub with this just once - and then successfully got into the hub repl. Since that occasion, I get a blank terminal window and no active connection. This is interesting as ‘Serial’ can usually connect to anything with any kind of serial port. I get the same issue using the MacOS ‘screen’ command from a Mac ‘Terminal’ app window - it just stays blank.

I can establish a USB connection every time with both the ‘Serial’ app and via python programs using the PySerial module. There’s something about how Bluetooth is (not) working - possibly just in Monterey.

I have looked at old videos on YouTube such as Anton’s Mindstorms Hacks where he uses the ‘screen’ command to open a repl prompt over a Bluetooth connection, but if I replicate the steps he uses, the connection doesn’t establish. He was using the Mavericks version of MacOS at the time, and I’m pretty sure I had this working back last year after following his video.

The Mindstorms app seems to be able to connect OK, but it can take a couple of attempts to establish the BT connection. I get this behaviour with two different Hubs, so I don’t think it a hub-side issue.

Anyone got any suggestions?

Posted

It’s definitely Monterey causing the problem….

I tested out a few things on my wife’s MacBook Air, which is still running Big Sur, and everything works every time.

I have found an apparent workaround for Monterey….

in a terminal window, type ‘sudo pkill bluetoothd’ and then the admin password when requested.

this kills the extant bluetooth process and forces it to be reloaded. This seems to get around the connection problem, which looks like it might get fixed in the next release of Monterey (12.3, I think).

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...