Adding OpenWrt support for Mercusys AC12G

Hi. I got myself under 30$ new router (mercusys ac12g original firmware https://www.mercusys.com/en/download/ac12g#Firmware and product details page https://www.mercusys.com/en/product/details/ac12g ) and i do not see it under https://openwrt.org/supported_devices section.
Mediatek MT7620DA - main chipset
Realtek RTL8367S - LAN\WAN
Mediatek MT7612EN - AC WIFI

I have few question :
1 Will it be supported it near future ?
2 Can i install general firmware based on the same chipset or firmware from similar device ?
3 Can i somehow help/assist (maybe betta testing or something ) to release a new firmware for it ?

Support for this board depends on the people in the community like you who have physical access to it. This is the place to ask for help to do so.

the first step is to look at commits for similar hardware and get familiar with what is required to add support for a board.

How much RAM/FLASH it have?

Where can I learn more about and help with the project?
I own one of these and I find it very good, but the firmware is too limited.

I needed OpenVPN support and if it is possible, that I could log in the ISP via PPoE before connecting to VPN via OpenVPN on the same router

hi @Alastor welcome

there is documentation for adding new devices, but I find most of it limited.

for me, the best way to learn was studying commits for other boards that are similar

you would be creating your own DTS file, and editing the other files similarly to these commits. You should be able to collect enough information to build an initramfs image (in ramips, you must select in make menuconfig Target Images --> ramdisk)

documentation for creating your own images is good


You would need a UART serial adapter and to identify the pins on the board with a multimeter or other means, and solder pins to the board if they are missing

using the serial connection, you load the initramfs image using the commands of the bootloader, if it is uboot the commands are tftpboot and bootm

the kernel log tells you anything that goes wrong so you can fix it in your commit

The TP link has the same processor and switch
the Alfa has the same processor and wifi chip

Hoi! Thanks for the reply;
The router has a page where you can upload and auto-update the firmware via the router, so you can download firmware versions from the website and update it from there.
Could this be used to update the router, or should I really open it and connect to it via Serial port to update it?

By the way, I tried using binwalk on the firmware image and was able to extract data from it, there are lots of images, HTML, CSS and Javascript code, and some binary stuff as well; Does it happen with adding a new router?

you must test firmware images that you make several times before you "update it"

you don't want to overwrite the original firmware until you're sure it will work, otherwise you might be stuck with a broken device. Bootloaders usually have a feature to load an image into RAM with TFTP and boot from there without overwriting anything, the command line for the bootloader is only accessible over the serial port.

Figuring out how to make a factory.bin for the original firmware upgrade webpage is one of the last steps.

There is no need to explore the contents of the original web interface, but sometimes the original firmware has scripts that are used for updating, which can help you understand the requirements for the factory.bin you eventually make...

but usually there is a unique header in the beginning of the image

if the bootloader is u-boot, having the contents of printenv command helps as well

Okay, got it, so only the first people that get to make the firmware need serial access to it, so they can test before updating, right?

I know how to deal with electronics, but my soldering skills are pretty bad, I'm kinda uneasy about opening the router and soldering some stuff on it, but I think I can do it if I'm certain that I'm not going to break it.

About the serial port, on the photo provided on the first post, I can see 4 holes without any components on the board, I think those might be the serial port, right?

I think the bootloader really is u-boot as I saw it when using binwalk; How do I go about getting the contents of printenv command?

Yes the 4 empty holes in a row is the serial console pinout. One of the holes is 3.3 Volts power which you will not be using (power the board normally with the AC adapter).

also the UART to USB adapter you use must be "3.3 Volts TTL logic level". (almost all of them are, but good to make sure)

printenv is a command for u-boot, which you do in serial console after stopping the boot

if the pin holes are empty (no solder in them yet) it should be very easy to solder pins. If you do not have pins you can do wires. heres a good video

https://www.youtube.com/watch?v=AqvHogekDI4

I have some wires with pins builtin from an Arduino kit I have, I think it should do!

The UART to USB adapter I presume I'll have to buy, right?

Yeah you have to get a USB to UART adapter, here are some good ones

also if you need a wet sponge to clean the iron between uses (dont use a nice one, it will get damaged in the process)

This device have only 2M of flash... its too little for openwrt.

wow really?

@Alastor what is the flash chip model?

chip model 25Q16CS16 SERIAL FLASH MEMORY

I am planning to change it for 16MB (it costs less then 1$) and then upgrade to OWRT.

I recommend finding a way to copy the entire flash before you remove anything from the board

you will need an SPI programmer for this, I use FT232H with python scripts

I have an CH341A SPI programmer and few others and i know how to handle it. So it is not a problem.

I haven't opened my router, so I can't confirm this, but by looking online at this chip, it's apparently a 16MB chip, not an 2MB one

GigaDevice GD25Q16C is a 16Mbit spi-nor flash chip. 16 Mbit = 2 MByte