Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi 4/5 Wifi driver / Access Point #7253

Open
oxoocoffee opened this issue Oct 19, 2024 · 11 comments
Open

Raspberry Pi 4/5 Wifi driver / Access Point #7253

oxoocoffee opened this issue Oct 19, 2024 · 11 comments

Comments

@oxoocoffee
Copy link

Creating a bug report/issue

  • [ x] I have searched the existing open and closed issues

Required Information

  • DietPi version | G_DIETPI_VERSION_CORE=9 G_DIETPI_VERSION_SUB=8 G_DIETPI_VERSION_RC=0 G_GITBRANCH='master' G_GITOWNER='MichaIng'
  • Distro version | bookworm 0
  • Kernel version | Linux dietpi-ai 6.6.51+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux
  • SBC model | RPi 5 Model B (aarch64)
  • Power supply used | (5V 27W adapter)
  • SD card used | (SanDisk ultra)

Additional Information (if applicable)

  • Software title | (ieee80211 driver)
  • Was the software title installed freshly or updated/migrated? 3 months ago
  • Can this issue be replicated on a fresh installation of DietPi? Not sure
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

  1. ... Enable Wifi in diet-configure
  2. ... Install and configure Access Point using hostapd and dnsmasq

Expected behaviour

  • ...

Actual behaviour

  • After booting I see messages popping outing console. (run level 3) with out login in or after.

Extra details

  • I was not able to
    dietpi-wifi
@MichaIng
Copy link
Owner

Thanks for reporting. I'll try to replicate.

How did you configure hostapd. Since you installed dnsmasq, I guess you did not install the WiFi Hotspot option via dietpi-software, right?

@oxoocoffee
Copy link
Author

I did installed it using dietpi-software, I I remembered something failed during installation. I do not remember what since I had to do something else soon after. When I did comeback to it I fixed it manually. What specific information you looking for?

@oxoocoffee
Copy link
Author

Any updates of this issue? Any additional information I can provide?

@Joulinar
Copy link
Collaborator

I have performed a test installation on my demo RPi5 without any issues. During the installation there is an error message about the failed start of the isc-dhcp-server service.

[FAILED] DietPi-Software | systemctl start isc-dhcp-server

But this is to be expected and isc-dhcp-server works after the reboot. There are no kernel error messages in dmesg and my mobile phone connects to the DietPi hotspot without any problems.

@MichaIng
Copy link
Owner

When I did comeback to it I fixed it manually. What specific information you looking for?

How did you fix it? Which exact settings did you change, in case?

@oxoocoffee
Copy link
Author

I will try to setup a AP on clean installation in about 2-3 days when I have access back to rpi5. I will capture all steps I took and see if I can reproduce it again. If I stumble into an error, I will post the details here.

@oxoocoffee
Copy link
Author

oxoocoffee commented Nov 25, 2024

While I was first trying to find a working WiFi dongle to get wlan0 and not needing enabling internatl WiFI, which is in metal case, I am using the using in this issue #7290.

Edimax Wi-Fi 4 802.11n Adapter for PC N150 Nano USB Adapter

  • I created a fresh image using latest v9.8.0 image for rPI 4.

  • No pre initial boot config file modification

  • During first boot, took all defaults and nothing was changed except host name in /etc/hostname and /etc/hosts

  • After initial setup was completed as as root use, I created a new user test account runner

  • Added runner to following groups: dialout, sudo, users, tcpdump, wireshark to /etc/groups, then rebooted

  • Logged in to runner account and checked for wlan0 using above USB dongle

    $ ifconfig -a
    wlan0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
         ether xx:xx:xx:xx:xx:xx  txqueuelen 1000  (Ethernet)
         RX packets 0  bytes 0 (0.0 B)
         RX errors 0  dropped 0  overruns 0  frame 0
         TX packets 0  bytes 0 (0.0 B)
         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  • Next is sudo dietpi-config

  • Option 7 and 8 left unmodified.

     Ethernet     : Available | [On] | Connected
     WiFi         : Available | [Off] | Disconnected
     Onboard WiFi : [Off]
     ●─ Additional Options ───────────●
     IPv6         : [On]
     Proxy        : [Off]
    
  • Next is sudo dietpi-software and selected Browse Software option. Be default no software option was enabled/selected. Booting to run level 3.

  • Next, I selected vim(20), tcpdump(15), WiFi Hotspot (60) and pressed Confirm

    [  OK  ] DietPi-Software | Initialised database
    [  OK  ] DietPi-Software | Reading database
    [ SUB1 ] DietPi-Set_hardware > wifimodules (enable)
    [  OK  ] DietPi-Set_hardware | rm /etc/modprobe.d/dietpi-disable_wifi.conf
    [ INFO ] DietPi-Set_hardware | Please wait, enabling WiFi modules...
    [  OK  ] DietPi-Set_hardware | modprobe cfg80211
    [  OK  ] DietPi-Set_hardware | modprobe brcmfmac
    [  OK  ] DietPi-Set_hardware | modprobe brcmutil
    [ INFO ] DietPi-Set_hardware | Checking for required APT packages: iw wireless-tools wpasupplicant wireless-regdb
    [  OK  ] wifimodules enable | Completed
    

