Skip to content
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

Feature: "Sideloading" firmware upgrade files #335

Closed
r1de opened this issue Apr 20, 2022 · 7 comments
Closed

Feature: "Sideloading" firmware upgrade files #335

r1de opened this issue Apr 20, 2022 · 7 comments

Comments

@r1de
Copy link
Contributor

r1de commented Apr 20, 2022

HTTP uploading is not good on marginal networks, any little hiccup and the firmware file that is uploaded to the node is incomplete, yet the node does not know this until it is too late and has already shut down various services in order to save RAM to perform the upgrade. (services like ssh and telnet, olsr, almost everything)
This is probably why sometimes it takes several tries to upgrade, the more hops away the device you are trying to upgrade, the more prone it is to this problem, in my experience.

This can make the node completely inaccessible until a powercycle. Which may or may not require a "trip to the hill" and can sometimes not be a feasible solution.

One way around this, is to allow another way to upload the firmware file, that can handle network stalls and can resume the transfer.
SSH/SCP can do this and is already included on each and every AREDN device.

I have old patch files, pre Lua, that added this feature for our local custom firmware, with a simple button that was only active if a certain file was present. (it is basically @dman776's old code, kept alive 😄 )
I can add the patch files here, if, just in case, anyone wants to use them to port it to Lua. 😉
(I have been trying to port it and not getting much luck, I am rusty)

@r1de r1de changed the title Feature: "Sideloading" firmware files Feature: "Sideloading" firmware upgrade files Apr 20, 2022
@aanon4
Copy link
Contributor

aanon4 commented Apr 20, 2022

I realize this approach is not for everyone, but for people interested, this is how I manage my "fleet" of test nodes using Ansible, an open source configuration tool. I wrote up a simple example (for Linux folk):

https://github.com/kn6plv/ansible4aredn/tree/master/examples/firmware-update#readme

@r1de
Copy link
Contributor Author

r1de commented Apr 21, 2022

Ansible is quite the tool and perfect for this, but I still think it should be an option "on device".
Not everyone wants to run a "centralized admin system" on their network.

It's really just the "resiliency" of SCP that I'm after. On our, sometimes marginal, networks it can make or break if an upgrade is successful or not.
Some tiny FTP server could serve the same purpose and not use encryption (I know some are still against that).
Any protocol that can resume a transfer after a timeout or "stall" would be better than http uploading.

@r1de
Copy link
Contributor Author

r1de commented May 6, 2022

never mind... closing this.
🤷‍♂️

@r1de r1de closed this as completed May 6, 2022
@aanon4
Copy link
Contributor

aanon4 commented May 6, 2022

@r1de did someone say there was an old Perl patch for this? Send it over if you have it and I’ll take a look.

@r1de
Copy link
Contributor Author

r1de commented May 7, 2022

@aanon4 All this patch does is check if the firmware file has been uploaded, then it enables the button.
The button then just fires off the upgrade in the "standard" way.
since the "Save Settings" box is checked by default, the "sideload" button always saves the settings.
(at least that's how I was doing it before, feel free to come up with your own solution.)
(also, in the patch, I "flipped the bit" for having tunnels installed, in our use case we had to do that, I'm not sure if that is really needed during a firmware upgrade done in this "sideload" way though)

WXC-CUSTOM-adminPage.patch.txt

@ab7pa
Copy link
Contributor

ab7pa commented May 8, 2022

Seems like the most reliable and efficient answer would be to use rsync. I'm just not sure if we can afford the space on each node in order to include the rsync/rsyncd packages.

@r1de
Copy link
Contributor Author

r1de commented May 8, 2022

ssh is already, always included on each and every aredn device.
no need for anything extra.

Closing this since PR #358 got merged already.

Thanks @aanon4 👍

@r1de r1de closed this as completed May 8, 2022
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

No branches or pull requests

3 participants