Skip to content

feat: introduce serial link recovery#123

Open
sansmoraxz wants to merge 26 commits intogrid-x:masterfrom
sansmoraxz:feat/serial-recover
Open

feat: introduce serial link recovery#123
sansmoraxz wants to merge 26 commits intogrid-x:masterfrom
sansmoraxz:feat/serial-recover

Conversation

@sansmoraxz
Copy link
Copy Markdown
Contributor

@sansmoraxz sansmoraxz commented Dec 4, 2025

Attempt protection against shoddy wires in RTU connection.

Fixes: #122

@sansmoraxz

This comment was marked as resolved.

@sansmoraxz

This comment was marked as resolved.

@sansmoraxz sansmoraxz marked this pull request as ready for review December 7, 2025 05:37
Copy link
Copy Markdown
Contributor

@alexjoedt alexjoedt left a comment

Choose a reason for hiding this comment

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

Hey, sorry for the late review! Really like the direction here.

I left a few comments, mostly around defaults and some small robustness things. Hope they're helpful, let me know what you think!

Comment thread serial.go
Comment thread rtuclient.go Outdated
Comment thread rtuclient.go Outdated
Comment thread rtuclient.go Outdated
Comment thread rtuclient.go
Comment thread rtuclient.go Outdated
Comment thread rtu_transport_test.go Outdated
Comment thread rtu_transport_test.go
@sansmoraxz
Copy link
Copy Markdown
Contributor Author

sansmoraxz commented Mar 27, 2026

Also this has the unexpected surprise of writing to currently open terminals.

modbus/Makefile

Lines 12 to 16 in 79617db

test:
diagslave -m tcp -p 5020 & diagslave -m enc -p 5021 & go test -run TCP -v $(shell glide nv)
socat -d -d pty,raw,echo=0 pty,raw,echo=0 & diagslave -m rtu /dev/pts/1 & go test -run RTU -v $(shell glide nv)
socat -d -d pty,raw,echo=0 pty,raw,echo=0 & diagslave -m ascii /dev/pts/3 & go test -run ASCII -v $(shell glide nv)
go test -v -count=1 github.com/grid-x/modbus/cmd/modbus-cli

IMO instead of pts terminals perhaps better to have some tmp file that's auto trapped and deleted once tests are run.

@sansmoraxz sansmoraxz requested a review from alexjoedt April 2, 2026 09:32
Comment thread rtuclient.go Outdated
Comment thread serial.go Outdated
Comment thread asciiclient.go Outdated
@alexjoedt alexjoedt added the enhancement New feature or request label Apr 17, 2026
Comment thread ascii_transport_test.go Outdated
Comment thread serial.go
Comment thread serial.go
Comment thread rtuclient.go Outdated
Comment thread asciiclient.go Outdated
Comment thread rtu_transport_test.go Outdated
Comment thread ascii_transport_test.go
Comment thread serial.go
@sansmoraxz sansmoraxz requested a review from alexjoedt April 17, 2026 12:55
Copy link
Copy Markdown
Contributor

@alexjoedt alexjoedt left a comment

Choose a reason for hiding this comment

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

Sorry for the long review cycle, and thanks for your patience and the great contribution, @sansmoraxz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Auto recovery for serial connections

2 participants