HC06 Bluetooth with Makelangelo on MacOS
Shop › Forum › Makelangelo Polargraph Art Robot › HC06 Bluetooth with Makelangelo on MacOS
- This topic has 8 replies, 2 voices, and was last updated 4 years, 6 months ago by Jip-Hop.
-
AuthorPosts
-
2020-05-28 at 08:13 #28114Jip-HopParticipant
Hi all,
I bought a Makelangelo compatible kit from 3D-proto. It’s based on the Arduino Mega + RAMPS 1.4 Board. The HC06 Bluetooth module allows me to connect with the Makelangelo Java app, and wirelessly control the plotter, but only on Windows.
On MacOS 10.14.6, Makelangelo doesn’t list anything in the dropdown menu when trying to connect. Connecting via Bluetooth from the Arduino Serial Monitor does work on my Mac, so the Bluetooth connection between the Mac and the plotter is working.
Does anyone have an idea how I can make the plotter show up in Makelangelo over Bluetooth on MacOS?
I’m using Makelangelo-7.21.0 and Makelangelo-firmware-9.1.0.
2020-05-28 at 08:13 #28116DanKeymasterSo… your Bluetooth connection does not appear as a serial port to OSX. Is it a security issue? I haven’t played with bluetooth so I don’t know the answer yet.
2020-05-28 at 08:18 #28117DanKeymasterDoes this help at all? https://www.youtube.com/watch?v=4yQ47kgLwHs
2020-05-28 at 09:20 #28119Jip-HopParticipantThanks for replying Dan. I’ll look into it. Although I don’t think that’s the case. Arduino does list the HC06 as a serial port on MacOS:
https://i.ibb.co/h7xFvyt/Screenshot-2020-05-28-at-17-36-40.png
So this gives me the impression the issue may be somewhere in the Makelangelo Java code.
2020-05-28 at 09:26 #28123DanKeymasterAre you savvy enough to compile the source code and try to make some changes? In file
com.marginallyclever.communications.serial.SerialTransportLayer.java
in method
listConnections()
try changing it to look like this:public String[] listConnections() { portsDetected = SerialPortList.getPortNames(); return portsDetected; }
- This reply was modified 4 years, 6 months ago by Dan.
2020-05-28 at 12:31 #28126Jip-HopParticipantThanks for the quick responses 🙂 that did look promising, but unfortunately it didn’t seem to have any effect.
Unfortunately:
portsDetected = null
In the MacOS terminal the following serial devices are listed:
ls /dev/{tty,cu}.* /dev/cu.Bluetooth-Incoming-Port /dev/tty.Bluetooth-Incoming-Port /dev/cu.HC-06-DevB /dev/tty.HC-06-DevB
2020-06-05 at 13:27 #28208Jip-HopParticipantThe library used to list serial ports, jssc, uses the following regex pattern to match serial ports on MacOS:
tty.(serial|usbserial|usbmodem).*
This doesn’t match my bluetooth device at
/dev/tty.HC-06-DevB
.The fix is to call getPortNames with a custom regex, like so:
portsDetected = SerialPortList.getPortNames(Pattern.compile("cu"));
The list now includes the USB and Bluetooth serial device for my Makelangelo.
Connecting works over Bluetooth, and it still works over USB.2020-06-05 at 13:29 #28210DanKeymasterCan you send in a pull request with a fix that works for all platforms and all port names, please? Then future updates will work for everyone.
2020-06-05 at 13:38 #28211Jip-HopParticipantI sent a pull request already. On Windows it already worked so no need to fix anything. I don’t have a Linux system that can run Makelangelo with Bluetooth. So don’t know if that needs attention.
Aah you just merged the pull request. Great 😀
-
AuthorPosts
- You must be logged in to reply to this topic.