Port to TP-Link RE200

They are contained in the GPL source provided by TP-Link. It took me some time to locate them in the source, for the RE200 they are in ralink/linux/kernels/linux-2.6.36.x/drivers/char/tp_mt7620_gpio.h. Some are also contained in the U-Boot source, for me at ralink/boot/u-boot/include/gpio_led.h.
The only two LEDs I couldn't figure out are the 5GHz strength indicators, because they point to a register address that I can't make sense of.

Btw, for the RE200v1, there is now a PR at https://github.com/openwrt/openwrt/pull/2632.

1 Like

I used a bruteforce kind of approach, defined all gpios as leds first and then used a script to turn them on, noting down the gpio while that was running. I found all LEDs by doing that, so now I will configure my device and use it as access point for some time to see if it runs stable.

1 Like

How did you define all as GPIO? Since I'm missing two LEDs, I might try the same.

Are your LEDs completely different?

1 Like

I looked at the datasheet and then defined the ones that are not spi in the pinmux as gpio and then defined them all as LEDs in the dts.

For me they are gpio0.4 and gpio0.5 aswell as gpio1.7-11. Also what works great if you can get out the PCB (desolder the AC Connector): Use a multimeter to find the pin on the CPU, then look in the datasheet to find the register. I tried that first (without desoldering) but it was difficult to get between PCB and enclosure.

1 Like

Thanks - unfortunately, I still can't find the 5G WiFi LEDs. I assume they are somehow connected to the MT7610E and not the SoC.

1 Like

You could also try to follow the traces on the PCB, sometimes that's helpful to at least figure out to what IC they are connected.

1 Like

In the meantime, I found a way to upgrade to OpenWrt via the web interface, so no need for serial console! However, I doubt the build system can generate such an image since the upgrade needs to contain the original U-Boot.
In case somebody wants to try it on the RE200v3 or another device, there are my steps:
WARNING: Since this procedure overwrites U-Boot, you might brick your device!

dd if=re200v1_eu_3_14_2_up_boot\(160329\).bin of=uboot.bin bs=1 count=131584
cat uboot.bin openwrt-ramips-mt7620-tplink_re200-v1-squashfs-factory.bin > stock_upgrade.bin

Then, I used mktplinkfw -i stock_upgrade.bin and found out that the Header MD5Sum1 doesn't match. Luckily, the tool also reports the correct MD5 Sum, so I used a hex editor to update the MD5 sum. The web interface happily upgraded to OpenWrt afterwards.

While I'm certain that there is a tool to fix the header MD5 Sum, these steps worked for me.

@Flole: I updated the Wiki page as well and added some preliminary info for the v3 device at https://openwrt.org/toh/tp-link/re200. Maybe you can add your information as well?

1 Like

Hi andyboeh, I want to install my v1 using web interface. Can you explain more detail about the process? I'm not a developer just normal user don't serial tool.

I'm afraid, at the moment, I can't give you more detailed instructions: You have to build OpenWrt yourself anyway, thus you have all the tools at hand. Once there is an official build, more detailed instructions might follow.
Plus, it's still very experimental, so be prepared to have to use serial anyway!

1 Like

@andyboeh I noticed that my 5Ghz Wifi is only offering me 12dB Transmit Power, apparently this was a known bug before that should be fixed by now. Do you see the same thing? The range of my 5Ghz Wifi is very limited, a lot more than other 5Ghz Access Points I have. Would be great if you could check that so I know if its a configuration thing in my dts or if there is something wrong in the driver itself.

1 Like

FYI

Snapshot support has been added with https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=a3010a7f8dbe04972efef16ed7d81b5fd72e9a94

OpenWrt snapshot images are available for download at http://downloads.openwrt.org/snapshots/targets/ramips/mt7620/

iw list reports 12.0 dBm as max transmit power on the 5GHz WiFi, but 20.0 dBm on the 2.4GHz WiFi.

1 Like

Same here, I looked at the mediatek,mtd-eeprom part on the flash, at the documentation on them and at the driver and it seems like this is what is limiting the transmit power. Either the driver is not interpreting those values correctly or the values specified are wrong and tplink somehow overrides them.

1 Like

Finally, I tested the 5GHz WiFi range: It seems normal to me, i.e. it passes through two thick walls, similar to the 2GHz WiFi.

1 Like

Does anyone know how I use mktplinkfw -i? I really wanted to use TP-Link on the RE200, but I am a layman in the use of these tools.

I don't really understand your question: You just run mktplinkfw -i your_firmware.bin!?

Now that the device is supported in "snapshot", we should really have a tool to create a stock-flashable firmware. Does anybody know whether it is OK to post a firmware with the U-Boot binary from an original TP-Link firmware upgrade?

1 Like

You need to check the license of U-Boot, it's licensed under the GPL if I remember correctly so you should be able to redistribute, modify and share it as you wish. However, I'm not a lawyer.

1 Like

I think the question is more, How do I install mktplinkfw so I can then run that command in terminal? And if that's not LaercioCordeiro's question, that is my question.

Appreciate the help.

Ah, OK: It's part of OpenWrt's build system, so you need to set up the development environment. I understand pretty well that this is not very convenient, so I'll try to come up with a more convenient solution - maybe a GUI tool that allows to generate such an image.

1 Like

Not ready for tool-less user install. Should be fixed either with mktplinkfw binary for x86_64 linux, either with a suitable transition firmware for both EU and US regions like for similar tp-link devices on mt7620 either with some updated version of such tool.
Till there is no way to be installed without opening the device this should not be present in snapshots.