Debugging Librem 5 Birch Wi-Fi Issues

I am opening this up to help debug the Wifi Issues I am having.

In a nutshell, my librem 5 is not transmitting enough power to have a stable internet connection. I have to be within 5 feet of my WiFi AP for a stable connection. Being 20 feet with a wall in between the Librem 5 and the WiFi AP does not allow it to have enough Tx Power.

I am not inclined to think it is an antenna issue right now, as at the distances I am talking, I have had success with a wifi adaptor connecting to my WiFi AP without any antenna.

purism@librem5:~$ sudo iw dev wlan0 info
Interface wlan0
ifindex 4
wdev 0x1
addr 88:da:1a:XX:XX:XX
ssid My WiFi Network
type managed
wiphy 0
channel 36 (5180 MHz), width: 40 MHz, center1: 5190 MHz
txpower 20.00 dBm
purism@librem5:~$ sudo iw dev wlan0 get power_save
Power save: off

I have a feeling that the wifi card is going into Power Save mode even when I explicitly am asking it not to.

Some more debug info, this is it authenticating with my WiFI AP.

[ 586.813239] wlan0: deauthenticating from 44:d9:e7:XX:XX:XX by local choice (Reason: 3=DEAUTH_LEAVING)
[ 586.813876] redpine_91x: rsi_mac80211_set_key: RSI del key
[ 586.813887] redpine_91x: rsi_hal_key_config: Cipher 0x0 key_type: 2 key_len: 0
[ 586.814623] redpine_91x: rsi_mac80211_set_key: RSI del key
[ 586.814632] redpine_91x: rsi_hal_key_config: Cipher 0x0 key_type: 2 key_len: 0
[ 586.829629] redpine_91x: ===> Interface DOWN <===
[ 586.836108] redpine_91x: ===> Interface UP <===
[ 586.880746] <=====Sending PS Disable request ======>
[ 586.880757] <===== Mimic-UAPSD Power Save ====>
[ 586.880770] ps-request: (length = 42)
[ 586.880776] 1a c0 05 00 00 00 00 00 00 00 00 00 02 00 00 00
[ 586.880810] 00 01 01 00 00 00 00 00 00 00 00 00 01 00 1e 00
[ 586.880860] 00 00 00 00 01 00 00 00 00 00
[ 586.899385] <=====Sending PS Disable request ======>
[ 586.899396] <===== Mimic-UAPSD Power Save ====>
[ 586.899410] ps-request: (length = 42)
[ 586.899416] 1a c0 05 00 00 00 00 00 00 00 00 00 02 00 00 00
[ 586.899449] 00 01 01 00 00 00 00 00 00 00 00 00 01 00 1e 00
[ 586.899482] 00 00 00 00 01 00 00 00 00 00
[ 586.900554] redpine_91x: ===> Interface DOWN <===
[ 586.902953] redpine_91x: ===> Interface UP <===
[ 587.017289] <=====Sending PS Disable request ======>
[ 587.017299] <===== Mimic-UAPSD Power Save ====>
[ 587.017312] ps-request: (length = 42)
[ 587.017318] 1a c0 05 00 00 00 00 00 00 00 00 00 02 00 00 00
[ 587.017352] 00 01 01 00 00 00 00 00 00 00 00 00 01 00 1e 00
[ 587.017385] 00 00 00 00 01 00 00 00 00 00
[ 599.165043] <=====Sending PS Disable request ======>
[ 599.165053] <===== Mimic-UAPSD Power Save ====>
[ 599.165065] ps-request: (length = 42)
[ 599.165071] 1a c0 05 00 00 00 00 00 00 00 00 00 02 00 00 00
[ 599.165113] 00 01 01 00 00 00 00 00 00 00 00 00 01 00 1e 00
[ 599.165146] 00 00 00 00 01 00 00 00 00 00
[ 599.169482] wlan0: authenticate with 44:d9:e7:XX:XX:XX
[ 599.169939] wlan0: send auth to 44:d9:e7:XX:XX:XX (try 1/3)
[ 599.178231] wlan0: authenticated
[ 599.181078] wlan0: associate with 44:d9:e7:XX:XX:XX (try 1/3)
[ 599.185740] wlan0: RX AssocResp from 44:d9:e7:XX:XX:XX (capab=0x411 status=0 aid=1)
[ 599.186868] wlan0: associated
[ 599.192463] redpine_91x: rsi_hal_key_config: Cipher 0xfac04 key_type: 1 key_len: 16
[ 599.192486] redpine_91x: rsi_mac80211_set_key: RSI set_key
[ 599.192726] redpine_91x: EAPOL 4 confirm
[ 599.193291] redpine_91x: rsi_hal_key_config: Cipher 0xfac04 key_type: 2 key_len: 16
[ 599.193311] redpine_91x: rsi_mac80211_set_key: RSI set_key
[ 599.193632] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 599.494849] redpine_91x: 36
[ 599.494854] redpine_91x: 40
[ 599.494882] redpine_91x: 44
[ 599.494887] redpine_91x: 48
[ 599.494892] redpine_91x: 52
[ 599.494897] redpine_91x: 56
[ 599.494902] redpine_91x: 60
[ 599.494907] redpine_91x: 64
[ 599.494912] redpine_91x: 100
[ 599.494917] redpine_91x: 104
[ 599.494923] redpine_91x: 108
[ 599.494927] redpine_91x: 112
[ 599.494932] redpine_91x: 116
[ 599.494937] redpine_91x: 120
[ 599.494942] redpine_91x: 124
[ 599.494947] redpine_91x: 128
[ 599.494952] redpine_91x: 132
[ 599.494957] redpine_91x: 136
[ 599.494962] redpine_91x: 140
[ 599.494983] redpine_91x: 149
[ 599.494988] redpine_91x: 153
[ 599.494993] redpine_91x: 157
[ 599.494998] redpine_91x: 161
[ 599.495003] redpine_91x: 165

