[SOLVED] upgrade firmware from cli

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page 1, 2  Next
Author Message
fox95
DD-WRT Novice


Joined: 08 Aug 2022
Posts: 35

PostPosted: Sun Aug 14, 2022 23:04    Post subject: [SOLVED] upgrade firmware from cli Reply with quote
is it ok to do an upgrade through ssh with this method?

1. scp netgear-r8500-webflash.bin root@192.168.1.1:
2. write netgear-r8500-webflash.bin linux &
3. reboot
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Sun Aug 14, 2022 23:59    Post subject: Reply with quote
Using scp, you transfer the file from your desktop like so:
Code:
scp netgear-r8500-webflash.bin root@192.168.1.1:/tmp/netgear-r8500-webflash.bin

Then login via ssh/telnet and do:
Code:
write netgear-r8500-webflash.bin linux &

wait 5-10 minutes, then:
Code:
reboot

The ampersand (&) is not required, but is a safety measure as the write process may kick you off in some builds.
The easiest way to flash an upgrade, provided all goes well is to:
Code:
scp netgear-r8500-webflash.bin root@192.168.1.1:/tmp/firmware.bin

That lets the automated check process check for that file and automatically flash it.

https://wiki.dd-wrt.com/wiki/index.php/Scp_command

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
fox95
DD-WRT Novice


Joined: 08 Aug 2022
Posts: 35

PostPosted: Mon Aug 15, 2022 0:19    Post subject: Reply with quote
kernel-panic69 wrote:
Using scp, you transfer the file from your desktop like so:
Code:
scp netgear-r8500-webflash.bin root@192.168.1.1:/tmp/netgear-r8500-webflash.bin

Then login via ssh/telnet and do:
Code:
write netgear-r8500-webflash.bin linux &

wait 5-10 minutes, then:
Code:
reboot

The ampersand (&) is not required, but is a safety measure as the write process may kick you off in some builds.
The easiest way to flash an upgrade, provided all goes well is to:
Code:
scp netgear-r8500-webflash.bin root@192.168.1.1:/tmp/firmware.bin

That lets the automated check process check for that file and automatically flash it.

https://wiki.dd-wrt.com/wiki/index.php/Scp_command



out of curiosity could i eliminate the scp command above by doing these steps below?

1. cd /tmp
2. wget https://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2022/08-13-2022-r49681/netgear-r8500/netgear-r8500-webflash.bin
3. write netgear-r8500-webflash.bin linux &
4. reboot (after waiting 5 min)
strange
DD-WRT User


Joined: 18 Jun 2006
Posts: 229

PostPosted: Mon Aug 15, 2022 0:53    Post subject: Reply with quote
You mean like what it says on all of the new build pages?

"CLI Flash: 'cd /tmp' then 'wget {file URL}' (http only) or 'curl -O {file URL}' (http, https, ftp). 'write {file} linux' then 'reboot'."

_________________
Netgear XR500 - Gateway
R6700 v3 - Station Bridge
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Mon Aug 15, 2022 1:35    Post subject: Reply with quote
fox95 wrote:
out of curiosity could i eliminate the scp command above by doing these steps below?

1. cd /tmp
2. wget https://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2022/08-13-2022-r49681/netgear-r8500/netgear-r8500-webflash.bin
3. write netgear-r8500-webflash.bin linux &
4. reboot (after waiting 5 min)

What does the Installation Wiki say?

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
fox95
DD-WRT Novice


Joined: 08 Aug 2022
Posts: 35

PostPosted: Mon Aug 15, 2022 5:08    Post subject: Reply with quote
kernel-panic69 wrote:
fox95 wrote:
out of curiosity could i eliminate the scp command above by doing these steps below?

1. cd /tmp
2. wget https://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2022/08-13-2022-r49681/netgear-r8500/netgear-r8500-webflash.bin
3. write netgear-r8500-webflash.bin linux &
4. reboot (after waiting 5 min)

What does the Installation Wiki say?


i get it, i get it... just making sure. I have zero experience networking and linux. only what i poke around with on my own. a lot of what i read on cmd's may be easy for the experienced user, but not for all of us. just don't want to break the installation because of a inexperienced cmd thrown at it.
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5660

PostPosted: Mon Aug 15, 2022 6:35    Post subject: Reply with quote
CLI Flash: 'cd /tmp' then 'wget {file URL}' (http only) or 'curl -O {file URL}' (http, https, ftp). 'write {file} linux' then 'reboot'.

wget lost ftp support so use http without s, or use curl. Broadcom SoC based Hardware -> New Build - 08/15/2022 - r49741
If the build you are flashing from is r47381 or older it should have wget ftp support but as well get used to another method.

Another neat trick is after download to /tmp rename the file to firmware.bin and simply wait for automatic flash and reboot.
You may have to rename the file first before moving it to /tmp. Anyway, I do not use this method but it should be available.
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6407
Location: UK, London, just across the river..

PostPosted: Mon Aug 15, 2022 8:52    Post subject: Reply with quote
blkt wrote:
CLI Flash: 'cd /tmp' then 'wget {file URL}' (http only) or 'curl -O {file URL}' (http, https, ftp). 'write {file} linux' then 'reboot'.

wget lost ftp support so use http without s, or use curl. Broadcom SoC based Hardware -> New Build - 08/15/2022 - r49741
If the build you are flashing from is r47381 or older it should have wget ftp support but as well get used to another method.

Another neat trick is after download to /tmp rename the file to firmware.bin and simply wait for automatic flash and reboot.
You may have to rename the file first before moving it to /tmp. Anyway, I do not use this method but it should be available.


there is a small detail to write command.....& at the end

write dd-wrt-webupgrade.bin linux &

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55460 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55460 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2028

PostPosted: Mon Aug 15, 2022 12:45    Post subject: Reply with quote
Depending whether your hardware has curl you can make it even easier.

Code:
cd /tmp
curl -o firmware.bin https://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2022/08-13-2022-r49681/netgear-r8500/netgear-r8500-webflash.bin


Go fix a sandwich while your router upgrades.

_________________
Forum Guide Lines (with helpful pointers about how to research your router, where and what firmware to download, where and how to post and many other helpful tips!)
How to get help the right way

Before asking for help - Read the forum guidelines AND Upgrade DD-WRT!
Adblock by eibgrad + Blocklist Collection
strange
DD-WRT User


Joined: 18 Jun 2006
Posts: 229

PostPosted: Mon Aug 15, 2022 22:15    Post subject: Reply with quote
blkt wrote:
CLI Flash: 'cd /tmp' then 'wget {file URL}' (http only) or 'curl -O {file URL}' (http, https, ftp). 'write {file} linux' then 'reboot'.

wget lost ftp support so use http without s, or use curl. Broadcom SoC based Hardware -> New Build - 08/15/2022 - r49741
If the build you are flashing from is r47381 or older it should have wget ftp support but as well get used to another method.

Another neat trick is after download to /tmp rename the file to firmware.bin and simply wait for automatic flash and reboot.
You may have to rename the file first before moving it to /tmp. Anyway, I do not use this method but it should be available.


I have done this a couple of times already on both of my routers and everything has worked fine. What is the importance of adding the & after 'write'? Also, what about the 5 minute wait? It is not part of the WIKI. And then there is the '-O '. Does it matter if it goes before or after the web address? I've seen it both ways. So far, I've just used the way that @blkt has in his post and it has worked fine for me.

_________________
Netgear XR500 - Gateway
R6700 v3 - Station Bridge
fox95
DD-WRT Novice


Joined: 08 Aug 2022
Posts: 35

PostPosted: Mon Aug 15, 2022 23:54    Post subject: Reply with quote
strange wrote:
blkt wrote:
CLI Flash: 'cd /tmp' then 'wget {file URL}' (http only) or 'curl -O {file URL}' (http, https, ftp). 'write {file} linux' then 'reboot'.

wget lost ftp support so use http without s, or use curl. Broadcom SoC based Hardware -> New Build - 08/15/2022 - r49741
If the build you are flashing from is r47381 or older it should have wget ftp support but as well get used to another method.

Another neat trick is after download to /tmp rename the file to firmware.bin and simply wait for automatic flash and reboot.
You may have to rename the file first before moving it to /tmp. Anyway, I do not use this method but it should be available.


I have done this a couple of times already on both of my routers and everything has worked fine. What is the importance of adding the & after 'write'? Also, what about the 5 minute wait? It is not part of the WIKI. And then there is the '-O '. Does it matter if it goes before or after the web address? I've seen it both ways. So far, I've just used the way that @blkt has in his post and it has worked fine for me.


This was what i found on -O

O, --remote-name Specify that the local file should have the name of the remote file that was downloaded.

Example:
curl -O https://example.com/filename


I just did a upgrade with wget ftp to the /tmp folder and didnt use the -O and everything seems to be fine.
strange
DD-WRT User


Joined: 18 Jun 2006
Posts: 229

PostPosted: Tue Aug 16, 2022 0:02    Post subject: Reply with quote
Cool. Thank you
_________________
Netgear XR500 - Gateway
R6700 v3 - Station Bridge
fox95
DD-WRT Novice


Joined: 08 Aug 2022
Posts: 35

PostPosted: Tue Aug 16, 2022 0:21    Post subject: Reply with quote
strange wrote:
Cool. Thank you


My exact steps:

Used Putty to ssh to router.

cd /tmp
wget http://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2022/08-03-2022-r49626/netgear-r8500/netgear-R8500-webflash.bin
write netgear-r8500-webflash.bin linux &
reboot


Note: the https:// download link will not work with wget

This is the link to the ftp files:

http://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2022/08-03-2022-r49626/
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Tue Aug 16, 2022 0:24    Post subject: Reply with quote
strange wrote:
What is the importance of adding the & after 'write'?

The & at the end of the full command, ensures the command is ran even if terminal is closed, its the short explanation, but other ways of achieving same can include using screen
strange wrote:
Also, what about the 5 minute wait? It is not part of the WIKI.

The wiki is outdated if you have not yet noticed that nugget of golden sunshine, some slower end devices may take a long ass time to flash and complete said flash, so the arbitrary 5 minutes is a precaution to prevent those of us who are so inpatient that may end up interrupting the process and bricking the device.
strange wrote:
And then there is the '-O '. Does it matter if it goes before or after the web address?
You should read man wget same for man curl. man stands for man-ual i.e. RTFM, you can google any command manual like that, full blow distros you just type man <command> on terminal and it will show you that info, DD-WRT doesn't include man pages to keep FW small..

These are also called man pages, because that old saying, a real man doesn't read manuals, so a play on words, since the Linux folk do have a sense of humus.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Tue Aug 16, 2022 0:57    Post subject: Reply with quote
kernel-panic69 wrote:
The ampersand (&) is not required, but is a safety measure as the write process may kick you off in some builds.

Or, as was stated above, "ensures the command is ran even if terminal is closed".

bushant wrote:
Depending whether your hardware has curl you can make it even easier.

Code:
cd /tmp
curl -o firmware.bin https://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2022/08-13-2022-r49681/netgear-r8500/netgear-r8500-webflash.bin


Go fix a sandwich while your router upgrades.

You can do the same with wget:

Code:
cd /tmp
wget -O firmware.bin http://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2022/08-13-2022-r49681/netgear-r8500/netgear-r8500-webflash.bin

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum