HC06 Bluetooth with Makelangelo on MacOS

Shop Forum Makelangelo Polargraph Art Robot HC06 Bluetooth with Makelangelo on MacOS

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #28114
    Jip-Hop
    Participant

    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.

    No Bluetooth on MacOS

    #28116
    Dan
    Keymaster

    So… 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.

    #28117
    Dan
    Keymaster
    #28119
    Jip-Hop
    Participant

    Thanks 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.

    • This reply was modified 3 years, 10 months ago by Dan.
    • This reply was modified 3 years, 10 months ago by Dan.
    #28123
    Dan
    Keymaster

    Are 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 3 years, 10 months ago by Dan.
    #28126
    Jip-Hop
    Participant

    Thanks for the quick responses 🙂 that did look promising, but unfortunately it didn’t seem to have any effect.

    portsDetected = null

    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
    #28208
    Jip-Hop
    Participant

    The 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.

    #28210
    Dan
    Keymaster

    Can 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.

    #28211
    Jip-Hop
    Participant

    I 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 😀

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.