Skip to content

Fix log spamming on disconnection/USB read error#1

Merged
erh merged 3 commits intoerh:masterfrom
vijayvuyyuru:fix-logs
Jan 14, 2026
Merged

Fix log spamming on disconnection/USB read error#1
erh merged 3 commits intoerh:masterfrom
vijayvuyyuru:fix-logs

Conversation

@vijayvuyyuru
Copy link
Copy Markdown

@vijayvuyyuru vijayvuyyuru commented Jan 12, 2026

On NJ1, the streamdeck was temporarily disconnected. I don't know if this was from being unplugged or just a cable being wiggled. This resulted in us writing 150 GB of loglines to the syslog file, all looking like:
\_ hidapi: hid_error is not implemented yet..
This pr contains several changes:

  • If we get a USB error, only log it if more than a minute has passed since the last identical error OR it is a new one
  • On USB read error, try to reconnect to the device. There's a sleep here to make sure we don't constantly hit USB I/O
  • On device reconnection, redraw all images and set the brightness if it wasn't. These videos show my manual tests.
IMG.MOV
Screen.Recording.2026-01-13.at.3.26.21.PM.mov

@erh
Copy link
Copy Markdown
Owner

erh commented Jan 13, 2026

should reconnect or something, not just fail silently.

streamdeck.go Outdated
if err != nil {
fmt.Println(err)
continue
return
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UX requirements for fixing this:

  1. if I unplug the usb port, I get a log, for as long as it is unplugged, at a reasonable frequency (once a minute) stating that the device is unplugged
  2. if I plug the device back in (to any usb port) it recovers and resumes normal operation

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@vijayvuyyuru vijayvuyyuru requested a review from erh January 13, 2026 20:27
@erh erh merged commit 11a2401 into erh:master Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants