[Solved] Hostapd WPA2 issues and kernel warning

Please try to remove bridge-option in hostapd.conf

I tried that already but it makes no difference

Which image and which kernel.do you use? Can you try my debian/ubuntu with a 4.14-kernel to exclude a hardware-issue?

I am using the Ubuntu 16.04 with 4.4.70-BPI-R2-Kernel from 2017. Is thre a way to keep my other settings when using the new image?

You can use newer kernel with your current system (have to change network-config to match dsa) but if you use a new image you have to configure it again (copy config files from old system).

Alright I used 4.14.62_main prebuilt from your Google Cloud and extracted BPI-ROOT to my FS Root I also used bpi-bootsel and gzip to flash the uImage file to the BPI Bootsector. Note also that I accidentally omitted the bananapi\bpi-r2\linux\ folders from the uboot.img.gz file.

Result: BPI does not boot anymore

All 3 LEDs stay on and I don’t get any image via HDMI. Sadly, I don’t know how to get out of this mess :\

Do not flash uimage…it is only a file which have to be to copied to bpi-Boot-partition.

Uboot have to be flashed,but not to position 0.

Figured as much afterwards xD

Any tips on how to reverse it though? I can’t boot into it anymore and I don’t have a UART interface available :\

You can try use this: https://www.fw-web.de/dokuwiki/doku.php?id=en/bpi-r2/storage starting on step 4 and use sd instead of loop8

Alternative you can dd the first 1 mb from image to your sdcard. In both files you have to copy back uimage and uenv.txt to root-partition.

Else you can copy 101mb from priginal image to your sd-card. This will restore the first 1mb and the bpi-boot-partition (100mb)

I have try hostapd. My other computer or phone don’t see the ssid of the BPI-R2. First I have try with a bridge, after I have try with no bridge. The bridge works between eth0 and eth1.

I have read this message. Need I install the new kernel ? Can I build the kernel with the BPI-R2 or with Mageia ?

“wmt_loader” doesn’t work.

root@bpi-iot-ros-ai:~# wmt_loader
init combo device
Opened combo device
get device id : 30243
set device id : 30243
do module init: 30243
failed to init module

last failed of wmtloader can be ignored

Without your config,hostapd-log and kernelversion we/i cannot help you

My kernel version : root@bpi-iot-ros-ai:~# uname -r 4.4.70-BPI-R2-Kernel

Where is the config,hostapd-log ?

root@bpi-iot-ros-ai:/etc/hostapd# grep hostapd /var/log/syslog
Nov  4 22:03:38 bpi-iot-ros-ai hostapd[2063]:  * Starting advanced IEEE 802.11 management hostapd
Nov  4 22:03:38 bpi-iot-ros-ai hostapd[2063]:    ...fail!

How do you start hostapd? If starting hostapd manually you can set config by parameter and see the log on terminal

Again…take a look in my wiki www.fw-web.de/dokuwiki

You are wanted this :

  • root@bpi-iot-ros-ai:/etc/hostapd# /usr/sbin/hostapd -dd  /etc/hostapd/hostapd.conf
    
  • random: Trying to read entropy from /dev/random
    
  • Configuration file: /etc/hostapd/hostapd.conf
    
  • rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
    
  • rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
    
  • nl80211: Using driver-based roaming
    
  • nl80211: TDLS supported
    
  • nl80211: TDLS external setup
    
  • nl80211: Supported cipher 00-0f-ac:1
    
  • nl80211: Supported cipher 00-0f-ac:5
    
  • nl80211: Supported cipher 00-0f-ac:2
    
  • nl80211: Supported cipher 00-0f-ac:4
    
  • nl80211: Supported cipher 00-0f-ac:6
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=1
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=6
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4096
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4097
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4098
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4099
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4104
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4100
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4103
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4102
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4354
    
  • nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4608
    
  • nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=0
    
  • nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=1
    
  • nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=2
    
  • nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=3
    
  • nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=4
    
  • nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=5
    
  • nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=6
    
  • nl80211: interface wlan0 in phy phy0
    
  • nl80211: Set mode ifindex 8 iftype 3 (AP)
    
  • nl80211: Failed to set interface 8 to mode 3: -95 (Operation not supported)
    
  • nl80211: Try mode change after setting interface down
    
  • nl80211: Set mode ifindex 8 iftype 3 (AP)
    
  • nl80211: Failed to set interface 8 to mode 3: -95 (Operation not supported)
    
  • nl80211: Interface mode change to 3 from 0 failed
    
  • nl80211: Could not configure driver mode
    
  • nl80211: deinit ifname=wlan0 disabled_11b_rates=0
    
  • nl80211: Remove monitor interface: refcount=0
    
  • netlink: Operstate: ifindex=8 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
    
  • nl80211: Set mode ifindex 8 iftype 2 (STATION)
    
  • nl80211 driver initialization failed.
    
  • hostapd_interface_deinit_free(0x7f6dccd8)
    
  • hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
    
  • hostapd_interface_deinit(0x7f6dccd8)
    
  • wlan0: interface state UNINITIALIZED->DISABLED
    
  • hostapd_bss_deinit: deinit bss wlan0
    
  • wlan0: AP-DISABLED 
    
  • hostapd_cleanup(hapd=0x7f6dd9a0 (wlan0))
    
  • hostapd_free_hapd_data: Interface wlan0 wasn't started
    
  • hostapd_interface_deinit_free: driver=(nil) drv_priv=(nil) -> hapd_deinit
    
  • hostapd_interface_free(0x7f6dccd8)
    
  • hostapd_interface_free: free hapd 0x7f6dd9a0
    
  • hostapd_cleanup_iface(0x7f6dccd8)
    
  • hostapd_cleanup_iface_partial(0x7f6dccd8)
    
  • hostapd_cleanup_iface: free iface=0x7f6dccd8

Please post your /etc/hostapd/hostapd.conf and make your log readable with code-button </> (select log and then press it)

My /etc/hostapd/hostapd.conf # This is the name of the WiFi interface we configured above interface=wlan0

# Use the nl80211 driver with the brcmfmac driver
#driver=nl80211
driver=nl80211

# YOUR BRIDGE NAME
#bridge=br0

# YOUR COUNTRY HERE
country_code=FR
ieee80211d=1

# This is the name of the network
ssid=Mon_réseau_domestique
# Use the 2.4GHz band
hw_mode=g

# Use channel 6
channel=6

# Enable 802.11n
#ieee80211n=1

# Enable WMM
wmm_enabled=1

# Enable 40MHz channels with 20ns guard interval
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]

# Accept all MAC addresses
macaddr_acl=0

# Use WPA authentication
auth_algs=1

# Require clients to know the network name
ignore_broadcast_ssid=0

# Use WPA2
wpa=2

# Use a pre-shared key
wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

# The network passphrase
wpa_passphrase=Pas Ici

# Use AES, instead of TKIP
rsn_pairwise=CCMP

For the log, “carrier return” and “line’s jump” doesn’t work… I don’t know why :frowning:

internal wifi-device is named ap0 and have to created before runnind hostapd

https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:wlan

Before starting hostapd please check if ap0 exists

I have found it with "Can’t open device node(/dev/stpwmt) error:-1 "

root@bpi-iot-ros-ai:~# ifconfig -a|grep Link
bond0     Link encap:Ethernet  HWaddr 72:a1:72:02:27:c3  
br0       Link encap:Ethernet  HWaddr 32:d1:55:7d:03:39  
          inet6 addr: fe80::30d1:55ff:fe7d:339/64 Scope:Link
br0:avahi Link encap:Ethernet  HWaddr 32:d1:55:7d:03:39  
docker0   Link encap:Ethernet  HWaddr 02:42:c2:ca:a0:fa  
eth0      Link encap:Ethernet  HWaddr fe:e9:dc:36:38:a8  
          inet6 addr: fe80::fce9:dcff:fe36:38a8/64 Scope:Link
eth1      Link encap:Ethernet  HWaddr 92:e8:79:fb:e3:10  
lo        Link encap:Local Loopback  
sit0      Link encap:IPv6-in-IPv4  
tunl0     Link encap:IPIP Tunnel  HWaddr   
wlan0     Link encap:Ethernet  HWaddr 00:08:22:5c:b7:fb  
root@bpi-iot-ros-ai:~# wmt_loader
init combo device
Opened combo device
get device id : 30243
set device id : 30243
do module init: 30243
failed to init module 
root@bpi-iot-ros-ai:~# stp_uart_launcher -p /etc/firmware &
[1] 3053
root@bpi-iot-ros-ai:~# Can't open device node(/dev/stpwmt) error:-1 
Can't open device node(/dev/stpwmt) error:-1 
[...]
echo A >/dev/wmtWifi 
root@bpi-iot-ros-ai:~# Can't open device node(/dev/stpwmt) error:-1 
Can't open device node(/dev/stpwmt) error:-1 
Can't open device node(/dev/stpwmt) error:-1 
Can't open device node(/dev/stpwmt) error:-1 
ifconfig -a|grep Link          Can't open device node(/dev/stpwmt) error:-1 

ap0       Link encap:Ethernet  HWaddr 02:08:22:5c:b7:fb  
          inet6 addr: fe80::8:22ff:fe5c:b7fb/64 Scope:Link
bond0     Link encap:Ethernet  HWaddr 72:a1:72:02:27:c3  
br0       Link encap:Ethernet  HWaddr 32:d1:55:7d:03:39  
          inet6 addr: fe80::30d1:55ff:fe7d:339/64 Scope:Link
br0:avahi Link encap:Ethernet  HWaddr 32:d1:55:7d:03:39  
docker0   Link encap:Ethernet  HWaddr 02:42:c2:ca:a0:fa  
eth0      Link encap:Ethernet  HWaddr fe:e9:dc:36:38:a8  
          inet6 addr: fe80::fce9:dcff:fe36:38a8/64 Scope:Link
eth1      Link encap:Ethernet  HWaddr 92:e8:79:fb:e3:10  
lo        Link encap:Local Loopback  
sit0      Link encap:IPv6-in-IPv4  
tunl0     Link encap:IPIP Tunnel  HWaddr   
wlan0     Link encap:Ethernet  HWaddr 00:08:22:5c:b7:fb  
root@bpi-iot-ros-ai:~# Can't open device node(/dev/stpwmt) error:-1 
Can't open device node(/dev/stpwmt) error:-1 
[...]
root@bpi-iot-ros-ai:~# Can't open device node(/dev/stpwmt) error:-1 
Can't open device node(/dev/stpwmt) error:-1 
ifconfig 
ap0       Link encap:Ethernet  HWaddr 02:08:22:5c:b7:fb  
          inet addr:192.192.2.1  Bcast:192.192.2.255  Mask:255.255.255.0
          inet6 addr: fe80::8:22ff:fe5c:b7fb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:7480 (7.4 KB)

tail -f /var/log/kern.ord say :

Nov 5 02:58:58 bpi-iot-ros-ai kernel: [ 561.727825] [WMT-DEV][W]WMT_open:wait_event_timeout (2000)ms,(200)jiffies,return -EIO

tail -f /var/log/syslog say :

Nov 5 03:01:19 bpi-iot-ros-ai kernel: [ 702.027770] [WMT-DEV][W]WMT_open:wait_event_timeout (2000)ms,(200)jiffies,return -EIO

I try to reboot…

ap0 it not here. root@bpi-iot-ros-ai:~# echo A >/dev/wmtWifi

and ap0 is here.

/etc/hostapd# /usr/sbin/hostapd -dd /etc/hostapd/hostapd.conf After many line it’s halt…

  • root@bpi-iot-ros-ai:/etc/hostapd# /usr/sbin/hostapd -dd /etc/hostapd/hostapd.conf
  • random: Trying to read entropy from /dev/random
  • Configuration file: /etc/hostapd/hostapd.conf
  • rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
  • rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
  • nl80211: Using driver-based roaming
  • nl80211: TDLS supported
  • nl80211: TDLS external setup
  • nl80211: Supported cipher 00-0f-ac:1
  • nl80211: Supported cipher 00-0f-ac:5
  • […]
  • nl80211: Set ap0 operstate 0->1 (UP)
  • netlink: Operstate: ifindex=10 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
  • Failed to set TX queue parameters for queue 0.
  • Failed to set TX queue parameters for queue 1.
  • Failed to set TX queue parameters for queue 2.
  • Failed to set TX queue parameters for queue 3.
  • ap0: interface state COUNTRY_UPDATE->ENABLED
  • ap0: AP-ENABLED
  • ap0: Setup of interface done.

After many minute:

  • random: Got 6/8 bytes from /dev/random
  • random: Got 2/2 bytes from /dev/random

After many minutes :

  • ap0: WPA rekeying GTK
  • WPA: group state machine entering state SETKEYS (VLAN-ID 0)
  • Get randomness: len=16 entropy=0
  • GTK - hexdump(len=16): [REMOVED]
  • wpa_group_setkeys: GKeyDoneStations=0
  • WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
  • wpa_driver_nl80211_set_key: ifindex=10 (ap0) alg=3 addr=0x7f6360e4 key_idx=2 set_tx=1 seq_len=0 key_len=16
  • nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
  • broadcast key

All 10 min come this message

  • ap0: WPA rekeying GTK
  • WPA: group state machine entering state SETKEYS (VLAN-ID 0)
  • Get randomness: len=16 entropy=0
  • GTK - hexdump(len=16): [REMOVED]
  • wpa_group_setkeys: GKeyDoneStations=0
  • WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
  • wpa_driver_nl80211_set_key: ifindex=10 (ap0) alg=3 addr=0x7f6360e4 key_idx=2 set_tx=1 seq_len=0 key_len=16
  • nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
  • broadcast key

Okay, finally got around to reinstalling my BPI-R2. Upgrading to 4.14 solved the issue apparantly.

WPA2-PSK AccessPoint works now without the kernel throwing errors. I used the deb_stretch_4.14.80_SD image from @frank-w and customized it for my network. I have a new issue concerning nat forwarding on the LAN ports but I will open a new thread for that.

Thanks :slight_smile:

I’m waiting about your new thread for a new issue concerning nat forwarding on the LAN ports. I have this problem.