How to find Serial Port on Pi Zero 2?

LaserWeb information

On the About page, I see that I have:

  • Frontend version: 4.0.999-138
  • Backend version: not connected

My settings are:

{
  "settings": {
    "__version": "4.0.999",
    "__selectedProfile": "*gen_grbl",
    "__latestRelease": "2019-11-26T10:45:07Z",
    "showMachine": true,
    "machineWidth": 150,
    "machineHeight": 200,
    "machineBeamDiameter": 0.2,
    "machineBottomLeftX": 0,
    "machineBottomLeftY": 0,
    "machineFeedRange": {
      "XY": {"min": 1, "max": 50000},
      "Z": {"min": 1, "max": 50000},
      "A": {"min": 1, "max": 50000},
      "S": {"min": 0, "max": 30000}
    },
    "machineXYProbeOffset": 0,
    "machineZEnabled": false,
    "machineZMatThickness": 0,
    "machineZToolOffset": 0,
    "machineZStartHeight": "",
    "machineZProbeOffset": 0,
    "machineAEnabled": false,
    "machineBlowerEnabled": false,
    "machineBlowerGcodeOn": "",
    "machineBlowerGcodeOff": "",
    "pxPerInch": 96,
    "forcePxPerInch": false,
    "dpiBitmap": 300,
    "toolGridWidth": 400,
    "toolGridHeight": 300,
    "toolGridMinorSpacing": 10,
    "toolGridMajorSpacing": 50,
    "toolSafetyLockDisabled": false,
    "toolCncMode": false,
    "toolImagePosition": "BL",
    "toolUseNumpad": false,
    "toolDisplayCache": false,
    "toolUseGamepad": false,
    "toolCreateEmptyOps": false,
    "toolVideoDevice": null,
    "toolVideoPerspective": {"enabled": false},
    "toolVideoLens": {"a": 1, "b": 1, "F": 1, "scale": 1},
    "toolVideoFov": {"x": 1, "y": 1},
    "toolVideoResolution": "720p(HD)",
    "toolVideoOMR": false,
    "toolVideoOMROffsetX": 0,
    "toolVideoOMROffsetY": 0,
    "toolVideoOMRMarkerSize": 20,
    "toolWebcamUrl": "",
    "toolFeedUnits": "mm/min",
    "toolTestSValue": 1,
    "toolTestDuration": 0,
    "gcodeStart": "G21         ; Set units to mm\r\nG90         ; Absolute positioning\r\nM4 S0       ; Enable Laser/Spindle (0 power)\r\n",
    "gcodeEnd": "M5          ; Disable Laser/Spindle\r\n",
    "gcodeHoming": "$H",
    "gcodeGenerator": "default",
    "gcodeToolOn": "",
    "gcodeToolOff": "",
    "gcodeLaserIntensity": "S",
    "gcodeLaserIntensitySeparateLine": false,
    "gcodeSMinValue": 0,
    "gcodeSMaxValue": 1000,
    "gcodeCheckSizePower": 0,
    "gcodeToolTestPower": 0,
    "gcodeToolTestDuration": 0,
    "gcodeConcurrency": 2,
    "gcodeCurvePrecision": 0.1,
    "comServerVersion": "not connected",
    "comServerIP": "localhost:8000",
    "comServerConnect": false,
    "comInterfaces": [],
    "comPorts": [],
    "comAccumulatedJobTime": 0,
    "connectVia": "",
    "connectPort": "",
    "connectBaud": "115200",
    "connectIP": "",
    "jogStepsize": 1,
    "jogFeedXY": 1800,
    "jogFeedZ": 300,
    "macros": {
      "*GotoXY0": {
        "label": "Goto XY zero",
        "gcode": "G0 X0Y0",
        "keybinding": "ctrl+f1",
        "_locked": false
      },
      "*LaserOff": {
        "label": "LASER OFF",
        "gcode": "M5",
        "keybinding": "ctrl+f2",
        "_locked": false
      }
    },
    "uiFcDrag": null,
    "toolUseVideo": false
  }
}

