Jump to content

Recommended Posts

Posted

As other people have noted, there are issues trying to connect the CB1 to wifi after the first boot. I believe I've narrowed down the cause, but I'm not sure about the right way to fix it permanently.

The issue I was experiencing is as follows:
1. Flash latest armbian minimal to sd card

2. Plug into CB1 and turn it on

3. Go through first boot setup and connect to wifi normally

4. Reboot CB1

5. CB1 no longer connects to wifi, wpa_cli says 'CTRL_EVENT_SCAN_FAILED'

 

A temporary solution I found is to mask systemd-networkd, then manually unmask systemd-networkd and start it after booting. This suggests that the problem is that systemd-networkd tries to talk to the RTL8189 before it's ready, and that puts the chip into a bad state. The wireless connection works on the first boot, because the CB1 doesn't try to configure the chip until after it has booted up.

If I only mask netplan-wpa-wlan0 (instead of masking networkd) and try to manually bring it up, then I get an empty scan result, rather than CTRL_EVENT_SCAN_FAILED.

 

Is there a way to make systemd-networkd wait until after the driver has loaded before trying to configure the chip? The easiest temporary solution is probably to just add a delay before systemd-networkd starts.

 

Posted

For anyone interested in solving this temporarily, doing the following steps worked for me:

sudo systemctl edit systemd-networkd


### Editing /etc/systemd/system/systemd-networkd.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file

 

[Service]
ExecStartPre=/bin/sleep 5

 

### Lines below this comment will be discarded

 

sudo systemctl daemon-reexec

sudo reboot

Posted

Hello,
I was experiencing the same problem, and both of these workarounds did not work for me.
However!
Even though I am quite inexperienced when it comes to these kinds of problems, I managed to get it working reliably again with the help of my favourite LLM-slop-machine.
Made the file: /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
ctrl_interface=/run/wpa_supplicant
update_config=1

network={
  ssid="YourSSID"
  psk="YourPassword"
  key_mgmt=WPA-PSK
}

ran these commands:
sudo systemctl enable wpa_supplicant@wlan0.service
sudo systemctl restart wpa_supplicant@wlan0.service
sudo systemctl restart systemd-networkd

then this one:
sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant-wlan0.conf -D nl80211 -d
got this error from that: nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
then these commands:
sudo systemctl stop wpa_supplicant@wlan0.service
sudo systemctl stop wpa_supplicant.service
sudo pkill -9 wpa_supplicant || true
sudo rm -f /run/wpa_supplicant/* 

then started the service again and watching logs:
sudo systemctl start wpa_supplicant@wlan0.service
sudo journalctl -u wpa_supplicant@wlan0 -f
From there i saw "wlan0: Associated with" and "wlan0: WPA: Key negotiation completed"
however when running
ip addr show wlan0
It only showed me 2 lines and no IP. Checked that I was connected to the correct access point with:
iw dev wlan0 link
I installed dhcpcd5 to assign an IP.
sudo apt install dhcpcd5
assigning IP and checking if it was assigned:
sudo dhcpcd wlan0
ip addr show wlan0

Then also after restarting everything worked well for me.
From the wpa error, it looks like there were 2 instances? I am not sure.
I would love to hear someone elses opinion on this, since I am not 100% sure what exactly I did, but it worked. 
I hope this helps someone!

Posted (edited)

Couple of data points that may be helpful.

Platform: BTT PI v1.2 D/C 2023.11.8 with the U2C CAN board
Distro: Armbian 25.8.1 Bookworm
Kernel: 6.12.43-current-sunxi64
Overlays: spidev0_0

1. Adding a sleep 5 hack did not work for me, however what does *seem* to work is inserting the following line to /etc/netplan/30-wifis-dhcp.yaml

activation-mode: manual

WiFi was still activated (which may be another bug) for at least 3 cold boots in a row (didn't have time to test more thoroughly). Here's a pastebin link from right after one such boot - https://paste.armbian.com/umijapukiy


 

2. The error from wpa_supplicant is 

CTRL-EVENT-SCAN-FAILED ret=-1 retry=1

.Same error code (-1) is also reported when attempting a manual scan

pi@jubilee:~$ sudo iw wlan1 scan
command failed: Operation not permitted (-1)



3. Broken state of the WiFi driver seems to be correlated with mmc errors in dmesg

[   11.490708] sunxi-mmc 4021000.mmc: data error, sending stop command
[   11.490745] sunxi-mmc 4021000.mmc: send stop command failed
[   11.490856] sunxi-mmc 4021000.mmc: data error, sending stop command
[   11.490880] sunxi-mmc 4021000.mmc: send stop command failed
[   11.491071] sunxi-mmc 4021000.mmc: data error, sending stop command
[   11.491098] sunxi-mmc 4021000.mmc: send stop command failed
[   11.491224] sunxi-mmc 4021000.mmc: data error, sending stop command
[   11.491248] sunxi-mmc 4021000.mmc: send stop command failed


These are not present if wifi was activated successfully.

Here's a pastebin link from right after such boot - https://paste.armbian.com/xovixuniti

EDIT: Ran armbianmonitor -c overnight and the SD card seems fine
 

The results from testing /dev/mmcblk0p2 (ext4):
Data OK: 111.37 GB (233561400 sectors)                                                                      
Data LOST: 0.00 Byte (0 sectors)
Average writing speed: 18.41 MB/s
Average reading speed: 22.74 MB/s 
...
Health summary: OK



3. Reloading the kernel driver (8189fs) when it is already in a broken state is very slow and provokes a slew of mmc errors
 

$ sudo /sbin/rmmod 8189fs
pi@jubilee:~$ time sudo /sbin/modprobe 8189fs

real    2m15.835s
user    0m0.008s
sys     0m0.048s
$ dmesg

....
[  673.262192] sunxi-mmc 4021000.mmc: data error, sending stop command
[  673.262286] sunxi-mmc 4021000.mmc: data error, sending stop command
[  673.262379] sunxi-mmc 4021000.mmc: data error, sending stop command
[  673.262471] sunxi-mmc 4021000.mmc: data error, sending stop command
[  673.262563] sunxi-mmc 4021000.mmc: data error, sending stop command
[  673.262656] sunxi-mmc 4021000.mmc: data error, sending stop command
[  673.262716] ====>_BlockWrite 101 i:0
[  673.262742] ====>_WriteFW 230
[  673.263001] sunxi-mmc 4021000.mmc: data error, sending stop command
[  673.263088] sunxi-mmc 4021000.mmc: data error, sending stop command
[  673.263141] ====>_BlockWrite 101 i:0
[  673.263162] ====>_WriteFW 230


Again the same problem is not present if WiFi was activated successfully after boot: Shutting down the interface and reloading the driver works just fine.

Please let me know if there's anything else I can collect that can help to track this down. Given this is a fresh install and has no personal data in it yet, I can share my SD card image if that would be helpful.
 

Edited by anttix

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines