-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: show connectivity, auto re-connect when offline #260
Comments
Yes,
I suppose I'd poll every few seconds until the device responds, perhaps up
to a timeout of a minute, after which I'd display a message saying the
device is taking longer than expected to restart.
Though it would be nice to go further and have a firmware checksum or
version on that page so you can see what's going on after the flash was
successful.
…On Wed, 3 Nov 2021, 11:21 Proddy, ***@***.***> wrote:
Hi Rick,
Some of the people using my EMS-ESP project get confused with the
System/Restart feature where it says 'Device is restarting', the ESP
reboots but the web page is not refreshed. It's a trvial thing, but the
same happens with uploading firmware where you need to refresh the page
when you think it's done.
So I was thinking what's the best way to check for connectivity to the web
server and do retry's when it's offline. I would probably use WebSockets
but before I embark on this I'm interested in how you would approach it?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#260>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKE4VF7ECO226TFUSIBFKDUKEKWRANCNFSM5HIUXWYQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
ok, I'll give it a shot |
Was this still on your TODO list? Sounds like a good one and I have some ideas about how this might fit in to a UX refresh after the release of the new UI. |
yes, it was. It's kind of an important one for my project and often requested. It'll also fix the annoying issue when after a firmware update the UI is not automatically refreshed (I'm pushing out updates weekly). I was going to base it off this code. But won't get to it soon as I'm still struggling getting the event source not to skip messages (and reading up on when to use Memo and Callback hooks) |
@rjwats any thoughts on how to trigger a UI refresh after a successful firmware upload? Either via the heartbeat socket check or just hardcoded to trigger after the fileupload. This is an important one for me as I'm pushing out web UX changes every few weeks and my users (which I think could well be a few hundred now) always complain about not immediately seeing the latest UX changes. doh. |
I would show a spinner while I poll the "features" endpoint probably (because that endpoint is always present regardless of which features are enabled). I'd use a fairly short axios timeout, for a period of up to a couple of mins until the endpoint returns a 200 OK. Then I would restart call document.location.reload() or force the document location to '/' on success to force the reload :) Happy to knock together a PoC :) - i'm off till 2022! |
Lucky you! If you wouldn’t mind coding a small stub that would be super
helpful. I don’t have any time off this year (new job)!
…On Wed, 15 Dec 2021 at 17:25, rjwats ***@***.***> wrote:
I would show a spinner while I poll the "features" endpoint probably
(because that endpoint is always present regardless of which features are
enabled). I'd use a fairly short axios timeout, for a period of up to a
couple of mins until the endpoint returns a 200 OK. I think this
Then I would restart call document.location.reload() or force the document
location to '/' on success to force the reload :)
Happy to knock together a PoC :) - i'm off till 2022!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#260 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJMO6BU37WMEZOX4TZZFITURC6PFANCNFSM5HIUXWYQ>
.
|
Awesome! very fancy. So how long did that take you? I like the redirect route at the end. Also while we're (you are) at it is there way to verify the firmware with a CRC check? |
The verification check is an intresting one isn't it. Possibly generating an sha512 signature for the artefact and verifying that would be the way to go. The signature could be optional, and sent as a header on the file upload, and verified if supplied. Should be as simple as calling md_update for each segment of the payload, and at then verifying it at the end before calling Update.end(true): |
Oh, and it took about an hour, just really needed to write a polling component 👍 |
I've been using the firmware upload monitor a lot and can say it works flawlessly, a good 1 hour spent! |
Nice to hear. It's definitely better to have the feedback in the UI :)
…On Sun, 19 Dec 2021, 09:07 Proddy, ***@***.***> wrote:
I've been using the firmware upload monitor a lot and can say it works
flawlessly, a good 1 hour spent!
—
Reply to this email directly, view it on GitHub
<#260 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKE4VHWYDOSPQHU63QHAADURWOF5ANCNFSM5HIUXWYQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi Rick,
Some of the people using my EMS-ESP project get confused with the System/Restart feature where it says 'Device is restarting', the ESP reboots but the web page is not refreshed. It's a trvial thing, but the same happens with uploading firmware where you need to refresh the page when you think it's done.
So I was thinking what's the best way to check for connectivity to the web server and do retry's when it's offline. I would probably use WebSockets but before I embark on this I'm interested in how you would approach it?
The text was updated successfully, but these errors were encountered: