Porting guide ar71xx to ath79?

The WAN untagging is intented, any other isn't.

Screenshot_2018-08-14%20OpenWrt%20-%20Switch%20-%20LuCI

Switch config in /etc/config/network
config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'
        option enable_vlan4k '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 4 5t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '5t'

Meh!
uptime is now 2:20, and the LAN4 (on the case) port started working.
OK I can't follow! LAN4 (on the case) doesn't have link, again. :roll_eyes:
What is going on here?

Delete VLAN 2. It is a weird config to have a VLAN without ports.

Actually you can remove all vlans and set eth0 as LAN interface. In this case all ports will work, if they are not broken.

Reverting to default (WAN port to eth0.2) doesn't help. (I was unable to get working setup without VLANs.)

Looks like a hardware failure: reconnecting the UTP cables on the other ports solves the problem.

My PC's UTP cable works only in LAN1-3 + WAN port of the router.
The router's upstream UTP cable works in all port of the router.

:thinking:

@hnyman I just built from master and tested on the WNDR3700 v1. Wireless behaviour:

  • Flash ath79 firmware, reboot
  • Configure wireless, reboot: working wireless
  • Flash a newer ath79 build, sysupgrade keeping settings, reboot: wireless is down
  • Wireless is up after another reboot

Thanks for all the work.

2 Likes

This is expected at this time. The firmware file is extracted too late.
It will be fixed sooner or later.

But that's not a big problem.

On my FritzBox 7312 (lantiq xway) i have the same issue with the owl firmware loader, so this is more or less a normal behavior with this fw loader.

I'm not complaining, don't get me wrong. Just giving feedback (even though it's no new info :grin: ).

Now the firmware is extracted from mtd in userspace and stored in /lib/firmware
This happens after wifi is supposed to start.
On the next reboot the file is still there.

A hacky workaround is to add /lib/firmware/ to /etc/sysupgrade.conf

A normal fix would be to have a wait till the firmware is there, but that's not quite easy to do cleanly.

1 Like

So add your firmware files to /etc/sysupgrade.conf and forget about this sysupgrade trouble.
Also even without that you can always start Wi-Fi by wifi command even after the first boot.

That might actually be a semi-ok personal hack, assuming that the backup is only used for the same router. Naturally, the firmware file names will vary by target & router, so no global setting is possible.

I never meant it as a "commit" anywhere. Only for use on one router.

This patch not work for me.
In this time only working build for wndr3700v2 is from hnyman WNDR3700v2-master-r7817-1961948585-20180810-2059.
Build WNDR3700v2-master-r7847-03e5dcbf10-20180813-2312 and build from @juppin not work - eth1 tx timeout.
BTW In first build from hnyman on switch layout is :
Port 1 Port 2 Port 3 Port 4 Port 5 CPU (eth0) .
But in second build is another:
CPU (eth0) LAN1 LAN2 LAN3 LAN4 LAN5
and in my not working build ( this same error ) is:
CPU (eth0) CPU (eth0) LAN1 LAN2 LAN3 LAN4 LAN5 LAN6 LAN7 LAN8 (SIc!)

Is there a git repo of @hnyman? Maybe he used another patch for devices with wrong u-boot setup.

I built the source of hnynam using his scripts.
He adds these scripts to built images.

@yabba235 Can you build with devmem enabled in kernel config and busybox?
Then we can see what is going on.

No. I build from a pretty clean clone of the main repo. 20180813 did not contain any strange external patches, just the ones for wifi and LEDs that have been merged by now.

Which "wrong u-boot setup"?

The main (relevant) difference between 20180810 and 20180813 builds is the two patches from https://github.com/openwrt/openwrt/pull/1271 that got merged between 10th and 13th. The third patch from that PR never got merged.
(EDIT: the two patches:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=42b3fdf9812f799c07bd30899a2bb2cff7d1a200;hp=4dc7cb792a8e34b6ad97c7b8058c70311a06bd38

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=cf50f720695eb2d9d232a588b5a7f4959ef3fcee;hp=42b3fdf9812f799c07bd30899a2bb2cff7d1a200
)

Other difference is the WNDR3700/3800 series DTS reorganisation, but there was no actual change to the DTS, just a split to a common .dtsi and device-specific .dts files.

The 3rd patch may be needed in case u-boot sets wrong values. That was its goal.
Luckily in our u-boot all was OK.

So @yabba235 if you are 100% sure that you made a clean build, then we need devmem output.
Also I noticed that sysupgrade has bugs and it leaves some file, even with -n and subsequent firstboot. I had this problem today with another device.

So

  1. Make sure all is clean, probably flash with mtd with factory if it's available.
  2. Provide devmem output to see what's the problem.

The scripts make no changes to the binary outcome of the compilation.

Right now all needed patches for WNDR3700 series have been merged (the LEDs a few hours ago), so you should reset the ath79 dir in the source and do a clean rebuild.

EDIT:
But like discussed below, some link speeds need the third patch from PR 1271 in order to work.

1 Like

?????
sysupgrade simply appends the settings .tar.gz file to the image to be flashed unless there is "-n". Sysupgrade itself leaves no files.

What has happened to you, and with which device?

I was trying to test my last PR with MR3040. It has a new /etc/diag.sh.
I made a clean build, made sysupgrade -n and even made firstboot. But I still had the old diag.sh in /rom. The file in the image was the new one.

I could solve it only by writing the image by mtd.

I had this before once or twice with other devices.