.bin file is not compiling

Hi everyone

I am new to OpenWrt.

I have a Tp-Link TL-WR841N (V14) router. It is a 4/32 device.

Unfortunately the TL-WR841N (V14) just missed the cutoff when OpenWrt stopped producing builds for these 4/32 devices. I read I can still compile firmware for it myself, so that's what I want to do.

I'm having trouble compiling the firmware and hope someone can assist me.

I have installed building dependencies and I have been using this build system usage guide for compiling:

The problem I have is that after compiling, I can't find the .bin firmware.

I initially compiled OpenWrt v19.07.9, and I read that not being able to find a binary can be because of the binary exceeding 4MB, so I also tried compiling v18.06.9 but to no avail.

I will explain each step I did with v19.07.9.

I executed:

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git pull
git branch -a
git tag
git checkout v19.07.9
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig

In OpenWrt Configuration via 'make menuconfig', I changed the following:

Target System: MediaTek Ralink MIPS
Subtarget: MT76x8 based boards
Target Profile: MediaTek MT7628 EVB
Base system: '* wireless-tools'
Network: wireless ---> '* aircrack-ng' '* airmon-ng'

I then executed:

make download
make

Lots of packages compiled and then the last operation was a checksum. I then went into in '/openwrt/bin/' to fetch the firmware but it wasn't in there. All that was in there were two directories, 'packages' and 'targets'.

Can somebody please tell me what has gone wrong?

  1. 19.07.x will go EOL this month, so not a good idea to work on that
  2. start with your attempts for a device (of the same target) with more flash, so you have an easier introduction into getting stuff working (no need to actually test it on real hardware, just to see the success and approximate size at the end of your compilation).
  3. once you have that working (for the wrong device), switch over to your actual target and check how far overweight your images are. At this point you're on your own to strip it down even further, 4 MB is a real problem and not easy to build for anymore (especially in master)

Thanks for the information slh.

I will try your step 2 if my currently building v17.01.0 fails. I am testing what I imagine is the smallest possible version that is available in the git branch.

OpenWrt's website states that v19.07 is the last version to work on a 4/32 device. Given the only two packages I included on top of the default settings are aircrack-ng and airmon-ng, I don't feel that they are breaking the camels back, but now that I think about it, there is a decent chance I am wrong as I image v19.07.9 is pushed to the limit. But note I did try compiling v18.06.9 which I think is smaller, and that didn't work either. That's why I'm wondering if the problem is something that I am not doing.

I can't do your suggested step 3 because no image (.bin) is being generated, so I can't see how overweight it is.

You can stop right there.

You are mistaken, with 19.07.x we're talking about 64-196 KB more or less (and even 17.01.x had roughly 320 KB free space at the very best, less on most devices) that make or break it - aircrack-ng and airmon-ng however add well over 2.5 MB (just a rough calculation, I might have missed indirect dependencies bumping the actual space requirements even further) to the tally…

There is a reason why these low-end devices are no longer supported. It has gotten very hard (to downright impossible) to get a basic firmware (worth talking about) working within those constraints - even without huge beasts like aircrack.

Right, yes. Thank you. I didn't realise they were that size.

airmon-ng I have already got rid of as I realised I don't even need it as I can bring up and put down networks with wireless-tools (a package I did not mention is in addition to the default settings).

I have noticed there are a lot of packages I don't need so if v17.01.0 fails then I will try v17.01.0 again and strip it.

Yeah I know v17.01.0 is ancient but I don't care. The router will never be connected to any network other than my PC and it won't have access to the internet.

airmon-ng alone isn't much better, while I didn't calculate the space requirements separately, I stopped counting after over 400 KB.

It's dead, Jim. When you're riding a dead horse, the best strategy is to get off - and get decent hardware.

Its best to buy a Ferrari, but things are not always possible. :slight_smile:

Quite decent devices meeting- and surpassing minimum system requirements start between 5-10 EUR/ USD on the used markets. With the first brandnew ones starting just under 20 EUR/ USD delivered to your doorstep.

Life is hard when your government makes it illegal for you to work because you don't want the covid vaccine.

you have to change ram and rom Tp-Link TL-WR841N (V14) to fit in openwrt 19 and 21. but a better solution is you have to buy a router that has high ram rom and cpu

Thanks andysyam

Can anyone confirm if I am actually using the right steps in the guide to build a firmware image?

Yes, your build sequence is correct.

Thanks RuralRoots

Why does compiling refuse to create a binary image if it exceeds 4Mb? The only reason I thought of was to prevent bricking a device, but then I thought devices would refuse to flash if the firmware was too big.

I am wondering because the previous hardware version of my modem is a 8/64 device with the same chipset as my one, so someone with that device would not be able to compile OpenWrt over 4MB despite their device being a 8/64 device.

It would be nice if there was a parameter to continue compiling regardless of size.

Did you look into the "target" folder and its sub-folders?

No I didn't. The guide says the firmware image would be in 'openwrt/bin/'.

I must have misread, it actually says:

After a successful build, the freshly built image(s) can be found below the newly created <buildroot>/bin directory. The compiled files are additionally classified by the target platform and subtarget, so e.g. a generic firmware built for an ar71xx device will be located in <buildroot>/bin/targets/ar71xx/generic directory (and the package files are below <buildroot>/bin/packages/mips_24kc).

The guide is poorly written. It doesn't say which file is the firmware image so I don't know what to look for. I assumed its a .bin file. What file should I be looking for?

You should be looking for a ".bin" files, but the exact name of the folder depends on your architecture. Browse a bit around there.

Thanks. You are a big help. I saw a MIPS target directory earlier but I couldn't see a .bin file. I'm in the middle compiling v19.07.9 with the configuration bellow. Hopefully it is bellow 4MB and I can find the .bin file. I'll report what happens.

Target System: MediaTek Ralink MIPS
Subtarget: MT76x8 based boards
Target Profile: Default Profile

Packages added:

Base system > *'wireless-tools'
Network > wireless > *'aircrack-ng'
Network > wireless > *'Optimize for speed'
Utilities > Editors > *'nano'

1 Like