Flash bin file from ssh

Hi. I made my proper bin file (with image builder). Now, I only can access to my router via ssh, don't have LUCI because the router is full space (TP-Link MR3020, it has only 4 MB). Well, How to load my bin file (on PC) from terminal (ssh)?

https://openwrt.org/docs/guide-user/installation/sysupgrade.cli
You can either use scp to upload firmware from your PC, or wget to download it directly from the server.

Thanks @vgaetera for link.

Now I explain the process that I used for created a customize bin with the possibility of increase a storage for the router:

  • Compile OpenWrt for TL-MR3020 on your PC:

    • Download the imagebuilder for your specific router, for this model here.

    • Extract the archive.

    • Go into the folder and open terminal there and run: make image PROFILE=TLMR3020 PACKAGES="blkid block-mount kmod-fs-ext4 kmod-usb2 kmod-usb-uhci kmod-usb-ohci kmod-usb-storage kmod-lib-crc32c"

    • Then a new folder called bin appears, there is this file: openwrt-15.05.1-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin. This is the file that you need for flash you router.

  • Finally you can flash via web interface or via ssh. This the way for do it via ssh:

    • Go to the bin folder and run: scp YOUR-CUSTUMIZE-BIN.bin root@192.168.1.1:/tmp

    • Log to router via ssh: ssh root@192.168.1.1 and run: sysupgrade -v /tmp/*.bin

    • ... and voilà!

2 Likes

AFAIK you do not ever reboot or turn off the router manually during the sysupgrade, the sysupgrade should reboot the router when it's done flashing new image.

3 Likes

Thanks for info, I've edited original post.

Can you post tje exact command to SCP the firmware from my computer to the /top folder? I have tried using wget to download from google drive and it never works

Thanks so much

BTW, the folder is /tmp

1 Like

If you are on Windows, you could just use WinSCP https://winscp.net/eng/index.php. It will open a two-pane window, looking very much like FTP clients, where in the left pane you just select the file you want to copy, and in the right pane you choose the folder to upload to.

If you are using Windows, you can use a combination of putty and pscp; like this :
https://openwrt.org/docs/guide-user/installation/backup#via_the_command_prompt_for_windows_users
to upload the file and then follow the usual sysupgrade procedure.

Thank you so much

Please don't double post.
Question answered in WDR4300 can’t get rid of openwrt