This is far from a complete step-by-step instruction. It's more intended as a guideline to point you in the right direction:

You will need:

  1. An old Ethernet router the cheaper the better. It needs to have
    1. A USB port (or, in my case, some pads you can solder a USB port to.
    2. To be able to run OpenWRT and have a bit of flash left to install some more software
  2. A USB AVR programmer:
    1. USBASP
    2. A "true" in system programmer (davedarko)
    3. Arduino Nano ISP (Devin McElheran)
    4. ATtiny45 USBtinyISP (Stefan Wagner)
    5. ATtiny programmer using Arduino ISP
    6. ... etc.

What to do:

This all depends on what router you have chosen. Your mileage WILL vary.

  1. Get OpenWRT installed on your old router
  2. Get it's USB port working
    opkg update
    opkg install usbutils
    opkg install kmod-usb-serial-cp210x

    or:

    opkg install kmod-usb-serial-ch341
  3. Hook it up to your lab network
  4. Install avrdude - the version of OpenWRT that I used just had a pre-compiled avrdude in it repository, which was very handy... I'm not sure if this will be the case for you.
    opkg update
    opkg install avrdude

Software:

Initially I had the idea of creating a custom server from Lua. And implementing either a multiplexerer or a USB hub with custom identifiers on several USB-serial adaptors  to select the various different programming options.

But as I spent more more time debugging my programmer than working on my actual projects this became paired down to a simple script running on my laptop and not the router itself.

All the device selection is done with hardware jumpers because I'm going to need to be touching the hardware to insert the device to be programmed anyway.

Avrnude connection script

For details of the connection script see: https://gitlab.com/-/snippets/2009682

(aside - multiple USB-serial adaptors)

The stuff I worked on for using a USB hub and multiple USB-serial adaptors might be interesting , so I'm leaving it here for reference. 

I used CP2102 USB serial bridges and used cp210x-cfg to give each a unique "serial number" and set up the following udev rules:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="stk500v1", KERNEL=="ttyUSB*", SYMLINK+="stk500v1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="pic32prog", KERNEL=="ttyUSB*", SYMLINK+="pic32prog"

/etc/hotplug.d/usb/99-programmers

[ "${PRODUCT}" = "1a86/7523/263" ] && {
    DEV_NAME=$( ls /sys/${DEVPATH} | grep tty )
    [ ! -z "${DEV_NAME}" ] && [ "${ACTION}" = "add" ] && ln -s /dev/${DEV_NAME} /dev/ttyAVR
    [ "${ACTION}" = "remove" ] && rm /dev/ttyAVR
}

[ "${PRODUCT}" = "10c4/ea60/100" ] && {
    # it looks like serial num and dev name are available
    # at 2 different passes of this file ... it's complicated
    DEV_NAME=$( ls /sys/${DEVPATH} | grep tty )
    [ ! -z "${DEV_NAME}" ] && {
        # SERIAL_NUM=$(cat /sys/${DEVPATH}/serial)
        # echo "/sys/${DEVPATH}" >/dev/kmsg
        # [ "${SERIAL_NUM}" = "monitor" ] &&
        [ "${ACTION}" = "add" ] && ln -s /dev/${DEV_NAME} /dev/ttyMonitor
    }
    [ "${ACTION}" = "remove" ] && rm /dev/ttyMonitor
}

or controlled the multiplexers from "re-cycled" indicator LEDS on the router.

# Gives about 3.3 volts on unpopulated WPS LED
echo 1 > /sys/class/leds/F@ST2704N\:green\:wps/brightness

Back to the final implementation

I power the hub itself from a 12V line from an old PC power supply... and my programmers draw their power from a 5V line from this same power supply. They share a common ground but I didn't want to overtax the router by drawing the programmers' power from it's USB port through the USB-serial converter.

The AVR programmer uses the Arduino ISP sketch.

When I has a PIC32 programmer, it used pic32prog and Pinguino's Cheap DIY PIC32 Programmer. I created a package for my version of OpenWRT for pic32prog here: https://gitlab.com/edgeeffect/openwrt-pic32prog.

At the moment, I've only got AVR programmers but I also want to implement a serial programmer for STM32 "Blue pill" and "Black...

Read more »