PetoiCamp / OpenCatEsp32

An ESP32-based open source quadruped robot pet framework for developing Boston Dynamics-style four-legged robots that are perfect for STEM, coding & robotics education, IoT robotics applications, AI-enhanced robotics application services, research, and DIY robotics kit development.
MIT License
78 stars 28 forks source link

Serial port over bluetooth not working with Ubuntu or macOS but Android app working #9

Open hadim opened 6 months ago

hadim commented 6 months ago

I have a Bittle X BiBoard V0_1, and I am using the current default branch of that repo to flash the sketch.

On Android - OK

I can use the Android app after pairing my Bittle with it with no problem:

20:47:33:771 -> Pairing success!!
20:49:04:176 -> Bluetooth connected!
20:49:05:773 -> G
20:49:05:775 -> Bittle
20:49:05:775 -> B01_231206
20:49:05:775 -> ?
20:49:40:628 -> Bluetooth disconnected!

Notice that we can see the message "Bluetooth connected!" coming from the bleUart.hfile.

On macOS - FAIL

I can pair with the Bittle from a macOS M2/3 (after enabling all the macOS security for VSCode/Terminal).

In the Bittle logs I can see "Pairing success!!" but I never see a "Bluetooth connected!" message.

I can see two serial sockets /dev/tty.Bittle67_SSP and /dev/tty.Bluetooth-Incoming-Port and I can also open them but I see no message received and the one I send seems to have no effect on the Bittle.

It might not be related at all, but I also noticed this function called void readBlueSSP() that is commented in io.h.

On Ubuntu - FAIL

I am using Ubuntu 23.10. Here it seems to be something else than the issue seen on macOS, since I cannot pair the Bittle with Ubuntu.

When trying, Ubuntu shows a security popup with a PIN number which is the same as the one printed on the serial port of the Bittle. Then, when I click yes, the process hangs and ends up timing out with a failure. Looking at the Ubuntu logs, it seems to be related to authentication.

It's weird because on macOS, I don't see any popup with a PIN code.


I tried using multiple versions of ESP32 from https://github.com/espressif/arduino-esp32: 2.0.12 (the one recommended), 2.0.13 and 2.0.14.


If you have any idea what's going on or what I am doing wrong, please let me know. ping @borntoleave

borntoleave commented 6 months ago

/dev/tty.Bluetooth-Incoming-Port is not related to Bittle. After connecting Bittle in the Bluetooth settings, it would stay connected. Only when you open other programs, such as the PetoiDesktopApp's Calibrator, Skill Composer, and the Python serial API, the port will be visited and connected if the handshake is successful.