Automated Batch Flashing of Devices

Is there an automated way to flash multiple routers at the same time from stock to LEDE f/w?

For instance, one thought is:

  • Connect LAN port to a server with multiple Ethernet ports
  • Server uses a curl-based script to login to 192.168.x.1, navigate to the upgrade page and flash the firmware
  • Server gets a new DHCP address and verifies that the device has been flashed by curl on the new router page.

Any thoughts?
Has anyone done this in the past?

1 Like

I use this script to add in trunk modules:

opkg update

opkg install nano wget htop luci openssh-sftp-server kmod-sched-cake usbutils
opkg install luci-app-sqm luci-app-upnp luci-app-adblock luci-app-ddns ddns-scripts_no-ip_com
opkg install kmod-usb-net-rtl8152 kmod-usb-net-rtl8150
opkg install kmod-rtlwifi-usb kmod-rt73-usb kmod-rt2800-lib kmod-rt2500-usb 
opkg install kmod-mac80211 kmod-ath9k-htc

opkg install lsblk vsftpd-tls luci-app-hd-idle block-mount kmod-mmc mmc-utils luci-app-clamav bsdtar bzip2 usbutils
opkg install kmod-fs-ext4 kmod-fs-ntfs kmod-fs-vfat kmod-usb-storage kmod-usb-storage-extras fdisk e2fsprogs ntfs-3g-low dosfstools
opkg install luci-app-transmission luci-app-aria2 
opkg install kmod-mt76x2 kmod-mt7603

Depending on the number involved, the OEM firmware support of tftp or the like, and if manual activation of tftp is required, that may be an option.

I have very, very vague memories of old TP-Link devices trying tftp firmware updates on every boot. There was some kind of magic packet that you could see on the wire, then initiate a tftp "push" to the device. They should require some manual intervention to initiate that these days, but given how "secure" their devices are, it wouldn't surprise me if they still do it.

I would recommend the tftp mode. Typically there are 2 modes:

  1. Push mode - you push the image to the device.
  2. Pull mode - the device itself requests an image with a special naming.

What of those is supported depends on the preinstalled bootloder on the device.

The supported tftp mode is in general enabled by long pressing the reset button to say the bootloader to get into tftp mode.

I wont go with curl-based script for login, navigating and so on. Some manufacturer change the design with different firmware versions and then your script is broken.
With tftp mode you also dont have to care if its a preused device where the old owner forgot to remove his password. It "just" in very few seconds (dont have to wait till OEM firmware booted up).