From 9e0015fe41616c5dd3caf95f5233d8cd5091b5a0 Mon Sep 17 00:00:00 2001 From: david mueller Date: Fri, 12 Dec 2025 21:49:09 +0100 Subject: [PATCH 1/5] Fix homing bug when trying to home while a homing sequence is already in progress Fixes https://github.com/LinuxCNC/linuxcnc/issues/3314 The modification to 'command.c' prevents the homing process breaking where the joint would continue moving indefinitely. The modifications to axis.py and gmoccapy.py prevents the gui freezing that occurs due to wait_complete() timing out to the default 5 seconds. --- src/emc/motion/command.c | 5 ++++- src/emc/usr_intf/axis/scripts/axis.py | 5 +++++ src/emc/usr_intf/gmoccapy/gmoccapy.py | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/emc/motion/command.c b/src/emc/motion/command.c index 0b79061d39b..8a660a20f44 100644 --- a/src/emc/motion/command.c +++ b/src/emc/motion/command.c @@ -1381,7 +1381,10 @@ void emcmotCommandHandler_locked(void *arg, long servo_period) joint_num); return; } - + if ( get_homing_is_active() ) { + reportError("Homing not possible until current homing process is finished.\n"); + return; + } if (!GET_MOTION_ENABLE_FLAG()) { break; } diff --git a/src/emc/usr_intf/axis/scripts/axis.py b/src/emc/usr_intf/axis/scripts/axis.py index ccb7ebe5939..c61cbc9c919 100755 --- a/src/emc/usr_intf/axis/scripts/axis.py +++ b/src/emc/usr_intf/axis/scripts/axis.py @@ -1952,6 +1952,11 @@ def all_homed(): return isHomed def go_home(num): + s.poll() + for j in range(s.joints): + if s.joint[j]["homing"]: + print(_("Homing not possible until current homing process is finished.")) + return set_motion_teleop(0) c.home(num) c.wait_complete() diff --git a/src/emc/usr_intf/gmoccapy/gmoccapy.py b/src/emc/usr_intf/gmoccapy/gmoccapy.py index c14809d7d6e..fbebf0d4516 100644 --- a/src/emc/usr_intf/gmoccapy/gmoccapy.py +++ b/src/emc/usr_intf/gmoccapy/gmoccapy.py @@ -3857,6 +3857,11 @@ def _on_btn_home_back_clicked(self, widget): def _on_btn_home_clicked(self, widget): # home axis or joint? LOG.debug("on button home clicked = {0}".format(widget.get_property("name"))) + self.stat.poll() + for j in range(self.stat.joints): + if self.stat.joint[j]["homing"]: + self._show_error((13, _("Homing not possible until current homing process is finished."))) + return if "axis" in widget.get_property("name"): value = widget.get_property("name")[-1] # now get the joint from directory by the value From 576c28fd343e76515f884113cd151440566a5018 Mon Sep 17 00:00:00 2001 From: david mueller Date: Wed, 5 Aug 2026 10:11:06 +0100 Subject: [PATCH 2/5] Docs: M19 does not use encoder index signal --- docs/src/gcode/m-code.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/gcode/m-code.adoc b/docs/src/gcode/m-code.adoc index bd388ccd0da..c36788c709e 100644 --- a/docs/src/gcode/m-code.adoc +++ b/docs/src/gcode/m-code.adoc @@ -233,7 +233,7 @@ M19 R- Q- [P-] [$-] M19 is a command of modal group 7, like M3, M4 and M5. M19 is cleared by any of M3,M4,M5. -Spindle orientation requires a quadrature encoder with an index to sense the +Spindle orientation requires a quadrature encoder to sense the spindle shaft position and direction of rotation. INI Settings in the [RS274NGC] section: From 2a8e5aba2c40fa663af6e08203b7ff9f4b837603 Mon Sep 17 00:00:00 2001 From: david mueller Date: Wed, 5 Aug 2026 10:12:14 +0100 Subject: [PATCH 3/5] Man: Remove outdated logic description from man page The relevant logic was changed in Commit b2cd764 but the man page was not updated. The Functionality of the logic is likely easier to understand by looking at the code. --- src/hal/components/orient.comp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/hal/components/orient.comp b/src/hal/components/orient.comp index 554153a58e2..e6abeff411f 100644 --- a/src/hal/components/orient.comp +++ b/src/hal/components/orient.comp @@ -25,10 +25,7 @@ command value, and fit with the motion spindle-orient support pins to support th The spindle is assumed to have stopped in an arbitrary position. The spindle encoder position is linked to the \\fBposition\\fR pin. The current value of the position pin is sampled on a positive edge on the \\fBenable\\fR pin, and -\\fBcommand\\fR is computed and set as follows: floor(number of -full spindle revolutions -in the \\fBposition\\fR sampled on positive edge) -plus \\fBangle\\fR/360 (the fractional revolution) +1/-1/0 depending on \\fBmode\\fR. +\\fBcommand\\fR is computed and set depending on \\fBmode\\fR. The \\fBmode\\fR pin is interpreted as follows: From 4428555a2a1c3bfe55e685d23c1e90409e2b37aa Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Tue, 4 Aug 2026 07:52:24 +0800 Subject: [PATCH 4/5] CI: Use main Ubuntu archive instead of azure.archive.ubuntu.com The azure.archive.ubuntu.com apt mirror on GitHub-hosted runners regularly degrades to trickle speeds for extended periods, stalling package downloads until the job hits its timeout. This is a recurring upstream problem, see actions/runner-images issues #7048 and #12949. apt retries do not help because the connection stays alive, only slow. Switch affected jobs to archive.ubuntu.com, which is consistently fast from Azure. --- .github/scripts/install-deps.sh | 2 ++ .github/scripts/use-main-ubuntu-mirror.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 .github/scripts/use-main-ubuntu-mirror.sh diff --git a/.github/scripts/install-deps.sh b/.github/scripts/install-deps.sh index dee1d5084b3..174c7a9558e 100755 --- a/.github/scripts/install-deps.sh +++ b/.github/scripts/install-deps.sh @@ -3,6 +3,8 @@ set -eu #Needed so CI fails when anything is wrong set -x +.github/scripts/use-main-ubuntu-mirror.sh + sudo apt-get --quiet update sudo apt-get install --yes --no-install-recommends devscripts equivs build-essential lintian clang debian/configure diff --git a/.github/scripts/use-main-ubuntu-mirror.sh b/.github/scripts/use-main-ubuntu-mirror.sh new file mode 100755 index 00000000000..8a5d12efbaa --- /dev/null +++ b/.github/scripts/use-main-ubuntu-mirror.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# The azure.archive.ubuntu.com apt mirror on GitHub-hosted runners +# regularly degrades to trickle speeds for extended periods, which stalls +# package downloads until the job hits its timeout. apt retries do not +# help because the connection stays alive, only slow. Switch to the main +# Ubuntu archive, which is consistently fast from Azure. + +set -eu #Needed so CI fails when anything is wrong +set -x + +for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do + [ -e "$f" ] || continue + sudo sed -i 's|http://azure\.archive\.ubuntu\.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' "$f" +done From c2a90fa0f6f4880473fde8f2320bc5ec1f650124 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Thu, 6 Aug 2026 13:01:44 +0800 Subject: [PATCH 5/5] CI: rewrite apt-mirrors.txt so the mirror switch actually applies The runner image configures apt with URIs: mirror+file:///etc/apt/apt-mirrors.txt in ubuntu.sources, so the azure.archive.ubuntu.com URL lives in that file, not in sources.list or the .list/.sources files. The sed pass in 1d46401b07 therefore matched nothing and apt kept using the azure mirror; the rip-and-test job on this branch stalled in Install dependencies and was cancelled at the 45 minute timeout. Add /etc/apt/apt-mirrors.txt to the rewrite list and fail the step if any azure.archive.ubuntu.com reference survives under /etc/apt, so a future runner image layout change cannot turn this script into a silent no-op again. --- .github/scripts/use-main-ubuntu-mirror.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/scripts/use-main-ubuntu-mirror.sh b/.github/scripts/use-main-ubuntu-mirror.sh index 8a5d12efbaa..971633dbae5 100755 --- a/.github/scripts/use-main-ubuntu-mirror.sh +++ b/.github/scripts/use-main-ubuntu-mirror.sh @@ -1,15 +1,22 @@ #!/bin/sh # The azure.archive.ubuntu.com apt mirror on GitHub-hosted runners -# regularly degrades to trickle speeds for extended periods, which stalls -# package downloads until the job hits its timeout. apt retries do not -# help because the connection stays alive, only slow. Switch to the main -# Ubuntu archive, which is consistently fast from Azure. +# regularly degrades to trickle speeds, stalling jobs until they time +# out. Switch to archive.ubuntu.com, which is consistently fast. set -eu #Needed so CI fails when anything is wrong set -x -for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do +# apt-mirrors.txt must be included: the runner image points apt at it +# via mirror+file:// in ubuntu.sources, so the azure URL lives there. +for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources /etc/apt/apt-mirrors.txt; do [ -e "$f" ] || continue sudo sed -i 's|http://azure\.archive\.ubuntu\.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' "$f" done + +# Fail if azure is still referenced, so an image layout change cannot +# turn this script into a silent no-op. +if grep -rsq 'azure\.archive\.ubuntu\.com' /etc/apt; then + echo "error: azure.archive.ubuntu.com still referenced under /etc/apt after mirror switch" >&2 + exit 1 +fi