Porting to ENS200EXT

I have an ENS200EXT device that I'd like to get OpenWRT running on. It's pushing the limits today as it's a 8/32 device, but I'm only wanting to use it as an access point.

I noticed that someone had already done most of the legwork of porting the ENS200 to LEDE, but the commits weren't included because of the LEDE/OpenWRT switch (see here). I'm working on building this against master currently. My questions are as follows:

The factory partition for the kernel is 1024KB. Once I get OpenWRT installed does that limitation still apply, or can I resize the partitions? I show kernel/rootfs are immediately after each other in the MTD layout: mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom)ro,1024k(kernel),4928k(rootfs),1536k(failsafe)ro,64k(art)ro,5952k@0xa0000(firmware). Can I siphon off 1024KB from the rootfs for the kernel? Factory uBoot should be able to boot from tftp, so I can probably get something booted that way.

Does anyone know if the ENS200 and ENS200EXT have any appreciable differences besides the external antenna? I'm assuming they don't. Worst case I guess I can just restore back the factory firmware if need be.

Answered my 2nd question... I decompiled the factory firmware version 1.5.3 for both the ENS200 and ENS200EXT and literally the only difference I could find in the kernel is the compile date (Thu Dec 12 15:27:43 CST 2013 for the ENS200 versus Thu Dec 12 15:35:07 CST 2013 for the ENS200EXT) and the board value in the kernel boot arguments

console=ttyS0,115200 root=31:04 rootfstype=squashfs init=/etc/preinit mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),320k(custom),1024k(kernel),4928k(rootfs),1536k(failsafe),64k(ART) board=ENS200

versus

console=ttyS0,115200 root=31:04 rootfstype=squashfs init=/etc/preinit mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),320k(custom),1024k(kernel),4928k(rootfs),1536k(failsafe),64k(ART) board=ENS200EXT

I'll close this thread out in case someone else searches Google for ENS200EXT and OpenWRT and stumbles upon this page looking for an answer.

Using the code that Marty had done for the ENS200 I was able to get 18.06.1 ported to my ENS200EXT. I had to make a few tweaks to get the code to compile/images to build, but nothing major. The biggest hurdle was getting it actually on my device as well as getting it in a semi-stable state given the low RAM.

I used a serial console (pinout is same as the ENS202EXT, though fortunately on my ENS200EXT the header was actually populated with pins and I could just use jumper wires) to get into uBoot and do a tftpboot. I had to name the image 0101A8C0.img in my TFTP location but otherwise the tftpboot command followed by the bootm command was all it took. I set the IP as static on my tftp server of 192.168.1.101 and the tftpboot command pulled the image with a minimum of fuss. The image you feed to uBoot is an uimage+initramfs.bin, which is distinct from the factory image (useless since you can't fit a functioning kernel in 1024KB anymore) or the sysupgrade image.

Since the code Marty had put together was for an ENS200 I first had problems, then I realized it's because my uBoot environment had the kernel command of board=ENS200EXT and the code was expecting ENS200. I could have figured out the right way to do things, but instead I just find/replaced every instance of ENS200 with ENS200EXT in the code. As a result my image works on the ENS200EXT and not the ENS200. Note that these devices are completely identical from a software perspective, except for the uboot kernel command.

Once I had things running the hardest part was getting it to work with 32MB of RAM. The first image+initramfs had so little RAM left over I couldn't flash the sysupgrade image (had about 1MB of RAM free with 10MB of ZRAM). So I recompiled with things as stripped down as I could (removed kernel symbols and library symbols not needed, removed IPv6, killed all the mach files for ar71xx except for mine), and my current image has about 7MB free with 12MB of ZRAM free at idle.

For the sake of anyone who might benefit, I've posted the kernel+initramfs plus sysupgrade image. The code from the first comment works as well, though you'll need to tweak a few superficial things to get it to work. You can lie about the kernel size requirement in the factory image, since you won't use the factory image anyway. I hate to say I don't see any real benefit of attempting to upstream this though; the device is old, difficult to get onto OpenWRT, and has so little RAM it's almost not worth the hassle of supporting (I would think).

1 Like

Hi,

I picked up an ENS200 to add it to openwrt, very similar to others I have added already

would you like to test images for ENS200EXT?

Hi @mpratt14,

Sorry to resurrect this thread.

Did you manage to make much progress with OpenWRT for the ENS200 you picked up a while ago ? This device is identical to the ENS200EXT discussed in this thread.

I do have this device myself so would like to make it work with the latest (or a more recent version than the ancient 15.05.1 which I have working now) version of OpenWRT if possible.

It's a 32MB/8MB device but as long as we can get it to work on ath79 rather than ar71xx which is now no longer used then it should be still functional and a shame to throw it away if it's not too much work to get this supported.

We can also work together on this if you have an outline of what big steps need to be done; I did some small OpenWRT modifications then compiled those in the past but always keen to learn more.

Many thanks for any updates you might have !