Meraki MR-12 Flash new firmware image failed

my current version: OpenWrt Chaos Calmer 15.05

I tried to upgrade the openwrt for my Meraki MR12. i downloaded two files from https://openwrt.org/toh/views/toh_fwdownload/ for the MR12

openwrt-ath79-generic-meraki_mr12-squashfs-sysupgrade.bin
openwrt-22.03.5-ath79-generic-meraki_mr12-squashfs-sysupgrade.bin

when updating in web-plattform (system-backup/flash firmware) i get following error:

The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform.

what did i do wrong? i tried both files.

misunderstood, irrelevant.

means i cant just upgrade the current version from the webplattform?
i have to deal with an upgrade like i have a MR12 with original OS?

sorry,

misunderstood, by upgrade, I thought you meant going from stock to openwrt.

then no, but you can't jump from 15.05 directly to 22.03.
I'd do one version at a time, and reset the settings between the releases.

That’s what I like to hear! Thanks :grinning:
Would a jump from 15.05 to a version 18.** already be too much?

Trial and error I guess, never hurts to test :wink:

openwrt-22.03.5-ath79-generic-meraki_mr12-squashfs-sysupgrade.bin ... this is the current and correct version?

so i should check for openwrt-xx.xx.x-ath79-generic-meraki_mr12-squashfs-sysupgrade.bin?
do you know where to find older versions?

It was ar71xx before the platform was migrated to ath79.

thanks for your help! i updated to the version 19.07.9.
then i tried the next version which is 21.02.0.
but this time i get the following message ...

Device mr12 not supported by this image Supported devices: meraki,mr12 mr12 - Image version mismatch: image 2.0, device 1.0. Please wipe config during upgrade (force required) or reinstall. Reason: Partitions differ from ar71xx version of MR12. Image format is incompatible. To use sysupgrade, you must change /lib/update/common.sh::get_image to prepend 128K zeroes to this image, and change the bootcmd in u-boot to "bootm 0xbf0a0000". After that, you can use "sysupgrade -F -n". Make sure you do not keep your old config, as ethernet setup is not compatible either. For more details, see the OpenWrt Wiki: https://openwrt.org/toh/meraki/MR12, or the commit message of the MR12 ath79 port on git.openwrt.org. Invalid image type. Image check failed.

The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform.

although this is the correct version. what is happening here? can i proceed?

this part of the process is described in detail on the MR16 page, you need to make some changes by hand, before you can continue.

i am not a specialist, so before i going deep into this matter, i just wanted to ask you, do i need a serial cable and/or opening the MR-12 again like with the first installation?

Only if you f-k it up ... ,)

ok good to know. then i really need to read the MR-16 installation guide. :crazy_face:

Migrating from ar71xx to ath79 with no serial connection (from OpenWrt v. <= 19 to OpenWrt v. >= 20)
Migrating directly from ar71xx has not been thoroughly tested, but one method has been used a couple of times with good success, migrating 18.06.2 to a full image produced as of this commit. Please note that these instructions are only for experienced users, and/or those still able to open their device up to flash it via the serial headers should anything go wrong.

  1. Install kmod-mtd-rw and uboot-envtools

  2. Run insmod mtd-rw.ko i_want_a_brick=1

  3. Modify /etc/fw_env.config to point to the u-boot-env partition. See the uboot.config for more details. The file /etc/fw_env.config should contain:

    # MTD device   env offset  env size    sector size
    /dev/mtd1      0x00000     0x10000     0x10000
    
  4. Run fw_printenv to verify that you can read the U-Boot environment correctly, as per the link above.

  5. Run fw_setenv bootcmd bootm 0xbf0a0000 to set a new boot address.

  6. Manually modify /lib/upgrade/common.sh's get_image function, from ...

    cat "$from" 2>/dev/null | $cmd
    

... to ...

   (
     dd if=/dev/zero bs=1 count=$((0x66)) ; # Pad the first 102 bytes
     echo -ne '\x00\x18\x0a\x12\x34\x56'  ; # Add in MAC address
     dd if=/dev/zero bs=1 count=$((0x20000-0x66-0x6)) ; # Pad the rest
     cat "$from" 2>/dev/null ; # Push the firmware
   ) | $cmd

During the upgrade process, this will pad the image by 128K of zeroes-plus-MAC-address, in order for the ar71xx's firmware partition -- which starts at 0xbf080000 -- to be instead aligned with the ath79 firmware partition, which starts 128K later at 0xbf0a0000.

  1. Copy the sysupgrade image into /tmp, as above

  2. Run sysupgrade -F /tmp/.bin, then wait

just in case i am completely on the wrong track. but this is the guide you mean. right?

Create it, the expected content is after you've pasted it.

oh ok thanks. didnt know that. i thought it will be created after the installation of the envtools!

just to double check with you. i hope you dont mind bugging you again.

i manually modified the common.sh to change the get_image function. now the get_image function looks like this ...

get_image() { # <source> [ <command> ]
	local from="$1"
	local cmd="$2"

	if [ -z "$cmd" ]; then
		local magic="$(dd if="$from" bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
		case "$magic" in
			1f8b) cmd="zcat";;
			425a) cmd="bzcat";;
			*) cmd="cat";;
		esac
	fi

       (
         dd if=/dev/zero bs=1 count=$((0x66)) ; # Pad the first 102 bytes
         echo -ne '\x00\x18\x0a\x12\x34\x56'  ; # Add in MAC address
         dd if=/dev/zero bs=1 count=$((0x20000-0x66-0x6)) ; # Pad the rest
         cat "$from" 2>/dev/null ; # Push the firmware
       ) | $cmd
}

thats what i supposed to do right?

you marked it as solved, so I guess it was correct ... ? :wink:

yes it was correct and the upgrade worked like a charm! thanks for your help!

1 Like

now i need to perform a hardware reset, so i get this last firmware without configuration settings. how to do that? or lets rephrase the question, if i make a hardware reset, do i still have the last clean firmware on it? or does it go back to the first firmware i installed?

it'll just reset the fw settings, won't roll back.