Problems with ADVANCED WiFi config on quite old system / hardware

Hi there,
I have several TP-LINK routers (WR1043ND + MR3220) and ESP8266-based "things".
Now I have following configuration, that works for years reliably (rarely need to power cycle 1043 - once 1-3 months):

  • all routers run Barrier Breaker 14.07,
  • WR1043 acts as central point, configured as AP + WDS, (now same channel on all routers, same as AP in my phone uses), laptop connected over GbE, "things" with WiFi, MR3220 configured as STA + WDS. One of them (acting as bridge to Eth from router providing Internet) also as AP. Routers act as bridges, no routing (except to phone, but this later).
    And this WORKS.
  • now I want to add backup link using my phone "tethering" (AP / router to 3G). So first I tried to simply add STA to the 1043 built in card. "Almost work": "things" (simple clients) works, link to phone works. NOT working WDS links (none of them). Not acceptable.
  • so I tried to add external (trough USB hub) USB WiFi card (works in my laptop with Fedora 24, drivers rt2xxx / rt2800). I CAN configure this, but WiFi on USB does not work. No even ping. Card is recognized as RT5370.

Target is to have still working WDS link between 1043 and 3220's, "things" as clients, backup link (possibly with mwan3 in future) to AP in telephone. Does not matter using only built in card or 2, the other one on USB.

Any ideas?

Laurent

1043's network config file:

config interface 'lan'
        option force_link '1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.2.30'
        option netmask '255.255.255.0'
        option gateway '192.168.2.45'
        option aliases '192.168.1.30/24'
        option dns '194.204.159.1 194.204.152.34'
        option delegate '0'
        option _orig_ifname 'eth0.1'
        option _orig_bridge 'true'
        option ifname 'eth0.1'

config interface 'Android_WiFi'     
        option proto 'static'         
        option ipaddr '192.168.43.30'
        option netmask '255.255.255.0'
        option gateway '192.168.43.1'
        option dns '194.204.159.1 194.204.152.34'
        option delegate '0'

1043's wireless config file:

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/ath9k'
        option htmode 'HT40'
        option txpower '20'
        option country 'PL'
        option hwmode '11g'
        option disabled '0'
        option channel '11'

config wifi-iface
        option encryption 'psk2'
        option device 'radio0'
        option key 'xxxx'
        option disabled '0'
        option wds '1'
        option network 'lan'
        option ssid 'adelin3'
        option mode 'ap'

config wifi-iface
        option ssid 'Android Laurents'
        option encryption 'psk2'
        option device 'radio1'
        option mode 'sta'
        option disabled '0'
        option bssid '42:40:A7:62:2C:9B'
        option key 'xxxx'
        option network 'Android_WiFi'

config wifi-device 'radio1'                
        option type 'mac80211'             
        option channel '11'                
        option hwmode '11g'                
        option path 'platform/ehci-platform/usb1/1-1/1-1.3/1-1.3:1.0'
        option htmode 'HT40'

You realize that 14.07 hasn't been supported for around 5 years by now? It has serious open security issues, both locally and remote; by now it shouldn't be used anywhere, for anything.

Ok, anyway it is behind Internet router NAT. All people in WiFi range are friendly, same with ones having physical access to one of 3220.
What do You suggest (on the same hardware)?
Configuration seems to be correct but USB WiFi simpy does not work, nor works AP + WDS with STA enbled on built-in card.

[edit]
iwlist wlan0 scanning (USB card) simply reports "No scan results", plugged into laptop works correctly (detects 2-3 networks).

The kernel limits network names to 15 characters (in some cases OpenWrt will add a prefix) and it is a lot less confusion to use all lower case. So avoid names like "Android_WiFi."

Definitely upgrade your OpenWrt. The WR1043 has enough memory to run the latest builds. The MR3220 can handle a stripped down install. There has been considerable development of ath9k since 14.

USB tether the phone, it's more reliable than WiFi and will also keep the battery charged.

Most "Things" don't use LAN resources, they call home to somewhere on the Internet. So it's OK to double-NAT them which potentially lets you use a regular AP-STA link to backhaul your sub AP. Really you don't want them to see your LAN. This can be done by firewalling the IOT network.

I think the solution to ESP8266 compatibility is to turn off WMM and fall back to g wireless.

1 Like
  • the long name works OK with Fedora, ALSO with OpenWRT if only I use internal WiFi, but this lets WDS links non-operational. USB card does not report scan results at all.
  • I have to flash version that will leave enough root for: ser2net, madplay, wget, maybe bash (it's ~0.5M alone in BB), I think I don't have to keep Bluetooth, anyremote (my config needs bash), 3G link (USB modem) - is is for 1043, for 3220 I need ser2net in 2 of them, usb-storage + VFAT on one.

Which version should I choose then?
From iw list I realize that only limitation is to use only 1 channel on WiFi per card (now).

  • no option to use cable to phone, MUST be over WiFi.
  • "things" are flashed with Tasmota, no need for"cloud service", but You are right, I plan to configure separate WiFi for them.
  • ESP's works great, no need to change anything.

Your hardware is problematic in multiple ways, below minimum system requirements amounts of RAM (32 MB each), only 4 MB flash in case of the MR3220 and buggy draft-n silicon (AR9103) in case of the tl-wr1043nd v1 (I assume, v2 and up would be better). The oldest supported OpenWrt branch at this moment would be 18.06.x, although one should look forward towards 19.07.x or master at this point (and it doesn't get easier with this below-spec hardware, although if you're willing to use the imagebuilder and sacrifice at least luci and opkg, it should still be possible). Especially WDS/ 4addr have been problematic in the past, so you do want to run a more recent version (for ath9k, it shouldn't be necessary to disable WMM).

For everything else, @mk24 is spot on.

2 Likes

I have spare 1043, so I'll try to flash it with 18.06 You suggest, then look if it can accomodate software modules I must have in (I use it as network radio receiver too).
But any ideas welcome.

Just another idea for 2nd WiFi - (as I need an fast-eth switch, no one port left on 1043, but I really need only 2 GbE connections, rest may be fast-eth) - cost-equal solution is to use another 3220 (used) connected to 1043 over eth. This would give 4 eth ports for one in 1043, WiFi as bonus, then no USB WiFi. Will try.

I didn't realize the 1043 was only 32MB RAM. I've upgraded all my old TP-Link stuff with 64MB chips.

From 1043:

root@Laurent_Home_OpenWrt_1043ND:~# free
             total         used         free       shared      buffers
Mem:         28860        23868         4992            0          896
-/+ buffers:              22972         5888
Swap:            0            0            0

From 3220 (with usb-storage and VFAT):

root@TP_LINK_Krzysiek_OpenWrt:~# free
             total         used         free       shared      buffers
Mem:         28860        27764         1096            0         5184
-/+ buffers:              22580         6280
Swap:            0            0            0

Is it OK?

usb card looks like in error. AP + WDS with STA maybe interface combinaion limited. check driver code of your version.

recommended approach in your case is to root the phone and enable wds there

Tomorrow will try to plug USB card directly into router (now is trough USB 2.0 hub), AFAIR on plugging into hub I've seen messages "full speed device", as far as I know USB it should be "high speed".

As for now I didn't found working root method, this is Sony Xperia M3.

You mean look into driver code for comments?

ieee80211_iface_limit

does router STA establish link to phone? if so maybe you forgot assign interface/firewall zone

Yes, internal card STA connects to phone. BUT then WDS links stops to work. "Simple" clients (in this case ESP8266 still working OK). To the same AP, still configured with WDS.

post logs from both WDS devices

You mean short after reboot?
And in which config:

  • working, 1043 only as AP + WDS, 3220 as STA + WDS,
  • non working, 1043 as AP + WDS + STA, 3220 STA + WDS? (one 3220 I can acces over wire, so can get logs from this one too).
    Should I use dmesg or logread ?

non working, logread

Ok got logs, how can I upload it (here?)? (msg says only image files allowed).

put on pastebin if your limited

Here it is, for 1043: https://pastebin.com/gUbrkkvH
And for 3220: https://pastebin.com/ivCTmqf5

As You can see, there is NO Wifi assoc/auth on 3220, those on 1043 correspond to 3 "things" logging in.

RT5370 USB connects, ping not working now? i thought youre trying with WDS AP + STA combination. but since you already connected with USB card keep trying that way now