WPA supplicant ERROR WPA: 4-Way Handshake failed in WiFi Direct setup - wpa

I am trying to set up WiFi Direct between two linux machines. I am using Atheros 9k cards to set up the connections. We have a problem in the process which I hope you guys can help me.
When I run WPA Supplicant in both of the parts, I get this:
wpa_supplicant -B -D nl80211 -i wlan0 -cp2p.conf -d
wpa_supplicant v2.2-devel
random: Trying to read entropy from /dev/random
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf 'p2p.conf' driver 'nl80211' ctrl_interface 'N/A' bridge 'N/A'
Configuration file 'p2p.conf' -> '/root/p2p.conf'
Reading configuration file '/root/p2p.conf'
ctrl_interface='/var/run/wpa_supplicant'
ap_scan=2
update_config=1
device_name='giulia118'
p2p_go_ht40=1
Priority group 0
id=0 ssid='Direct_Network'
nl80211: Could not add multicast membership for vendor events: -2 (No such file or directory)
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: 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: Using driver-based off-channel TX
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 4 iftype 2 (STATION)
nl80211: Subscribe to mgmt frames with non-AP handle 0x9fa4380
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=040a
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=040b
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=040c
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=040d
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=090a
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=090b
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=090c
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=090d
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=0409506f9a09
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=7f506f9a09
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=06
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=0a07
nl80211: Register frame type=0xd0 nl_handle=0x9fa4380 match=0a11
netlink: Operstate: ifindex=4 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)
nl80211: driver param='(null)'
Add interface wlan0 to a new radio phy0
nl80211: Regulatory information - country=00
nl80211: 2402-2472 # 40 MHz 20 mBm
nl80211: 2457-2482 # 20 MHz 20 mBm (no IR)
nl80211: 2474-2494 # 20 MHz 20 mBm (no OFDM) (no IR)
nl80211: 5170-5250 # 40 MHz 20 mBm (no IR)
nl80211: 5735-5835 # 40 MHz 20 mBm (no IR)
nl80211: Added 802.11b mode based on 802.11g information
wlan0: Own MAC address: 04:f0:21:06:1d:14
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
wlan0: RSN: flushing PMKID list in the driver
nl80211: Flush PMKIDs
wlan0: Setting scan request: 0.100000 sec
wlan0: WPS: UUID based on MAC address: 94f8bf7f-bad8-5fc8-87c2-05c3afbed265
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
nl80211: Skip set_supp_port(unauthorized) while not associated
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
P2P: Own listen channel: 6
P2P: Random operating channel: 81:6
P2P: Add operating class 81
P2P: Channels - hexdump(len=11): 01 02 03 04 05 06 07 08 09 0a 0b
P2P: Add operating class 115
P2P: Channels - hexdump(len=4): 24 28 2c 30
P2P: Add operating class 124
P2P: Channels - hexdump(len=4): 95 99 9d a1
P2P: Add operating class 116
P2P: Channels - hexdump(len=2): 24 2c
P2P: Add operating class 117
P2P: Channels - hexdump(len=2): 28 30
P2P: Add operating class 126
P2P: Channels - hexdump(len=2): 95 9d
P2P: Add operating class 127
P2P: Channels - hexdump(len=2): 99 a1
P2P: initialized
P2P: channels: 81:1,2,3,4,5,6,7,8,9,10,11 115:36,40,44,48 124:149,153,157,161 116:36,44 117:40,48 126:149,157 127:153,161
P2P: cli_channels:
wlan0: Added interface wlan0
wlan0: State: DISCONNECTED -> DISCONNECTED
nl80211: Set wlan0 operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=4 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
Daemonize..
Then I run wpa_cli and I use the commands for create a p2p group in pbc (Pusg button Control), and the final messages of the failed connection are:
1st Device:
<3>WPS-AP-AVAILABLE-PBC
<3>SME: Trying to authenticate with 04:f0:21:06:1d:1f (SSID='DIRECT-Mj' freq=2412 MHz)
<3>Trying to associate with 04:f0:21:06:1d:1f (SSID='DIRECT-Mj' freq=2412 MHz)
<3>Associated with 04:f0:21:06:1d:1f
<3>CTRL-EVENT-EAP-STARTED EAP authentication started
<3>CTRL-EVENT-EAP-STATUS status='started' parameter=''
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=1
<3>CTRL-EVENT-EAP-STATUS status='accept proposed method' parameter='WSC'
<3>CTRL-EVENT-EAP-METHOD EAP vendor 14122 method 1 (WSC) selected
<3>WPS-CRED-RECEIVED
<3>WPS-SUCCESS
<3>P2P-GROUP-FORMATION-SUCCESS
<3>CTRL-EVENT-EAP-STATUS status='completion' parameter='failure'
<3>CTRL-EVENT-EAP-FAILURE EAP authentication failed
<3>CTRL-EVENT-DISCONNECTED bssid=04:f0:21:06:1d:1f reason=3 locally_generated=1
<3>SME: Trying to authenticate with 04:f0:21:06:1d:1f (SSID='DIRECT-Mj' freq=2412 MHz)
<3>Trying to associate with 04:f0:21:06:1d:1f (SSID='DIRECT-Mj' freq=2412 MHz)
<3>CTRL-EVENT-REGDOM-CHANGE init=DRIVER type=WORLD
<3>Associated with 04:f0:21:06:1d:1f
<3>CTRL-EVENT-DISCONNECTED bssid=04:f0:21:06:1d:1f reason=2
<3>WPA: 4-Way Handshake failed - pre-shared key may be incorrect
<3>CTRL-EVENT-REGDOM-CHANGE init=DRIVER type=WORLD
<3>CTRL-EVENT-SCAN-STARTED
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>P2P-GROUP-FORMATION-FAILURE
<3>P2P-GROUP-REMOVED wlan0 client reason=FORMATION_FAILED
2nd Device:
<3>AP-ENABLED
<3>CTRL-EVENT-CONNECTED - Connection to 04:f0:21:06:1d:1f completed [id=1 id_str=]
<3>P2P-GROUP-STARTED wlan0 GO ssid="DIRECT-Mj" freq=2412 passphrase="ZPHbkRAf" go_dev_addr=04:f0:21:06:1d:1f
wps_pbc
> OK
<3>WPS-PBC-ACTIVE
<3>P2P-PROV-DISC-PBC-REQ 04:f0:21:06:1d:14 p2p_dev_addr=04:f0:21:06:1d:14 pri_dev_type=1-0050F204-1 name='giulia118' config_methods=0x108 dev_capab=0x21 group_capab=0x0 group=wlan0
<3>WPS-ENROLLEE-SEEN 04:f0:21:06:1d:14 94f8bf7f-bad8-5fc8-87c2-05c3afbed265 1-0050F204-1 0x2108 4 1 [giulia118]
<3>CTRL-EVENT-EAP-STARTED 04:f0:21:06:1d:14
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=254
<3>WPS-REG-SUCCESS 04:f0:21:06:1d:14 94f8bf7f-bad8-5fc8-87c2-05c3afbed265
<3>WPS-PBC-DISABLE
<3>WPS-SUCCESS
<3>CTRL-EVENT-EAP-FAILURE 04:f0:21:06:1d:14
<3>WPS-ENROLLEE-SEEN 04:f0:21:06:1d:14 94f8bf7f-bad8-5fc8-87c2-05c3afbed265 1-0050F204-1 0x2108 0 0 [giulia118]
The content of my configuration (p2p.conf) file is:
1st Device:
ctrl_interface=/var/run/wpa_supplicant
ap_scan=2
fast_reauth=1
update_config=1
device_name=giulia116
device_type=1-0050F204-1
p2p_go_ht40=1
network={
ssid="Direct_Network"
psk="12345678"
proto=RSN WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
}
2nd Device:
ctrl_interface=/var/run/wpa_supplicant
ap_scan=2
update_config=1
device_name=giulia118
device_type=1-0050F204-1
p2p_go_ht40=1
network={
ssid="Direct_Network"
psk="12345678"
key_mgmt=WPA-PSK
group=CCMP TKIP
}
ifconfig:
eth0 Link encap:Ethernet HWaddr 00:0d:b9:2e:1b:88
inet addr:192.168.97.116 Bcast:192.168.97.255 Mask:255.255.255.0
inet6 addr: fe80::20d:b9ff:fe2e:1b88/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2949 errors:0 dropped:0 overruns:0 frame:0
TX packets:1840 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:321032 (321.0 KB) TX bytes:268766 (268.7 KB)
Interrupt:10 Base address:0xe000
eth1 Link encap:Ethernet HWaddr 00:0d:b9:2e:1b:89
inet addr:172.16.0.235 Bcast:172.16.0.255 Mask:255.255.255.0
inet6 addr: fe80::20d:b9ff:fe2e:1b89/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:163951 errors:0 dropped:0 overruns:0 frame:0
TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17016272 (17.0 MB) TX bytes:4093 (4.0 KB)
Interrupt:15
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
mon.wlan0 Link encap:UNSPEC HWaddr 04-F0-21-06-1D-1F-30-30-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:716 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:104534 (104.5 KB) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 04:f0:21:06:1d:1f
inet6 addr: fe80::6f0:21ff:fe06:1d1f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2154 (2.1 KB) TX bytes:576 (576.0 B)
.config :
CONFIG_DRIVER_NL80211=y
CONFIG_READLINE=y
CONFIG_CTRL_IFACE=y
CONFIG_WPS=y
CONFIG_WPS2=y
CONFIG_P2P=y
CONFIG_AP=y
#CONFIG_DRIVER_WEXT=y
#CONFIG_DRIVER_BSD=y
#CONFIG_DRIVER_NDIS=y
CONFIG_IEEE8021X_EAPOL=y
#CONFIG_EAP_MD5=y
#CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
#CONFIG_EAP_TTLS=y
#CONFIG_EAP_GTC=y
#CONFIG_EAP_OTP=y
#CONFIG_EAP_SIM=y
#CONFIG_EAP_AKA=y
CONFIG_EAP_PSK=y
#CONFIG_EAP_SAKE=y
#CONFIG_EAP_GPSK=y
#CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
#CONFIG_EAP_IKEV2=y
#CONFIG_PCSC=y
The error seems to be related to the “4-Way Handshake” failure. Could it be that the pre-shared key is incorrect? Why I have a “GROUP REMOVED” ?
I would appreciate any suggestion regarding the matter.
Thank you all in advance!

