Repository navigation
fix(dmx-driver): retry opening the DMX adapter and publish its state (#1547) - #1945
Merged
Merged
Conversation
…1547) new DMX() threw at module load when the adapter could not be opened, and the service crash-looped. The open now runs in the background with a 1 s to 60 s backoff, and the adapter state is published retained on STATUS_TOPIC.
groupsky
marked this pull request as ready for review
November 11, 2026 04:43
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1547
dmx-driver opened the DMX adapter at module load with no retry. When the adapter could not be opened, the process exited and crash-looped for good.
What changes
docker/dmx-driver/universe.js: opens the adapter in the background. On failure it logs the error and retries after 1 s, 2 s, 4 s … at most every 60 s. It has the sameset()as the native universe, so the message handler is unchanged. The latest frame received while the adapter is closed is written when it opens.index.jspublishes the adapter state, retained, onSTATUS_TOPIC(defaulthomy/dmx-driver/status):opening,onlineorofflinewith the error. The MQTT last will setsofflineif the service dies.Choices
dmxaddon ignores write errors in its update thread. If the adapter goes silent after it was opened while staying on the USB bus, the state staysonline. Fixing that needs a change in the addon fork; it is written indocker/dmx-driver/CLAUDE.md.Progress
new DMX()is wrapped so an open failure is logged and retried with backoff instead of exiting —universe.jshomy/dmx-driver/statusuniverse.test.js