Problem description

When I view Comms > Machine Connection, I expect to be able to see the serial/usb port on my Pi, but instead nothing is visible in the Machine Connection dropdown.

If I connect to the controller directly from my desktop PC with LaserGrbl, it works fine.

I’ve enabled the serial interface via raspi-config (screenshot below). I’ve also run npm install serialport after seeing it in another support message.

I’m quite a n00b with Linux and the Pi world, so it’s highly likely I’m missing something obvious.

Can anybody help with ways to get my Pi Zero 2 to expose the serial port which my CNC/laser machine is connected to?

System description

  • My machine is a diode laser + mill (image below)

  • I have a mystery Chinese board which accepted the grbl firmware and works find with LaserGrbl directly connected to my PC. Images below of the rig + controller board.

  • It has grbl version 1.1h installed

  • I connect via USB | Serial using ??? ← this is where I think my problem is rooted.

  • My computer(s) on which I run LaserWeb run(s) Raspberry Pi OS Lite (32-bit) Bullseye. Linux version 5.15.32-v7+.

LaserWeb Screenshot:

The Machine:


raspi-config showing serial interface enabled

re-starting instructions from

Install: Raspberry Pi (+ other Linux) - LaserWeb / CNCWeb (yurl.ch)

And ignoring instructions it links to here:

LaserWeb development install on Raspian Bullseye and Buster. · GitHub

Nope, those instructions fail with something to do with serialport.cpp :frowning:

Same error with a fresh image again following these instructions:

Manual Installation (RasPi) · LaserWeb/lw.comm-server Wiki (github.com)

Server starts, but nothing available in Machine Connection :frowning:

:frowning:

So… at least one problem is finding the name of the serial device primarily, and then secondarily making sure that the user you are running laserweb as has permission to access that device.

Please include the output of dmesg | grep -i usb

By way of example, I have a pi with USB-connected serial devices that look like this:

$ dmesg | grep -i usb
...
[3831934.844453] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
...
$ ls -l /dev/ttyACM0 
crw-rw----+ 1 root dialout 166, 0 Aug 15 00:51 /dev/ttyACM0
$ id
uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),5(tty),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),105(input),109(netdev),997(gpio),998(i2c),999(spi)

The dialout group (sorry, the name dates from modems) is able to talk to the device, and the user is in the dialout group and so is able to talk to the device.

Hi, and thanks for the help… the dmesg | grep -i usb output is below:

pi@cnc:~ $ dmesg | grep -i usb
[    0.157021] usbcore: registered new interface driver usbfs
[    0.157123] usbcore: registered new interface driver hub
[    0.157227] usbcore: registered new device driver usb
[    0.157617] usb_phy_generic phy: supply vcc not found, using dummy regulator
[    2.031553] usbcore: registered new interface driver lan78xx
[    2.034836] usbcore: registered new interface driver smsc95xx
[    3.034424] dwc_otg 3f980000.usb: DWC OTG Controller
[    3.037207] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    3.040048] dwc_otg 3f980000.usb: irq 89, io mem 0x00000000
[    3.048583] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[    3.054133] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.057056] usb usb1: Product: DWC OTG Controller
[    3.059927] usb usb1: Manufacturer: Linux 5.15.32-v7+ dwc_otg_hcd
[    3.062872] usb usb1: SerialNumber: 3f980000.usb
[    3.066584] hub 1-0:1.0: USB hub found
[    3.073470] usbcore: registered new interface driver usb-storage
[    3.099272] usbcore: registered new interface driver usbhid
[    3.102275] usbhid: USB HID core driver
[    8.460576] usbcore: registered new interface driver brcmfmac
[  557.425995] usb 1-1: new full-speed USB device number 2 using dwc_otg
[  557.666957] usb 1-1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64
[  557.666990] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[  557.667010] usb 1-1: Product: USB Serial
[  557.774263] usbcore: registered new interface driver usbserial_generic
[  557.774330] usbserial: USB Serial support registered for generic
[  557.777543] usbcore: registered new interface driver ch341
[  557.777661] usbserial: USB Serial support registered for ch341-uart
[  557.779058] usb 1-1: ch341-uart converter now attached to ttyUSB0

And without the CNC plugged in to usb its this:

[    0.157021] usbcore: registered new interface driver usbfs
[    0.157123] usbcore: registered new interface driver hub
[    0.157227] usbcore: registered new device driver usb
[    0.157617] usb_phy_generic phy: supply vcc not found, using dummy regulator
[    2.031553] usbcore: registered new interface driver lan78xx
[    2.034836] usbcore: registered new interface driver smsc95xx
[    3.034424] dwc_otg 3f980000.usb: DWC OTG Controller
[    3.037207] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    3.040048] dwc_otg 3f980000.usb: irq 89, io mem 0x00000000
[    3.048583] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[    3.054133] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.057056] usb usb1: Product: DWC OTG Controller
[    3.059927] usb usb1: Manufacturer: Linux 5.15.32-v7+ dwc_otg_hcd
[    3.062872] usb usb1: SerialNumber: 3f980000.usb
[    3.066584] hub 1-0:1.0: USB hub found
[    3.073470] usbcore: registered new interface driver usb-storage
[    3.099272] usbcore: registered new interface driver usbhid
[    3.102275] usbhid: USB HID core driver
[    8.460576] usbcore: registered new interface driver brcmfmac

So something to do with these lines???

[  557.425995] usb 1-1: new full-speed USB device number 2 using dwc_otg
[  557.666957] usb 1-1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64
[  557.666990] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[  557.667010] usb 1-1: Product: USB Serial
[  557.774263] usbcore: registered new interface driver usbserial_generic
[  557.774330] usbserial: USB Serial support registered for generic
[  557.777543] usbcore: registered new interface driver ch341
[  557.777661] usbserial: USB Serial support registered for ch341-uart
[  557.779058] usb 1-1: ch341-uart converter now attached to ttyUSB0

I’m afraid my n00bness is limiting my understanding of the rest of your message though. The pi has one user “pi”… and even if I log on as that via ssh, and startup the server, no joy.

I’m guessing my USB port is ttyUSB0 ?

If i execute your other commands in line with that, I get:

pi@cnc:~ $ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Aug 15 18:37 /dev/ttyUSB0
pi@cnc:~ $ id
uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),104(input),106(render),108(netdev),997(gpio),998(i2c),999(spi)

But now I’m back to being utterly clueless on where to go with this info! :slight_smile:

I’m a Linux person, so /dev/ttyUSB0 looks right, but I’m not actually a laserweb person, so my helpfulness may have now run short. :grimacing: Over to the folks who know more about laserweb! :relaxed:

Ah well, thanks for trying dude.

Looks like the Pi is configured right… the device is there and visible, and i think it’s a 341 chipset on the cnc, so I think it’s visible… just not to laserweb :frowning:

@cprezzi @easytarget are either of you able to help here? I’m out of my depth…

I think the problem is much simpler: Your frontend is not connected to the Raspbery Pi!

In the screenshot I can see, that the server IP is configured as “localhost:8000” which only works when the frontend is run on the same PC as the backend.
In your case I immagine that the backend runs on the Raspberry Pi Zero 2 and you start the frontend on a differnet PC over WLAN/LAN. In this case you must change the server IP to Raspi-IP:8000 and then hit connect! After that you should see the available USB Ports.

2 Likes

Wheyyy heyyyy!!!

I think you might have nailed it! I had assumed all along that since the web server was running on the pi, that the connection would be from perspective!!!

image

Now lets get this thing burning!!! :smiley:

(and onto my next unrelated problem of why the wifi besides the cnc seems to be a deadzone today! If it’s not one thing, it’s another with pesky IT!)

1 Like

First burn is for you guys!

(Or actually, the 5th, as you can see attempts 1-4 didn’t go quite to plan, but got there eventually!)

3 Likes