In the same room, my UniFi says it is at -72dB, and when I go to another room, it is at -92 dB. For reference, my Pixel in another room is at -59 dB.

Internal antenna is still antenna (printed on pcb) but poorly routed antenna may just make it worth. So I would not discard this option.
What makes you think it’s PM issue? Is there any time when signal is good and then it drops significantly (indicating device may go sleeping too soon)?

I am doubtful it is an antenna issue due to the distances we are talking about (5-10 feet) (unless the antenna was damaged, but even then I don’t think that’s the issue). I have had decent reception on a different wifi card without any antenna.

Plus, 1/4 wavelengh for a 2.4 GHz antenna is ~1.25 inches, so it’s pretty hard to mess up an antenna at those frequencies.

When I was talking on the matrix chat, some folks said that they got good reception, but that power saving would interfere with it. My UniFi controller is also saying it goes in and out of power saving mode.

Can you try running powertop and see what does it say about wireless device powerstate?

it says

Bad Wireless Power Saving for interface wlan0

aka, wlan0 does nothave powersaving on

It also has this for the SDIO

100.0% Radio device: RSI-SDIO WLAN

So perhaps it isn’t a powersvaing issue. I am stumped in that case.

Here are some pictures.I don’t see any damage to the antenna or the cable.

I am curious as to wat the third u.FL port is for. Possibly Zigbee? I downloaded the datasheet and that wasn’t of help to figure out what the ports are for.

I think the 3rd u.FL port is the not used / disabled GPS antenna Connector for the redpine wlan chip.
AFAIK the real useful datasheet user guide is locked behind an NDA, at least the last time i checked, and then everything still depends on the actual firmware running on the redpine chip.
If you’ve got an UniFi Controller can you check if it connects to the 2.4 GHz or den 5 GHz Network?
Because 5GHz Range drops of way faster than 2.4GHz.

Ahh, that’s why that datasheet wasn’t so good.

It’s on 2.4 unless I’m really close to the AP (like 3 feet away), then it goes to 5 GHz. It defaults to 2.4 otherwise.