Connecting a USB laser via virtual TTY - socat remote Raspberry PI?

Hi,

I have an iMac in a nice warm safe place, and I’d like to place my USB laser out of USB cable reach in a garage.
I’ll use LightBurn on the distant Mac maybe via an iPad screen share, or maybe some other way. But first I need to connect LightBurn to my Ortur LMP2 Pro. Over TCP…

Using a Raspberry Pi connected via USB to the Ortur, on the pi I can run

socat TCP-LISTEN:14537,fork GOPEN:/dev/serial/by-id/usb-Ortur_Laser_Master_123456-if00,echo=0,rawer,b115200

(NB all of these commands are open to question - they’re just the best I have so far)

On the Mac I can run

socat -d -d PTY,rawer TCP:rpi2b-nathan.local:14537

(all those ‘-d’ give me enough debug to see ‘PTY is /dev/ttysXXX’)

If I then run on the Mac…

cat my-small-test-gcode.gc > /dev/ttys002

I get the Ortur moving as expected - which was nice!
(I’m not sure all the issues are solved yet, eg flow control sending larger data)

I’d really like LightBurn to take over at this point, and be the App that is sending/receiving the gcode.
But LightBurn is only ever giving me the option of connecting via some su.Bluetooth-Incoming-Port.
(FYI directly connecting the Ortur to the Mac running LightBurn works perfectly fine).

This thread looks to be about the same as my issue:

I’ve even tried tricking LightBurn by editing prefs.ini "CommPort": "ttys002", but it keeps being reset to cu.Bluetooth-Incoming-Port as you might expect when thats the only device that is shown in the drop-down list.

So thats my problem so far.
One suggested solution that springs to mind at this point is “I wish I could bypass the nice code that filters out unsuitable devices and force a known /dev/ on LightBurn”.
I know you’ve said you’ve filtered out devices with “a port with no vendor or product ID, which is how I’m currently detecting and filtering out Bluetooth ports that cause the system to crash”.
(Wireless connection on mac)

Perhaps the best possible solution would be ‘ah, you just need our LightBridge software’ but the little bit I’ve read about it seems like its for Ruida/network devices (as opposed to GBRL/USB, but tell me I’m wrong!).

Thanks,
Nathan.

Here’s a chunk of debug, after I right click on the Devices button…

EV: 1001 took 4 uS
EV: 1001 took 2 uS
EV: 1018 took 4 uS
EV: 1015 took 350 uS
Enumerating ports:
Port: "cu.Bluetooth-Incoming-Port"
      Valid Candidate:  true
      PID: 0 VID: 0
      Manufacturer: ""
      Description: "incoming port - Bluetooth-Incoming-Port"
      System Loc: "/dev/cu.Bluetooth-Incoming-Port"
      Serial: ""

Port: "tty.Bluetooth-Incoming-Port"
      Valid Candidate:  false
      PID: 0 VID: 0
      Manufacturer: ""
      Description: "incoming port - Bluetooth-Incoming-Port"
      System Loc: "/dev/tty.Bluetooth-Incoming-Port"
      Serial: ""

Any ID allowed
Looking for port: "cu.Bluetooth-Incoming-Port"
-- candidate port PID 0 VID 0
    mfr:  ""
    prod: "incoming port - Bluetooth-Incoming-Port"
    name: "cu.Bluetooth-Incoming-Port"
 - found matching port name
Found port: PID 0 VID 0
Manufacturer: ""
Product: "incoming port - Bluetooth-Incoming-Port"
Name: "cu.Bluetooth-Incoming-Port"
Port open failed
"starting"  busy:  false  state:  0
EV: 1001 took 5 uS
EV: 1001 took 2 uS
EV: 1018 took 4 uS
EV: 1015 took 364 uS
-- candidate port PID 0 VID 0
    mfr:  ""
    prod: "incoming port - Bluetooth-Incoming-Port"
    name: "cu.Bluetooth-Incoming-Port"
 - found matching port name
Found port: PID 0 VID 0
Manufacturer: ""
Product: "incoming port - Bluetooth-Incoming-Port"
Name: "cu.Bluetooth-Incoming-Port"
Port open failed
-- candidate port PID 0 VID 0
    mfr:  ""
    prod: "incoming port - Bluetooth-Incoming-Port"
    name: "cu.Bluetooth-Incoming-Port"
 - found matching port name
Found port: PID 0 VID 0
Manufacturer: ""
Product: "incoming port - Bluetooth-Incoming-Port"
Name: "cu.Bluetooth-Incoming-Port"
Port open failed
-- candidate port PID 0 VID 0
    mfr:  ""
    prod: "incoming port - Bluetooth-Incoming-Port"
    name: "cu.Bluetooth-Incoming-Port"
 - found matching port name
Found port: PID 0 VID 0
Manufacturer: ""
Product: "incoming port - Bluetooth-Incoming-Port"
Name: "cu.Bluetooth-Incoming-Port"
Port open failed

Can’t help you there but I’ve used usbip on an rPi connected to an Ortur(GRBL) diode laser a few times now but with a Linux laptop also running usbip. Someone wrote pyusbip for working with a Mac remotely to do some firmware loading so maybe it’ll work here too. If you’re interested, his blog on creating this and his repo can be found at these links:
https://joshua0.dreamwidth.org/67264.html

Doug - thanks for that link. I had a good read, and looked at the source code. Unfortunately the guy had implemented the server end of usbip, and I need the client end.
I got as far as thinking about contributing to his efforts - and thought would that be the best use of my time? Maybe I will spend $50 on VirtualHere.

Unless someone from LightBurn could provide a way to force a /dev/ device and bypass the safety checks?

I’d rather pay $60 for LightBurn rather than $110 for LightBurn and VirtualHere…

As a policy we do not provide features that would encourage remote or unattended use of your laser. Fire is something that is always possible. We know we can’t prevent people from running their lasers unattended, but we won’t add features that encourage it. Sorry if this sounds overly blunt, but we do not want to have had a hand in causing a fire, injury, or worse.

You are using a GCode machine that requires the job to be streamed over USB, without any hiccups. The best recommendation I can make is that which is most straightforward: put an old computer next to your Ortur, you can install a copy of LightBurn there too (a key provides for 2 seats), and run the job that way, while you are physically there.

1 Like

The client side magic on Linux is VHCI so I wonder if that’s portable to Mac. I don’t know how they implemented the beta of the Windows client but that might also be something to look at if more is done in user-land.

While not a Mac solution, there is a $40 x86 SBC called Atomic Pi which comes with Ubuntu 18.04 on flash and I have run Lightburn on that. Sorry but I too can’t find a viable opensource software-only solution for the Mac.

And Ray is right, I’ve seen way too many burned up machines and too many, I just went in for a moment to ________.

The candour is appreciated, Ray.
I am a complete novice at this: Perhaps a cheap refurbished laptop is the right way to go for me - in ways that hinder ‘learning the hard way’.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.