Adding OpenWrt support for Extreme Network AP3805i

Hi. Despite compiling the image and following all the steps, I was not successful. I don't know where I went wrong. Can the friends who run it please share the files. thanks..

hy and welcome!

https://drive.google.com/file/d/1e7kLaK1dWnCCJCh8TuVOgFB2yGyrBG3g/view?usp=sharing
here are my files (image is with LUCI)
they work fine with my 3 devices.

maybe can you share your console output here, maybe I or someone else can have a look.

1 Like

Thanks. I tried it on 3 devices and it worked on all of them.

2 Likes

Hy,
I compiled the stable branch 21.02 for ap3805
https://drive.google.com/file/d/1ePAX6CvSPFkW0wfaq4HRhEPVtaJ-kWxM/view?usp=sharing
Everyone who wants to add packages with opkg can try it!
Worked on one of my devices without problems

1 Like

Hi,

following this commit I was able to put OpenWRT on an AP3805i via tftp by opening the device and using buspirate. (Because for some reason with two different JTAG cables I got garbled output from bootloader and just from the point where the kernel is loaded I could read clearly the output.)

Regardless, I have a bunch of those APs and would like to get OpenWRT on them without opening every single one of them and having to deal with JTAG. On the original firmware there is ssh access open and it is possible to run the fw_printenv/fw_setenv tool (which I took from the AP3805i OpenWRT image).

Only issue I am facing here is that this tool requires /etc/fw_env.config file which has just one line containing the mtd device, a device offset and the sector size. Most likely the mtd device is /dev/mtd1 and from the boot log I was able to get the sector size which seems to be 0x40000 - but I do not know how to find out the device offset. Looking at the partition info at bootup I thought it is 0x80000 but this seems to be wrong.
So at the moment my fw_env.config looks like:
/dev/mtd1 0x80000 0x40000

I already tried different offsets and every time trying to get the u-boot env with fw_printenv to validate it is working (before continuing to fw_setenv), I get the message "Bad CRC" or "Environment does not start on (erase) block boundary".

Could anybody help and tell how the fw_env.config should look like to get the actual u-boot environment with fw_printenv?

Thank you and kind regards!

1 Like

unlikely that the sector size is 0x40000

first look at cat /proc/mtd
it clearly shows the size and "erasesize" (sector size) for each mtd device

offset is simply where it starts in the partition, for the vast majority it will be 0 but it looks like in your case there is not a separate partition for the environment and youre actually looking at the uboot partition

you first have to be able to dump the entire mtd and look for something you can read

hexdump -C /dev/mtd1
output is
offset 0-7 8-15 ascii

environment starts at the beginning of a sector, it starts with a crc hash
but you can search for a string

example:

# fw_printenv
baudrate=115200
...
...
...
# hexdump -C /dev/mtd1 | grep baudrate
00000000  20 27 da 7f 62 61 75 64  72 61 74 65 3d 31 31 35  | '..baudrate=115|

in my case, the CRC is 20 27 da 7f

by the way, if the uboot environment is actually part of the uboot partition, be very careful and back up the entire flash

btw in openwrt, format of /etc/fw_env.config is
device offset size erasesize

my example:
/dev/mtd1 0x0 0x10000 0x10000

however if you took the binary from OEM firmware, who knows...

I recommend building a new image with ubootenv tools after figuring this out

we are still talking about the AP3805i right?
from the stock firmware (tested on two AP3805i devices, both same output):

AP3805i# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00040000 "BootBAK"
mtd1: 00080000 00040000 "BootPRI"
mtd2: 00040000 00040000 "CFG1"
mtd3: 00040000 00040000 "CFG2"
mtd4: 00040000 00040000 "NVRAM4"
mtd5: 00040000 00040000 "NVRAM3"
mtd6: 00040000 00040000 "NVRAM2"
mtd7: 00040000 00040000 "NVRAM1"
mtd8: 01000000 00040000 "PriImg"
mtd9: 01000000 00040000 "SecImg"
mtd10: 01cc0000 00040000 "FS"
AP3805i# hexdump -C /dev/mtd1 | grep baudrate
0002ba60  62 61 75 64 72 61 74 65  00 00 00 00 44 52 41 4d  |baudrate....DRAM|

So, do I understand correctly that fw_env.config should look like this?
/dev/mtd1 0x0002ba60 0x40000

running fw_printenv says:
Environment does not start on (erase) block boundary

is this example from an AP3805i ? I tried that and fw_printenv says:
Warning: Bad CRC, using default environment

On one AP3805i I installed OpenWRT according to this "howto" using the image from here and running OpenWRT the fw_printenv results are same.

sorry I should have been more specific

yes, my example was another device...I don't have this board otherwise I would just give the answer directly :laughing:

however, we should not really care what the stock firmware says about the erasesize, we are building for openwrt (new linux) so the config that uboot-env has to use is with the erasesize that the mtd driver is using on whatever version of linux we want to build for, not the stock firmware (old linux)

over the years the spi-nor code has changed a lot, and flags and features get added, for example, when its discovered that the flash chip supports smaller sectors, that gets implemented if it wasnt already. Furthermore, some targets in openwrt enable small sectors and some do not (see the kernel symbol CONFIG_MTD_SPI_NOR_USE_4K_SECTORS in some subtarget configs and not in others)

instead of guessing (and using stock firmware output is the same as guessing in this case), the best way to see this is to boot openwrt (if possible, over TFTP with an initramfs image) and just run cat /proc/mtd

fw_env.config should contain:

# Configuration file for fw_(printenv/saveenv) utility.
# Up to two entries are valid, in this case the redundant
# environment sector is assumed present.
# Notice, that the "Number of sectors" is ignored on NOR.

# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
/dev/mtd2		0x00000		0x10000		0x40000
/dev/mtd3		0x00000		0x10000		0x40000

See also:

https://github.com/openwrt/openwrt/pull/3762 was merged in August last year and made it in to the 22.03 release https://firmware-selector.openwrt.org/?version=22.03.5&target=ath79%2Fgeneric&id=extreme-networks_ws-ap3805i

Dear team,

i have 4x 3805i, so can you explain me how to install openWRT firmware, i have USB TTL module, but i can not find which pins can using for access.

Best Regards

hy
please see the instructions on the commit comment
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=f8c87aa2d27ab405f284dd4357377ab5c893a345

Hi @saxy there is no link with image files and there is no info which pins can use for UART.

Best Regards

Pin layout is as follows with 3.3V being the pin with an arrow pointing at it.
3.3V - GND - TX - RX

and what about firmware link?

BR

hy,
ap3805 is in openwrt master
so you can download it directly

https://downloads.openwrt.org/releases/22.03.5/targets/ath79/generic/openwrt-22.03.5-ath79-generic-extreme-networks_ws-ap3805i-initramfs-kernel.bin
https://downloads.openwrt.org/releases/22.03.5/targets/ath79/generic/openwrt-22.03.5-ath79-generic-extreme-networks_ws-ap3805i-squashfs-sysupgrade.bin

how to setup TFTP server, i using tftpd64 but without success. Thank you for support

hy,
i think you are still in u-boot environment when you try to run sysupgrade command
this command needs to be run, when you bootet openwrt initramfs
after you run run ramboot_openwrt (tftp server needed)
openwrt has to be started