Related

Oracle 11g XE - ORA-31202: DBMS_LDAP: LDAP client/server error: SSL handshake failed when connecting AD

I'm trying to integrate my oracle 11g XE instance (version forced by product I'm working with) with Samba based Active Directory on port 636. Unfortunetally, I'm getting error ORA-31202: DBMS_LDAP: LDAP client/server error: SSL handshake failed.
I've set oracle wallet, trying with openssl an keytool (using SE version), but it's not working with any of them.
I've seen same problem here, but it was resolved by adding java procedure which is not supported by XE.
If anybody could help me, I'd be really, really grateful. I'm storing my test procedure below, but it's nothing more than minimal required standard one:
declare
l_retval varchar(100);
p_session dbms_ldap.session;
begin
dbms_ldap.use_exception := true;
p_session := dbms_ldap.init(hostname => 'myldaphost',
portnum => 636);
l_retval := DBMS_LDAP.open_ssl (p_session,'file:/u01/app/wallet2',
'xxxxx', 2);
l_retval := dbms_ldap.simple_bind_s(ld => p_session,
dn => 'myuserdn',
passwd => 'xxxxx');
end;
#EDIT:
That's why I've managed to capture with tshark:
1 0.000000000 10.10.30.58 → 10.10.30.29 TCP 74 34068 → 636 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=1812804240 TSecr=0 WS=128
2 0.001134994 10.10.30.29 → 10.10.30.58 TCP 74 636 → 34068 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM=1 TSval=3244251678 TSecr=1812804240 WS=128
3 0.001194794 10.10.30.58 → 10.10.30.29 TCP 66 34068 → 636 [ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=1812804241 TSecr=3244251678
4 0.062087948 10.10.30.58 → 10.10.30.29 SSLv2 133 Client Hello
5 0.063469940 10.10.30.29 → 10.10.30.58 TCP 66 636 → 34068 [ACK] Seq=1 Ack=68 Win=65152 Len=0 TSval=3244251740 TSecr=1812804302
6 0.063480740 10.10.30.29 → 10.10.30.58 TCP 66 636 → 34068 [FIN, ACK] Seq=1 Ack=68 Win=65152 Len=0 TSval=3244251740 TSecr=1812804302
7 0.063532740 10.10.30.58 → 10.10.30.29 SSLv3 73 Alert (Level: Fatal, Description: Close Notify)
8 0.063556040 10.10.30.58 → 10.10.30.29 TCP 66 34068 → 636 [FIN, ACK] Seq=75 Ack=2 Win=64256 Len=0 TSval=1812804303 TSecr=3244251740
9 0.064059637 10.10.30.29 → 10.10.30.58 TCP 60 636 → 34068 [RST] Seq=2 Win=0 Len=0

WPA-Supplicant Not Working on Raspbian on Raspberry Pi 3B+

The new Raspberry pi 3b+ appears to have issues with using wpa_supplicant out of the box. If I configure and try to connect a network, I will receive an error that another program has created that interface.
It appears that networking is creating this interface and when wpa-supplicant tries to get ahold of it it cannot, and it appears that this issue is exclusive to the Pi 3B+. I have done the exact same thing on a raspberry pi 3B and successfully associated to the network. If you manually delete this 'wlan0' file you can connect to an SSID:
ctrl_iface bind(PF_UNIX) failed: Address already in use
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Here's the shell output:
root#raspberrypi:~# nano /etc/wpa_supplicant/wpa_supplicant.conf
root#raspberrypi:~# sudo wpa_supplicant -d -c /etc/wpa_supplicant/wpa_supplicant.conf -iwlan0
wpa_supplicant v2.4
random: Trying to read entropy from /dev/random
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'default' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'
ctrl_interface='DIR=/var/run/wpa_supplicant GROUP=netdev'
update_config=1
country='CA'
Priority group 0
id=0 ssid='CH_TEST_PSK'
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=2 op=0 soft=0 hard=0
nl80211: TDLS supported
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: Using driver-based off-channel TX
nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: Enable multi-channel concurrent (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Subscribe to mgmt frames with non-AP handle 0x205e8a0
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=040a
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=040b
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=040c
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=040d
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=090a
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=090b
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=090c
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=090d
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=0409506f9a09
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=6): 04 09 50 6f 9a 09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=7f506f9a09
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=5): 7f 50 6f 9a 09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=0801
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 08 01
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=040e
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0e
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=06
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=1): 06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=0a07
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 0a 07
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=0a11
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 0a 11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=1101
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 11 01
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=1102
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 11 02
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x205e8a0 match=0505
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 05 05
nl80211: Failed to register Action frame processing - ignore for now
netlink: Operstate: ifindex=3 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)
nl80211: driver param='(null)'
Add interface wlan0 to a new radio phy0
nl80211: Regulatory information - country=CA (DFS-FCC)
nl80211: 2402-2472 # 40 MHz 30 mBm
nl80211: 5170-5250 # 80 MHz 17 mBm
nl80211: 5250-5330 # 80 MHz 24 mBm (DFS)
nl80211: 5490-5600 # 80 MHz 24 mBm (DFS)
nl80211: 5650-5730 # 80 MHz 24 mBm (DFS)
nl80211: 5735-5835 # 80 MHz 30 mBm
nl80211: Added 802.11b mode based on 802.11g information
wlan0: Own MAC address: b8:27:eb:8d:6c:a6
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=4 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=5 set_tx=0 seq_len=0 key_len=0
wlan0: RSN: flushing PMKID list in the driver
nl80211: Flush PMKIDs
TDLS: TDLS operation supported by driver
TDLS: Driver uses internal link setup
TDLS: Driver does not support TDLS channel switching
wlan0: WPS: UUID based on MAC address: f6acd183-6b29-5478-a029-fbe96b5112e6
ENGINE: Loading dynamic engine
ENGINE: Loading dynamic engine
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
nl80211: Skip set_supp_port(unauthorized) while not associated
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
Using existing control interface directory.
ctrl_interface_group=108 (from group name 'netdev')
ctrl_iface bind(PF_UNIX) failed: Address already in use
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=netdev'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.
Failed to add interface wlan0
wlan0: Request to deauthenticate - bssid=00:00:00:00:00:00 pending_bssid=00:00:00:00:00:00 reason=3 state=DISCONNECTED
TDLS: Tear down peers
wlan0: State: DISCONNECTED -> DISCONNECTED
nl80211: Set wlan0 operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
wlan0: WPA: Clear old PMK and PTK
wlan0: Cancelling delayed sched scan
wlan0: Cancelling scan request
wlan0: Cancelling authentication timeout
Remove interface wlan0 from radio phy0
Remove radio phy0
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
netlink: Operstate: ifindex=3 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Unsubscribe mgmt frames handle 0x8a8d6029 (mode change)