Since I am not intending to enable internal WiFi, are the above modprobe calls are needed?

  • Before selecting Install to start installation, I opened another ssh session from another window just to check if I see another wlan1 for the mod probe and check is the internal wifi was enabled just by selecting WiFi Hotspot and silently this was enabled. Running ifconfig -a still shows only one wlan0 from external USB dongle. And I still see

     Ethernet     : Available | [On] | Connected
     WiFi         : Available | [Off] | Disconnected
     Onboard WiFi : [Off]
     ●─ Additional Options ───────────●
     IPv6         : [On]
     Proxy        : [Off]
    
  • Select <Install> and then select <Ok> to start installation. Please see the attached log file for the errors. These are the same errors I got on this first attempt when I created this issue but using internal WiFi only. So it looks like it is the same issue regardless is using internet Wifi or external Wifi dongle.

dietpi-coftware.log

Here is also output for sudo journalctl -xeu isc-dhcp-server.service

isc-dhcp-server.service.log

Also did checked most recent dmsg entries and I see following

[Sun Nov 24 22:59:10 2024] r8188eu: module is from the staging directory, the quality is unknown, you have been warned.
[Sun Nov 24 22:59:10 2024] usbcore: registered new interface driver r8188eu
[Mon Nov 25 00:25:28 2024] usbcore: registered new interface driver brcmfmac
[Mon Nov 25 00:40:06 2024] r8188eu 1-1.2:1.0: Firmware Version 28, SubVersion 0, Signature 0x88e1
[Mon Nov 25 00:42:48 2024] INFO: task RTW_CMD_THREAD:4175 blocked for more than 120 seconds.
[Mon Nov 25 00:42:48 2024]       Tainted: G         C         6.1.21-v8+ #1642
[Mon Nov 25 00:42:48 2024] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[Mon Nov 25 00:42:48 2024] task:RTW_CMD_THREAD  state:D stack:0     pid:4175  ppid:2      flags:0x00000008
[Mon Nov 25 00:42:48 2024] Call trace:
[Mon Nov 25 00:42:48 2024]  __switch_to+0xf8/0x1e0
[Mon Nov 25 00:42:48 2024]  __schedule+0x2a8/0x830
[Mon Nov 25 00:42:48 2024]  schedule+0x60/0x100
[Mon Nov 25 00:42:48 2024]  schedule_timeout+0x2cc/0x358
[Mon Nov 25 00:42:48 2024]  wait_for_completion+0x84/0x168
[Mon Nov 25 00:42:48 2024]  rtw_cmd_thread+0x68/0x1b0 [r8188eu]
[Mon Nov 25 00:42:48 2024]  kthread+0xfc/0x110
[Mon Nov 25 00:42:48 2024]  ret_from_fork+0x10/0x20
[Mon Nov 25 00:44:49 2024] INFO: task RTW_CMD_THREAD:4175 blocked for more than 241 seconds.
[Mon Nov 25 00:44:49 2024]       Tainted: G         C         6.1.21-v8+ #1642
[Mon Nov 25 00:44:49 2024] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[Mon Nov 25 00:44:49 2024] task:RTW_CMD_THREAD  state:D stack:0     pid:4175  ppid:2      flags:0x00000008
[Mon Nov 25 00:44:49 2024] Call trace:
[Mon Nov 25 00:44:49 2024]  __switch_to+0xf8/0x1e0
[Mon Nov 25 00:44:49 2024]  __schedule+0x2a8/0x830
[Mon Nov 25 00:44:49 2024]  schedule+0x60/0x100
[Mon Nov 25 00:44:49 2024]  schedule_timeout+0x2cc/0x358
[Mon Nov 25 00:44:49 2024]  wait_for_completion+0x84/0x168
[Mon Nov 25 00:44:49 2024]  rtw_cmd_thread+0x68/0x1b0 [r8188eu]
[Mon Nov 25 00:44:49 2024]  kthread+0xfc/0x110
[Mon Nov 25 00:44:49 2024]  ret_from_fork+0x10/0x20
[Mon Nov 25 00:46:50 2024] INFO: task RTW_CMD_THREAD:4175 blocked for more than 362 seconds.
[Mon Nov 25 00:46:50 2024]       Tainted: G         C         6.1.21-v8+ #1642
[Mon Nov 25 00:46:50 2024] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[Mon Nov 25 00:46:50 2024] task:RTW_CMD_THREAD  state:D stack:0     pid:4175  ppid:2      flags:0x00000008
[Mon Nov 25 00:46:50 2024] Call trace:
[Mon Nov 25 00:46:50 2024]  __switch_to+0xf8/0x1e0
[Mon Nov 25 00:46:50 2024]  __schedule+0x2a8/0x830
[Mon Nov 25 00:46:50 2024]  schedule+0x60/0x100
[Mon Nov 25 00:46:50 2024]  schedule_timeout+0x2cc/0x358
[Mon Nov 25 00:46:50 2024]  wait_for_completion+0x84/0x168
[Mon Nov 25 00:46:50 2024]  rtw_cmd_thread+0x68/0x1b0 [r8188eu]
[Mon Nov 25 00:46:50 2024]  kthread+0xfc/0x110
[Mon Nov 25 00:46:50 2024]  ret_from_fork+0x10/0x20
[Mon Nov 25 00:48:50 2024] INFO: task RTW_CMD_THREAD:4175 blocked for more than 483 seconds.
[Mon Nov 25 00:48:50 2024]       Tainted: G         C         6.1.21-v8+ #1642
[Mon Nov 25 00:48:50 2024] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[Mon Nov 25 00:48:50 2024] task:RTW_CMD_THREAD  state:D stack:0     pid:4175  ppid:2      flags:0x00000008
[Mon Nov 25 00:48:50 2024] Call trace:
[Mon Nov 25 00:48:50 2024]  __switch_to+0xf8/0x1e0
[Mon Nov 25 00:48:50 2024]  __schedule+0x2a8/0x830
[Mon Nov 25 00:48:50 2024]  schedule+0x60/0x100
[Mon Nov 25 00:48:50 2024]  schedule_timeout+0x2cc/0x358
[Mon Nov 25 00:48:50 2024]  wait_for_completion+0x84/0x168
[Mon Nov 25 00:48:50 2024]  rtw_cmd_thread+0x68/0x1b0 [r8188eu]
[Mon Nov 25 00:48:50 2024]  kthread+0xfc/0x110
[Mon Nov 25 00:48:50 2024]  ret_from_fork+0x10/0x20
[Mon Nov 25 00:50:51 2024] INFO: task RTW_CMD_THREAD:4175 blocked for more than 604 seconds.
[Mon Nov 25 00:50:51 2024]       Tainted: G         C         6.1.21-v8+ #1642
[Mon Nov 25 00:50:51 2024] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[Mon Nov 25 00:50:51 2024] task:RTW_CMD_THREAD  state:D stack:0     pid:4175  ppid:2      flags:0x00000008
[Mon Nov 25 00:50:51 2024] Call trace:
[Mon Nov 25 00:50:51 2024]  __switch_to+0xf8/0x1e0
[Mon Nov 25 00:50:51 2024]  __schedule+0x2a8/0x830
[Mon Nov 25 00:50:51 2024]  schedule+0x60/0x100
[Mon Nov 25 00:50:51 2024]  schedule_timeout+0x2cc/0x358
[Mon Nov 25 00:50:51 2024]  wait_for_completion+0x84/0x168
[Mon Nov 25 00:50:51 2024]  rtw_cmd_thread+0x68/0x1b0 [r8188eu]
[Mon Nov 25 00:50:51 2024]  kthread+0xfc/0x110
[Mon Nov 25 00:50:51 2024]  ret_from_fork+0x10/0x20

I will leave this unit alone as it is, if you need additional information or want me to try something? Let me know.

Tx

@oxoocoffee
Copy link
Author

I forgot to add current screen messages. All the commands in previous posts were performed over ssh sessions using default starts on the boot /usr/sbin/dropbear

image

@oxoocoffee oxoocoffee changed the title Raspberry Pi 5 Wifi driver / Access Point Raspberry Pi 4/5 Wifi driver / Access Point Nov 27, 2024
@MichaIng
Copy link
Owner

MichaIng commented Dec 1, 2024

@oxoocoffee
That the DHCP server service start fails on first install is expected, since no valid config exists yet, and the interface may be down. Don't ask me why the APT maintainer scripts do not this expected case properly. We would need to install the isc-dhcp-server package after everything else (config generation, configuring WiFi interface), to avoid it 🤔.

However, this does not cause issues. The kernel errors are however really annoying. Those are "warnings", right?

dmesg -l 4

This is on the RPi 4 right (as of kernel version). I guess it is an issue with the old Realtek driver. Please try whether the new kernel solves it: #6676

And you are right, the Broadcom modules do not need to be loaded in your particular case. However, they were blacklisted before, and we cannot know which driver is needed, so we need to load all blacklisted ones to assure every WiFi adapter is functional.

@oxoocoffee
Copy link
Author

oxoocoffee commented Dec 7, 2024

I got it fixed. Yup, there were no default configuration provided. After I did set it up it is up.
So this issue can be closed.

But I have a some additional question. Looks like rPI4 Wifi supports AC?
I should be able to setup hostapd in n mode.

interface=wlan0
driver=nl80211
ssid=*******
wpa_passphrase=*********
country_code=US
hw_mode=g
channel=1
ieee80211n=1
ieee80211ac=0
ieee80211ax=0
wmm_enabled=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
logger_syslog=1
logger_syslog_level=2

If I change hw_mode=g to hw_mode=n it failed to start. Am I missing something?

Also can TKIP be turned off?

@MichaIng
Copy link
Owner

@oxoocoffee
hw_mode=n does not exist. It is a little confusing, but hw_mode=g is 2.4 GHz while otherwise only hw_mode=a exists for 5 GHz. ieee80211n=1 toggles WiFi 4/n.

You can toggle all these (WiFi 4/5/6, 2.5 and 5 GHz) in dietpi-config adapter > WiFi settings btw, and it will/should set all flags in the hostapd config correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants