winder / Universal-G-Code-Sender

A cross-platform G-Code sender for GRBL, Smoothieware, TinyG and G2core.
http://winder.github.io/ugs_website/
GNU General Public License v3.0
1.85k stars 758 forks source link

Connection trouble #2452

Closed dastultz closed 5 months ago

dastultz commented 5 months ago

Version

2.1.2

Hardware / Firmware

GRBL 1.1

What happened

Years ago I ran UGS with a different computer. I'm just getting started again with a different computer, the third I've used to run UGS. I have a consistent problem connecting. Upon connection attempt I get this:

Connecting to jserialcomm://ttyUSB0:115200 Fetching device status

? Fetching device status (2 of 3)... ? Fetching device status (3 of 3)... ? Connection closed

Then I connect with a "serial monitor" program, in my case "screen" on Linux. I connect successfully, noting that it takes longer to connect than it seems UGS is waiting. I exit "screen" and connect with UGS and get this (with verbose logging on):

Connecting to jserialcomm://ttyUSB0:115200 Fetching device status

? <Idle|MPos:0.0000,0.0000,0.0000|F:0.0|WCO:-0.3630,-0.0149,-1.2425> ok $I [VER:1.1f.20170801:] [OPT:S,15,128] ok $$ $0 = 10 (Step pulse time, microseconds) $1 = 25 (Step idle delay, milliseconds) $2 = 0 (Step pulse invert, mask) $3 = 1 (Step direction invert, mask) $4 = 0 (Invert step enable pin, boolean) $5 = 0 (Invert limit pins, boolean) $6 = 0 (Invert probe pin, boolean) $10 = 1 (Status report options, mask) $11 = 0.010 (Junction deviation, millimeters) $12 = 0.002 (Arc tolerance, millimeters) $13 = 1 (Report in inches, boolean) $20 = 0 (Soft limits enable, boolean) $21 = 1 (Hard limits enable, boolean) $22 = 0 (Homing cycle enable, boolean) $23 = 0 (Homing direction invert, mask) $24 = 50.000 (Homing locate feed rate, mm/min) $25 = 457.000 (Homing search seek rate, mm/min) $26 = 250 (Homing switch debounce delay, milliseconds) $27 = 1.000 (Homing switch pull-off distance, millimeters) $30 = 2800 (Maximum spindle speed, RPM) $31 = 0 (Minimum spindle speed, RPM) $32 = 0 (Laser-mode enable, boolean) $100 = 314.961 (X-axis travel resolution, step/mm) $101 = 314.961 (Y-axis travel resolution, step/mm) $102 = 314.961 (Z-axis travel resolution, step/mm) $110 = 750.000 (X-axis maximum rate, mm/min) $111 = 750.000 (Y-axis maximum rate, mm/min) $112 = 500.000 (Z-axis maximum rate, mm/min) $120 = 15.000 (X-axis acceleration, mm/sec^2) $121 = 15.000 (Y-axis acceleration, mm/sec^2) $122 = 15.000 (Z-axis acceleration, mm/sec^2) $130 = 225.000 (X-axis maximum travel, millimeters) $131 = 125.000 (Y-axis maximum travel, millimeters) $132 = 170.000 (Z-axis maximum travel, millimeters) ok $G [GC:G0 G54 G17 G20 G90 G94 M5 M9 T0 F0.0] ok *** Connected to GRBL 1.1f <Idle|MPos:0.0000,0.0000,0.0000|F:0.0|Ov:100,100,100|A:C> <Idle|MPos:0.0000,0.0000,0.0000|F:0.0> <Idle|MPos:0.0000,0.0000,0.0000|F:0.0> <Idle|MPos:0.0000,0.0000,0.0000|F:0.0> <Idle|MPos:0.0000,0.0000,0.0000|F:0.0> <Idle|MPos:0.0000,0.0000,0.0000|F:0.0>

I should note that I am running a customized version of GRBL but I haven't made any changes in 7 years and I've run it with UGS on 2 different computers.

I'm now running Fedora on a Framework 13 laptop. More details in the attached log file. Let me know if I can give you more information. Thanks for taking a look.

/Daryl

messages.log

How to reproduce

Try to connect with Framework 13 AMD laptop running Fedora.

Operating System

Fedora

Anything else

No response

breiler commented 5 months ago

Can you try the version 2.1.4, it is using the latest JSerialComm library which has some changes to the RTS/DTR functions. I have never experienced these kinds of problems on my workstation though (Ubuntu 23.04) so I have no idea if this will have any effect.

I am curious what do you mean by this?

I connect successfully, noting that it takes longer to connect than it seems UGS is waiting.

UGS will try and send blank lines upon connect to make sure the controller is responsive (not in a terminal Alarm state which requires a reset). It will try three times with one second delay. If this takes longer on your hardware I'm interested what type of controller you are running.

dastultz commented 5 months ago

2.1.4 behaves the same.

You got what I meant about timing. UGS tries for 3 seconds to connect. I count in my head 5 or 6 seconds for screen to connect. After that UGS connects the first try. So maybe the hardware has some kind of initialization delay? Again it's a Framework 13 AMD laptop. I don't know much about modern serial hardware, but I can try to find more information if you can suggest a query.

Here's a bunch of info the OS gave me:

pcilib: Error reading /sys/bus/pci/devices/0000:00:08.3/label: Operation not permitted 00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14e8 Subsystem: Framework Computer Inc. Device 0006 Flags: fast devsel

00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Device 14e9 Subsystem: Framework Computer Inc. Device 0006 Flags: fast devsel, IRQ 29 Capabilities:

00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14ea Flags: fast devsel, IOMMU group 0

00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14ea Flags: fast devsel, IOMMU group 1

00:02.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 14ee (prog-if 00 [Normal decode]) Subsystem: Advanced Micro Devices, Inc. [AMD] Device 1453 Flags: bus master, fast devsel, latency 0, IRQ 38, IOMMU group 1 Bus: primary=00, secondary=01, subordinate=01, sec-latency=0 I/O behind bridge: [disabled] [32-bit] Memory behind bridge: 90b00000-90bfffff [size=1M] [32-bit] Prefetchable memory behind bridge: 8010900000-80109fffff [size=1M] [32-bit] Capabilities: Kernel driver in use: pcieport

00:02.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 14ee (prog-if 00 [Normal decode]) Subsystem: Advanced Micro Devices, Inc. [AMD] Device 1453 Flags: bus master, fast devsel, latency 0, IRQ 39, IOMMU group 1 Bus: primary=00, secondary=02, subordinate=02, sec-latency=0 I/O behind bridge: [disabled] [32-bit] Memory behind bridge: 90a00000-90afffff [size=1M] [32-bit] Prefetchable memory behind bridge: [disabled] [64-bit] Capabilities: Kernel driver in use: pcieport

00:03.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14ea Flags: fast devsel, IOMMU group 2

00:03.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 19h USB4/Thunderbolt PCIe tunnel (prog-if 00 [Normal decode]) Subsystem: Advanced Micro Devices, Inc. [AMD] Device 1453 Flags: bus master, fast devsel, latency 0, IRQ 40, IOMMU group 2 Bus: primary=00, secondary=03, subordinate=61, sec-latency=0 I/O behind bridge: 6000-9fff [size=16K] [16-bit] Memory behind bridge: 78000000-8fffffff [size=384M] [32-bit] Prefetchable memory behind bridge: 7000000000-7fffffffff [size=64G] [32-bit] Capabilities: Kernel driver in use: pcieport

00:04.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14ea Flags: fast devsel, IOMMU group 3

00:04.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 19h USB4/Thunderbolt PCIe tunnel (prog-if 00 [Normal decode]) Subsystem: Advanced Micro Devices, Inc. [AMD] Device 1453 Flags: bus master, fast devsel, latency 0, IRQ 41, IOMMU group 3 Bus: primary=00, secondary=62, subordinate=c0, sec-latency=0 I/O behind bridge: 2000-5fff [size=16K] [16-bit] Memory behind bridge: 60000000-77ffffff [size=384M] [32-bit] Prefetchable memory behind bridge: 6000000000-6fffffffff [size=64G] [32-bit] Capabilities: Kernel driver in use: pcieport

00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14ea Flags: fast devsel, IOMMU group 4

00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 14eb (prog-if 00 [Normal decode]) Subsystem: Device 0006:f111 Flags: bus master, fast devsel, latency 0, IRQ 42, IOMMU group 4 Bus: primary=00, secondary=c1, subordinate=c1, sec-latency=0 I/O behind bridge: 1000-1fff [size=4K] [16-bit] Memory behind bridge: 90000000-905fffff [size=6M] [32-bit] Prefetchable memory behind bridge: 8000000000-80107fffff [size=264M] [32-bit] Capabilities: Kernel driver in use: pcieport

00:08.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 14eb (prog-if 00 [Normal decode]) Subsystem: Device 0006:f111 Flags: bus master, fast devsel, latency 0, IRQ 43, IOMMU group 4 Bus: primary=00, secondary=c2, subordinate=c2, sec-latency=0 I/O behind bridge: [disabled] [32-bit] Memory behind bridge: 90900000-909fffff [size=1M] [32-bit] Prefetchable memory behind bridge: 8010800000-80108fffff [size=1M] [32-bit] Capabilities: Kernel driver in use: pcieport

00:08.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 14eb (prog-if 00 [Normal decode]) Subsystem: Device 0006:f111 Flags: bus master, fast devsel, latency 0, IRQ 44, IOMMU group 4 Bus: primary=00, secondary=c3, subordinate=c3, sec-latency=0 I/O behind bridge: [disabled] [32-bit] Memory behind bridge: 90600000-908fffff [size=3M] [32-bit] Prefetchable memory behind bridge: [disabled] [64-bit] Capabilities: Kernel driver in use: pcieport

00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 71) Subsystem: Framework Computer Inc. Device 0006 Flags: 66MHz, medium devsel, IOMMU group 5 Kernel driver in use: piix4_smbus Kernel modules: i2c_piix4, sp5100_tco

00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51) Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, 66MHz, medium devsel, latency 0, IOMMU group 5

00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14f0 Flags: fast devsel, IOMMU group 6

00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14f1 Flags: fast devsel, IOMMU group 6

00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14f2 Flags: fast devsel, IOMMU group 6

00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14f3 Flags: fast devsel, IOMMU group 6 Kernel driver in use: k10temp Kernel modules: k10temp

00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14f4 Flags: fast devsel, IOMMU group 6

00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14f5 Flags: fast devsel, IOMMU group 6

00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14f6 Flags: fast devsel, IOMMU group 6

00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 14f7 Flags: fast devsel, IOMMU group 6

01:00.0 Network controller: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter Subsystem: MEDIATEK Corp. Device e616 Flags: bus master, fast devsel, latency 0, IRQ 117, IOMMU group 1 Memory at 8010900000 (64-bit, prefetchable) [size=1M] Memory at 90b00000 (64-bit, non-prefetchable) [size=32K] Capabilities: Kernel driver in use: mt7921e Kernel modules: mt7921e

02:00.0 Non-Volatile memory controller: Sandisk Corp WD Black SN770 / PC SN740 256GB / PC SN560 (DRAM-less) NVMe SSD (rev 01) (prog-if 02 [NVM Express]) Subsystem: Sandisk Corp WD Black SN770 / PC SN740 256GB / PC SN560 (DRAM-less) NVMe SSD Flags: bus master, fast devsel, latency 0, IRQ 59, IOMMU group 1 Memory at 90a00000 (64-bit, non-prefetchable) [size=16K] Capabilities: Kernel driver in use: nvme Kernel modules: nvme

c1:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 (rev c4) (prog-if 00 [VGA controller]) Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, fast devsel, latency 0, IRQ 47, IOMMU group 4 Memory at 8000000000 (64-bit, prefetchable) [size=256M] Memory at 90000000 (64-bit, prefetchable) [size=2M] I/O ports at 1000 [size=256] Memory at 90500000 (32-bit, non-prefetchable) [size=512K] Capabilities: Kernel driver in use: amdgpu Kernel modules: amdgpu

c1:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt Radeon High Definition Audio Controller Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, fast devsel, latency 0, IRQ 116, IOMMU group 4 Memory at 905c8000 (32-bit, non-prefetchable) [size=16K] Capabilities: Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel

c1:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Family 19h (Model 74h) CCP/PSP 3.0 Device Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, fast devsel, latency 0, IRQ 56, IOMMU group 4 Memory at 90400000 (32-bit, non-prefetchable) [size=1M] Memory at 905cc000 (32-bit, non-prefetchable) [size=8K] Capabilities: Kernel driver in use: ccp Kernel modules: ccp

c1:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15b9 (prog-if 30 [XHCI]) Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, fast devsel, latency 0, IRQ 46, IOMMU group 4 Memory at 90200000 (64-bit, non-prefetchable) [size=1M] Capabilities: Kernel driver in use: xhci_hcd

c1:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15ba (prog-if 30 [XHCI]) Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, fast devsel, latency 0, IRQ 48, IOMMU group 4 Memory at 90300000 (64-bit, non-prefetchable) [size=1M] Capabilities: Kernel driver in use: xhci_hcd

c1:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor (rev 63) Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, fast devsel, latency 0, IRQ 112, IOMMU group 4 Memory at 90580000 (32-bit, non-prefetchable) [size=256K] Memory at 8010000000 (64-bit, prefetchable) [size=8M] Capabilities: Kernel driver in use: snd_pci_ps Kernel modules: snd_pci_acp3x, snd_rn_pci_acp3x, snd_pci_acp5x, snd_pci_acp6x, snd_rpl_pci_acp6x, snd_pci_ps, snd_sof_amd_renoir, snd_sof_amd_rembrandt, snd_sof_amd_vangogh

c1:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, fast devsel, latency 0, IRQ 60, IOMMU group 4 Memory at 905c0000 (32-bit, non-prefetchable) [size=32K] Capabilities: Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel

c2:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Device 14ec Subsystem: Framework Computer Inc. Device 0006 Flags: fast devsel, IOMMU group 4 Capabilities:

c2:00.1 Signal processing controller: Advanced Micro Devices, Inc. [AMD] AMD IPU Device Subsystem: Framework Computer Inc. Device 0006 Flags: fast devsel, IRQ 255, IOMMU group 4 Memory at 90900000 (32-bit, non-prefetchable) [disabled] [size=512K] Memory at 909c0000 (32-bit, non-prefetchable) [disabled] [size=8K] Memory at 8010800000 (64-bit, prefetchable) [disabled] [size=256K] Memory at 90980000 (32-bit, non-prefetchable) [disabled] [size=256K] Capabilities:

c3:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Device 14ec Subsystem: Framework Computer Inc. Device 0006 Flags: fast devsel, IOMMU group 4 Capabilities:

c3:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15c0 (prog-if 30 [XHCI]) Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, fast devsel, latency 0, IRQ 50, IOMMU group 4 Memory at 90600000 (64-bit, non-prefetchable) [size=1M] Capabilities: Kernel driver in use: xhci_hcd

c3:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15c1 (prog-if 30 [XHCI]) Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, fast devsel, latency 0, IRQ 52, IOMMU group 4 Memory at 90700000 (64-bit, non-prefetchable) [size=1M] Capabilities: Kernel driver in use: xhci_hcd

c3:00.5 USB controller: Advanced Micro Devices, Inc. [AMD] Pink Sardine USB4/Thunderbolt NHI controller #1 (prog-if 40 [USB4 Host Interface]) Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, fast devsel, latency 0, IRQ 78, IOMMU group 4 Memory at 90800000 (64-bit, non-prefetchable) [size=512K] Capabilities: Kernel driver in use: thunderbolt Kernel modules: thunderbolt

c3:00.6 USB controller: Advanced Micro Devices, Inc. [AMD] Pink Sardine USB4/Thunderbolt NHI controller #2 (prog-if 40 [USB4 Host Interface]) Subsystem: Framework Computer Inc. Device 0006 Flags: bus master, fast devsel, latency 0, IRQ 95, IOMMU group 4 Memory at 90880000 (64-bit, non-prefetchable) [size=512K] Capabilities: Kernel driver in use: thunderbolt Kernel modules: thunderbolt

breiler commented 5 months ago

I've made a small change in the latest nightly build so that it attempts the connection for ten seconds. I have no idea if this will work since it will not be waiting for a response from the controller instead it will "ping" it with newlines to see if it is alive. This may disrupt its boot sequence which I had problems with on Arduino Megas.

Regarding what controller you are using, I could not find it in your list. What kind of device is it? Arduino Due, Arduino Nano, ESP32, ...?

dastultz commented 5 months ago

Sorry I misunderstood the question about the controller. I thought we were talking about the USB/serial hardware on my computer. GRBL is running on a Sanguino.

I can't figure out how to access the nightly build asset.

breiler commented 5 months ago

The column that says "Nightly build": https://github.com/winder/Universal-G-Code-Sender?tab=readme-ov-file#downloads

dastultz commented 5 months ago

That did the trick! Here's the output:

*** Connecting to jserialcomm://ttyUSB0:115200
*** Fetching device status
>>> ?
*** Fetching device status (2 of 10)...
>>> ?
*** Fetching device status (3 of 10)...
>>> ?
*** Fetching device status (4 of 10)...
>>> ?
*** Fetching device status (5 of 10)...
>>> ?
**** The communicator has been paused ****
**** The communicator has been paused ****
Grbl 1.1f ['$' for help]
>G90G20:ok
<Idle|MPos:0.0000,0.0000,0.0000|F:0.0|WCO:-0.3630,-0.0149,-1.2425>
*** Fetching device status (6 of 10)...
>>> ?
<Idle|MPos:0.0000,0.0000,0.0000|F:0.0|Ov:100,100,100|A:C>
ok
>>> $I
[VER:1.1f.20170801:]
[OPT:S,15,128]
ok
>>> $$
$0 = 10    (Step pulse time, microseconds)
$1 = 25    (Step idle delay, milliseconds)
$2 = 0    (Step pulse invert, mask)
$3 = 1    (Step direction invert, mask)
$4 = 0    (Invert step enable pin, boolean)
$5 = 0    (Invert limit pins, boolean)
$6 = 0    (Invert probe pin, boolean)
$10 = 1    (Status report options, mask)
$11 = 0.010    (Junction deviation, millimeters)
$12 = 0.002    (Arc tolerance, millimeters)
$13 = 1    (Report in inches, boolean)
$20 = 0    (Soft limits enable, boolean)
$21 = 1    (Hard limits enable, boolean)
$22 = 0    (Homing cycle enable, boolean)
$23 = 0    (Homing direction invert, mask)
$24 = 50.000    (Homing locate feed rate, mm/min)
$25 = 457.000    (Homing search seek rate, mm/min)
$26 = 250    (Homing switch debounce delay, milliseconds)
$27 = 1.000    (Homing switch pull-off distance, millimeters)
$30 = 2800    (Maximum spindle speed, RPM)
$31 = 0    (Minimum spindle speed, RPM)
$32 = 0    (Laser-mode enable, boolean)
$100 = 314.961    (X-axis travel resolution, step/mm)
$101 = 314.961    (Y-axis travel resolution, step/mm)
$102 = 314.961    (Z-axis travel resolution, step/mm)
$110 = 750.000    (X-axis maximum rate, mm/min)
$111 = 750.000    (Y-axis maximum rate, mm/min)
$112 = 500.000    (Z-axis maximum rate, mm/min)
$120 = 15.000    (X-axis acceleration, mm/sec^2)
$121 = 15.000    (Y-axis acceleration, mm/sec^2)
$122 = 15.000    (Z-axis acceleration, mm/sec^2)
$130 = 225.000    (X-axis maximum travel, millimeters)
$131 = 125.000    (Y-axis maximum travel, millimeters)
$132 = 170.000    (Z-axis maximum travel, millimeters)
ok
>>> $G
[GC:G0 G54 G17 G20 G90 G94 M5 M9 T0 F0.0]
ok
*** Connected to GRBL 1.1f
**** Connection closed ****