Connect to wifi with bash script

I've created a bash script that is supposed to connect to WiFi dynamically. Whether it is WPA, WEP, without password, with static ip or using DHCP.
There is the script:
#!/bin/bash
echo "Open script..."
#NO PASSWORD
if [ $3 == 0 ]
then
echo "Without Password..."
iw dev wlan0 connect $1
fi
if [ $3 == "WEP" ]
then
echo "Auth mode WEP..."
iw wlan0 connect $1 key s:$2
fi
if [ $3 == "WPA" ] || [ $3 == "WPA2" ]
then
echo "Auth mode WPA"
echo "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid=\"$1\"
psk=\"$2\"
}" | sudo tee --append /etc/wpa_supplicant/wpa_supplicant.conf >
/dev/null
echo "Finished to write on wpa supplicant..."
sudo wpa_supplicant -B -i wlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf -Dwext
fi
if [ $4 == "DHCP" ]
then
echo "dhcp mode on..."
dhclient wlan0
else
echo "dhcp mode off..."
#ifconfig wlan0 $5 netmask $6 up
#route add default gw $7
#echo "nameserver $8">/etc/resolv.conf
fi
#SET DNS 2
if [ $9 != 0 ]
then
echo "dn2 configuration..."
#echo "nameserver $8">/etc/resolv.conf
fi
#RESTART UP
echo "restarting process..."
#ifconfig eth0 down
#/etc/init.d/networking restart
#pm2 stop 0
#pm2 delete 0
#pm2 start ecosystem.json
That's all. Some commands are commented because it is not finished yet. My problem is that the script isn't working. I gave it permissions on wpa_supplicant.conf, but it still does not want to work.
My errors are:
Finish to write on wpa_supplicant...
Successfully initialized wpa_supplicant
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
dhcp mode on...
restarting process...
stderr RTNETLINK answers: Operation not permitted
All variables work fine when I run the script, but somehow it still can't connect to WiFi. I've tried to use nl80211 instead and it gives me this error:
Failed to create interface
p2p-dev-wlan0: -16 (Device or resource busy) nl80211: Failed to create
a P2P Device interface p2p-dev-wlan0 P2P: Failed to enable P2P Device
interface
More verbose errors:
nl80211: TDLS supported
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: Using driver-based off-channel TX
nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Subscribe to mgmt frames with non-AP handle 0x1b9f4a0
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=040a
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=040b
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=040c
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=040d
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=090a
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=090b
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=090c
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=090d
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=0409506f9a09
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=6): 04 09 50 6f 9a 09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=7f506f9a09
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=5): 7f 50 6f 9a 09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=0801
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 08 01
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=040e
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0e
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
nl_handle=0x1b9f4a0 match=06
nl80211: Register frame command failed (type=208): ret=-114 (Operation
already in progress)
nl80211: Register frame match - hexdump(len=1): 06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x1b9f4a0 match=0a07
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 0a 07
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x1b9f4a0 match=0a11
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 0a 11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x1b9f4a0 match=1101
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 11 01
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x1b9f4a0 match=1102
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 11 02
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x1b9f4a0 match=0505
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 05 05
nl80211: Failed to register Action frame processing - ignore for now
netlink: Operstate: ifindex=3 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)
nl80211: driver param='(null)'
Add interface wlan0 to a new radio phy0
nl80211: Regulatory information - country=00
nl80211: 2402-2472 # 40 MHz 20 mBm
nl80211: 2457-2482 # 20 MHz 20 mBm (no IR)
nl80211: 2474-2494 # 20 MHz 20 mBm (no OFDM) (no IR)
nl80211: 5170-5250 # 80 MHz 20 mBm (no IR)
nl80211: 5250-5330 # 80 MHz 20 mBm (DFS) (no IR)
nl80211: 5490-5730 # 160 MHz 20 mBm (DFS) (no IR)
nl80211: 5735-5835 # 80 MHz 20 mBm (no IR)
nl80211: 57240-63720 # 2160 MHz 0 mBm
nl80211: Added 802.11b mode based on 802.11g information
wlan0: Own MAC address: b8:27:eb:d0:13:64
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=4 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=5 set_tx=0 seq_len=0 key_len=0
wlan0: RSN: flushing PMKID list in the driver
nl80211: Flush PMKIDs
TDLS: TDLS operation supported by driver
TDLS: Driver uses internal link setup
TDLS: Driver does not support TDLS channel switching
wlan0: WPS: UUID based on MAC address: 7630b69b-9582-57c5-9979-4b06864bafb4
ENGINE: Loading dynamic engine
ENGINE: Loading dynamic engine
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
nl80211: Skip set_supp_port(unauthorized) while not associated
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
Using existing control interface directory.
ctrl_interface_group=108 (from group name 'netdev')
wlan0: Added interface wlan0
wlan0: State: DISCONNECTED -> DISCONNECTED
nl80211: Set wlan0 operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
nl80211: Create interface iftype 10 (P2P_DEVICE)
Failed to create interface p2p-dev-wlan0: -16 (Device or resource busy)
nl80211: Failed to create a P2P Device interface p2p-dev-wlan0
P2P: Failed to create P2P Device interface
P2P: Failed to enable P2P Device interface
Daemonize..
dhcp mode on...
restarting process...
stderr RTNETLINK answers: Operation not permitted
Can someone help me?
Edit:
Wpa supplicant after running script:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=network
update_config=1
network={
ssid="WIFI"
psk="Password"
}
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI"
psk="Password"
}
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI"
psk="Password"
}
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI"
psk="Password"
}
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI"
psk="Password"
}
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI"
psk="Password"
}
I have just noticed that the same interface has been repeated several times, but it is due more to the fact that I have launched the script over and over again

Web Access Vagrant

I can SSH into my vagrant box fine, and also do this from another computer on the network which is great, but I cant seem to access the URL.
Even on the host computer when I try visiting 192.168.1.127 I get
This web page is not available
Currently my ifconfig on SSH :
vagrant#vagrant:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:91:14:ca
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe91:14ca/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:490 errors:0 dropped:0 overruns:0 frame:0
TX packets:314 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:52297 (52.2 KB) TX bytes:43532 (43.5 KB)
eth1 Link encap:Ethernet HWaddr 08:00:27:5b:38:98
inet addr:192.168.1.127 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:762 errors:0 dropped:0 overruns:0 frame:0
TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:72423 (72.4 KB) TX bytes:8567 (8.5 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
My vagrant file :
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "chef/ubuntu-14.04"
config.vm.network :public_network, ip: '192.168.1.127', :netmask => '255.255.255.0', :bridge => 'eth0'
config.vm.synced_folder "../pqs4", "/var/www/pqs4/", :nfs => false, :mount_options => ["dmode=777","fmode=666"]
config.vm.define :pqs4 do |t|
end
config.vm.provider "virtualbox" do |v|
v.name = "pqs4"
v.memory = 4096
v.cpus = 4
end
config.vm.provision :shell, :path => "provision.sh"
config.vm.provision "ansible" do |provisioner|
provisioner.inventory_path = "hosts"
provisioner.playbook = "playbook.yml"
provisioner.verbose = 'v'
provisioner.limit = 'all'
end
end

How to get the audio and video from a WebRTC stream using ffmpeg on server

I am trying to get the audio and video from a WebRTC stream and handle it (transcode or dump) with ffmpeg on ubuntu server. I have naively expected it to simply interpret the sdp offered by WebRTC, but was mistaken. I suspect ffmpeg is not capable of signaling back the answer sdp and it is must be done manually. Here is an offer sdp:
v=0
o=Mozilla-SIPUA-33.1 3662 0 IN IP4 0.0.0.0
s=SIP Call
t=0 0
a=ice-ufrag:5e0a74d1
a=ice-pwd:7446c0eb445117d0018ca2afc5f3ca54
a=fingerprint:sha-256 76:1B:19:CE:3F:41:C5:4D:64:E6:FD:72:D2:FC:42:E1:98:D4:0F:2B:73:AE:C7:F4:2C:73:2C:E7:9E:DC:6A:EB
m=audio 23063 RTP/SAVPF 109 0 8 101
c=IN IP4 188.253.146.208
a=rtpmap:109 opus/48000/2
a=ptime:20
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=setup:actpass
a=candidate:0 1 UDP 2128609535 192.168.1.100 4130 typ host
a=candidate:1 1 UDP 1692467199 188.253.146.208 23063 typ srflx raddr 192.168.1.100 rport 4130
a=candidate:0 2 UDP 2128609534 192.168.1.100 4131 typ host
a=candidate:1 2 UDP 1692467198 188.253.146.208 23064 typ srflx raddr 192.168.1.100 rport 4131
a=rtcp-mux
m=video 23065 RTP/SAVPF 120 126 97
c=IN IP4 188.253.146.208
a=rtpmap:120 VP8/90000
a=rtpmap:126 H264/90000
a=fmtp:126 profile-level-id=42e01f;packetization-mode=1
a=rtpmap:97 H264/90000
a=fmtp:97 profile-level-id=42e01f
a=sendrecv
a=rtcp-fb:120 nack
a=rtcp-fb:120 nack pli
a=rtcp-fb:120 ccm fir
a=rtcp-fb:126 nack
a=rtcp-fb:126 nack pli
a=rtcp-fb:126 ccm fir
a=rtcp-fb:97 nack
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 ccm fir
a=setup:actpass
a=candidate:0 1 UDP 2128609535 192.168.1.100 4132 typ host
a=candidate:1 1 UDP 1692467199 188.253.146.208 23065 typ srflx raddr 192.168.1.100 rport 4132
a=candidate:0 2 UDP 2128609534 192.168.1.100 4133 typ host
a=candidate:1 2 UDP 1692467198 188.253.146.208 23066 typ srflx raddr 192.168.1.100 rport 4133
a=rtcp-mux
Is anybody have succeeded in it? Thanks.
Not possible without "something" in between the stream source (peer) and ffmpeg; until and unless ffmpeg starts working with DTLS and you know the hash information for the peer (obviously this could be in the SDP). So in summary, ffmpeg would need DTLS and ICE support. An alternative would be to use GStreamer with plugins.

Resources