Skip to content

smpclient: upload: retry on timeouts#123

Open
M1cha wants to merge 1 commit into
intercreate:mainfrom
M1cha:image-upload-retries
Open

smpclient: upload: retry on timeouts#123
M1cha wants to merge 1 commit into
intercreate:mainfrom
M1cha:image-upload-retries

Conversation

@M1cha

@M1cha M1cha commented Jul 8, 2026

Copy link
Copy Markdown

This is important for unrealiable transports like UDP over OpenThread.

Fixes: #56

This is important for unrealiable transports like UDP over OpenThread.

Fixes: intercreate#56
@M1cha M1cha force-pushed the image-upload-retries branch from 61a3990 to 9650a36 Compare July 8, 2026 13:07
@M1cha

M1cha commented Jul 8, 2026

Copy link
Copy Markdown
Author

I don't understand the CI error. Why would it think that response doesn't have those fields anymore?

Comment thread src/smpclient/__init__.py
Comment on lines +348 to +354
current_attempt = 0
except TimeoutError:
current_attempt += 1
continue
except SMPBadSequence:
current_attempt += 1
continue

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The type error happens here where it loops back around before checking for errors.

@JPHutchins

JPHutchins commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

@M1cha I appreciate you picking this one up again! I'm wondering if you'd be interested in generalizing it? The reason is that it's not only UDP or image uploads that suffer from this defect, so it would be nice to fix this all at once.

I've posted an implementation that I never finished here, if you'd like to purse that approach: #56 (comment)

It uses the sequence value to synchronize and drop stale messages. But I think it needs unit testing, integration testing, and field testing. I tested it by verifying that I could unplug/replug UART lines during an upload and that it would recover without starting over.

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.

Retransmit

2 participants