Author: FransM

WiFi module

[Copy link]

0

threads

31

posts

109

credits

Registered member

Rank: 2

credits
109
Published in 2015-12-15 15:04:40 | Show all floors
Edited by miha at 2015-12-15 15:07

<removed due duplicate post>

0

threads

31

posts

109

credits

Registered member

Rank: 2

credits
109
Published in 2015-12-15 15:27:53 | Show all floors
Edited by miha at 2015-12-15 15:51

Hi,

I put psk on file /et/wpa_supplicant.conf inside quotation marks and now error message is different. I also recreated file with wpa_passphrase.

Current error message is:

  1. #  wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf -dd
  2. wpa_supplicant v1.0
  3. random: Trying to read entropy from /dev/random
  4. Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
  5. Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
  6. Reading configuration file '/etc/wpa_supplicant.conf'
  7. ctrl_interface='/var/run/wpa_supplicant'
  8. Line: 4 - start of a new network block
  9. ssid - hexdump_ascii(len=4):
  10.      6d 79 53 53 49 44                                       mySSID            
  11. Line 6: Invalid passphrase length 68 (expected: 8..63) 'psk=59b35a9ce10a19d9b895249d3be3fa481336232ffef0e1c313ceea72cdb1febb"'.
  12. Line 6: failed to parse psk '"psk=59b35a9ce10a19d9b895249d3be3fa481336232ffef0e1c313ceea72cdb1febb"'.
  13. key_mgmt: 0x2
  14. proto: 0x3
  15. pairwise: 0x18
  16. group: 0x18
  17. Line 11: WPA-PSK accepted for key management, but no PSK configured.
  18. Line 11: failed to parse network block.
  19. Failed to read or parse configuration '/etc/wpa_supplicant.conf'.
  20. Failed to add interface wlan0
  21. : Cancelling scan request
  22. : Cancelling authentication timeout
  23. #
Copy code


My WLAN device is Apple's Airport Extreme and wireless type WPA Personal. I don't want to change password on Airport since it would require changing password to each device on my network and for example changing password for my printer is task that i don't want to do "if it works, don't touch it"

EDIT: I fired up temporary WLAN with name 'TANA' and password '12345678' and configuration file looks now:

  1. ctrl_interface=/var/run/wpa_supplicant
  2. network={
  3.         ssid="TANA"
  4.         #psk="12345678"
  5.         psk=1240d48e8b3d658eb652cf847a55f46a15bc7c5fe5b17a4e05c551c0bcc58650
  6.         key_mgmt=WPA-PSK
  7.         proto=RSN WPA
  8.         pairwise=CCMP TKIP
  9.         group=CCMP TKIP
  10. }
Copy code


Commands wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf -dd and dmesg outputs:

  1. root@miha:~#  wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf -dd
  2. wpa_supplicant v1.0
  3. random: Trying to read entropy from /dev/random
  4. Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
  5. Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
  6. Reading configuration file '/etc/wpa_supplicant.conf'
  7. ctrl_interface='/var/run/wpa_supplicant'
  8. Line: 4 - start of a new network block
  9. ssid - hexdump_ascii(len=4):
  10.      54 41 4e 41                                       TANA            
  11. PSK - hexdump(len=32): [REMOVED]
  12. key_mgmt: 0x2
  13. proto: 0x3
  14. pairwise: 0x18
  15. group: 0x18
  16. Priority group 0
  17.    id=0 ssid='TANA'
  18. WEXT: cfg80211-based driver detected
  19. wext: interface wlan0 phy: phy0
  20. rfkill: Cannot open RFKILL control device
  21. WEXT: RFKILL status not available
  22. SIOCGIWRANGE: WE(compiled)=22 WE(source)=16 enc_capa=0xf
  23.   capabilities: key_mgmt 0xf enc 0xf flags 0x0
  24. ioctl[SIOCSIWAP]: Operation not permitted
  25. WEXT: Failed to clear BSSID selection on disconnect
  26. netlink: Operstate: linkmode=1, operstate=5
  27. wlan0: Own MAC address: 58:63:56:c8:eb:2c
  28. wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0
  29. wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0
  30. wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0
  31. wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0
  32. wpa_driver_wext_set_key: alg=0 key_idx=4 set_tx=0 seq_len=0 key_len=0
  33. ioctl[SIOCSIWENCODEEXT]: Invalid argument
  34. Driver did not support SIOCSIWENCODEEXT
  35. wpa_driver_wext_set_key: alg=0 key_idx=5 set_tx=0 seq_len=0 key_len=0
  36. ioctl[SIOCSIWENCODEEXT]: Invalid argument
  37. Driver did not support SIOCSIWENCODEEXT
  38. wpa_driver_wext_set_countermeasures
  39. wlan0: RSN: flushing PMKID list in the driver
  40. wlan0: Setting scan request: 0 sec 100000 usec
  41. WPS: Set UUID for interface wlan0
  42. WPS: UUID based on MAC address - hexdump(len=16): f9 1c de 3d a5 4f 5c 8b 96 62 48 c4 8a bb 5a 2e
  43. EAPOL: SUPP_PAE entering state DISCONNECTED
  44. EAPOL: Supplicant port status: Unauthorized
  45. EAPOL: KEY_RX entering state NO_KEY_RECEIVE
  46. EAPOL: SUPP_BE entering state INITIALIZE
  47. EAP: EAP entering state DISABLED
  48. EAPOL: Supplicant port status: Unauthorized
  49. EAPOL: Supplicant port status: Unauthorized
  50. Using existing control interface directory.
  51. wlan0: Added interface wlan0
  52. Daemonize..


  53. #dmesg
  54. [12553.771337] RsvdPageNum: 8
  55. [12557.827894] RTL871X: sta recv deauth reason code(2) sta:00:1e:52:7a:a3:2a, ignore = 0
  56. [12557.840739] hw_var_set_bssid   reg=618
  57. [12558.593715] RTL871X: set bssid:cc:5d:4e:83:8b:88
  58. [12558.593850] RTL871X: set ssid [TANA] fw_state=0x00000088
  59. [12558.593890] hw_var_set_bssid   reg=618
  60. [12558.599007] RTL871X: set bssid:cc:5d:4e:83:8b:88
  61. [12558.599115] RTL871X: set ssid [TANA] fw_state=0x00000088
  62. [12558.682353] RTL871X: start auth
  63. [12558.685510] RTL871X: auth success, start assoc
  64. [12558.691901] RTL871X: assoc success
  65. [12558.711312] RsvdPageNum: 8
  66. [12565.032403] RTL871X: sta recv deauth reason code(15) sta:cc:5d:4e:83:8b:88, ignore = 0
  67. [12565.050690] hw_var_set_bssid   reg=618
Copy code


Now I need help from you to proceed further.

Br
-miha

0

threads

31

posts

109

credits

Registered member

Rank: 2

credits
109
Published in 2015-12-15 21:12:18 | Show all floors
Hi,

Managed to fix problems related to wifi, OPI+ connects now to my WPA2-PSK WLAN on boot automatically.

Solution is not very sophisticated but works and that's most important thing for me.

Current status of configuration files:
/etc/wpa_supplicant.conf:

  1. ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
  2. update_config=1

  3. network={
  4.     ssid="mySSID"
  5.     proto=RSN
  6.     key_mgmt=WPA-PSK
  7.     pairwise=CCMP TKIP
  8.     group=CCMP TKIP
  9.     psk="Password_on_PLAIN_text"
  10. }
Copy code


/etc/network/interfaces :

  1. # interfaces(5) file used by ifup(8) and ifdown(8)
  2. auto lo
  3. iface lo inet loopback

  4. # allow-hotplug wlan0
  5. iface wlan0 inet manual
  6. wpa-roam /etc/wpa_supplicant.conf
  7. iface default net dhcp
Copy code


And added following lines to /etc/rc.local

  1. /sbin/ifconfig  wlan0 down
  2. /sbin/ifconfig  wlan1 down
  3. /sbin/ifconfig  wlan0 up
  4. /sbin/dhclient wlan0
Copy code


Tested by booting several times, survives also if only networking is restarted.

Br
-miha


0

threads

31

posts

109

credits

Registered member

Rank: 2

credits
109
Published in 2015-12-15 21:41:35 | Show all floors
Well, wifi works ONLY if wired is connected...more troubleshooting,,
Published in 2015-12-15 23:02:03 | Show all floors
miha replied at 2015-12-15 21:41
Well, wifi works ONLY if wired is connected...more troubleshooting,,

Is this not just the 'usual' default route problem?
The default route pointing to the Ethernet interface and therefore preventing access to the outside when no cable is connected. Have seen this a few times and could be solved by using if-up/if-down scripts adjusting the default route accordingly.

0

threads

31

posts

109

credits

Registered member

Rank: 2

credits
109
Published in 2015-12-15 23:10:10 | Show all floors
Hi,

Yes, i believe that this is the default GW issue. Figuring out how to handle situation.

-miha

0

threads

31

posts

109

credits

Registered member

Rank: 2

credits
109
Published in 2015-12-15 23:27:04 | Show all floors
First test failed:

  1. # route -n
  2. Kernel IP routing table
  3. Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  4. 0.0.0.0         192.168.255.1   0.0.0.0         UG    0      0        0 eth0
  5. 192.168.255.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
  6. 192.168.255.0   0.0.0.0         255.255.255.0   U     0      0        0 wlan0
  7. #
  8. #
  9. #
  10. # route add default gw 192.168.255.1 wlan0
  11. # route -n
  12. Kernel IP routing table
  13. Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  14. 0.0.0.0         192.168.255.1   0.0.0.0         UG    0      0        0 wlan0
  15. 0.0.0.0         192.168.255.1   0.0.0.0         UG    0      0        0 eth0
  16. 192.168.255.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
  17. 192.168.255.0   0.0.0.0         255.255.255.0   U     0      0        0 wlan0
  18. # route del default gateway 192.168.255.1 eth0
  19. #
  20. # route -n
  21. Kernel IP routing table
  22. Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  23. 0.0.0.0         192.168.255.1   0.0.0.0         UG    0      0        0 wlan0
  24. 192.168.255.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
  25. 192.168.255.0   0.0.0.0         255.255.255.0   U     0      0        0 wlan0
  26. #
  27. # ifconfig  eth0 down
  28. packet_write_wait: Connection to 192.168.255.15: Broken pipe
Copy code

0

threads

31

posts

109

credits

Registered member

Rank: 2

credits
109
Published in 2015-12-16 00:48:10 | Show all floors
Edited by miha at 2015-12-16 01:59

Well, I'll take some distance to this. I had same problems with cubietruck and then i decided to plug LAN-cable and forgot crappy combination Linux&WLAN.
I'll keep trying with OPI+ but break is now needed.

-miha
EDIT: Yep, definetely routing issue. ssh to wlan ip work inside OPI+ but not from outside and I haven't figured out how to solve this.

Flushed all from routing table with  #ip route flush table main

Now I would like to set gw-setting like on my cubietruck:

  1. miha@ct ~ $ route -n
  2. Kernel IP routing table
  3. Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  4. 0.0.0.0         192.168.255.1   0.0.0.0         UG    0      0        0 eth0
  5. 192.168.255.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
  6. miha@ct ~ $
Copy code


But wlan0 instead of eth0. Second line is quite easy, #ip route add 192.168.255.0/24 wlan0 gives almost same line but G is missing from Flags and my brains are frozen to solve this and how to get first line.



0

threads

31

posts

109

credits

Registered member

Rank: 2

credits
109
Published in 2015-12-16 16:04:35 | Show all floors
Edited by miha at 2015-12-16 16:11

Hi,

I have now played lot of with my OPI+, managed to cut all connections in and out but that is fixed with magic ip route-command

Currently ssh in and out works directly after boot IF lan-cable is connected.


  1. root@tiger:~# ifconfig
  2. eth0      Link encap:Ethernet  HWaddr b2:56:88:8a:eb:bd  
  3.           inet addr:192.168.255.15  Bcast:192.168.255.255  Mask:255.255.255.0
  4.           inet6 addr: fe80::b056:88ff:fe8a:ebbd/64 Scope:Link
  5.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  6.           RX packets:311 errors:0 dropped:0 overruns:0 frame:0
  7.           TX packets:213 errors:0 dropped:0 overruns:0 carrier:0
  8.           collisions:0 txqueuelen:1000
  9.           RX bytes:29135 (28.4 KiB)  TX bytes:26402 (25.7 KiB)
  10.           Interrupt:114
  11. --clip--

  12. wlan0     Link encap:Ethernet  HWaddr 58:63:56:c8:eb:2c  
  13.           inet addr:192.168.255.7  Bcast:192.168.255.255  Mask:255.255.255.0
  14.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  15.           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  16.           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  17.           collisions:0 txqueuelen:1000
  18.           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
Copy code


I set static IP for eth0 and wlan0 on /etc/network/interfaces -file:


  1. miha@tiger:~$ cat /etc/network/interfaces
  2. # interfaces(5) file used by ifup(8) and ifdown(8)
  3. auto lo
  4. iface lo inet loopback

  5. auto eth0
  6. iface eth0 inet static
  7.         address 192.168.255.15
  8.         netmask 255.255.255.0
  9.         gateway 192.168.255.1

  10. auto wlan0
  11. iface wlan0 inet static
  12.         address 192.168.255.7
  13.         netmask 255.255.255.0
  14.         gateway 192.168.255.1
  15.         wpa-essid mySSID
  16.         wpa-psk 12345678
  17. miha@tiger:~$
Copy code


After restart, without LAN-cable, status is:

  1. root@tiger:~# route -n
  2. Kernel IP routing table
  3. Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  4. 0.0.0.0         192.168.255.1   0.0.0.0         UG    0      0        0 eth0
  5. 192.168.255.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
  6. 192.168.225.0   0.0.0.0          255.255.255.0   U     0      0        0 wlan0  

  7. Or with ip-command:
  8. root@tiger:~# ip route show
  9. default via 192.168.255.1 dev eth0
  10. 192.168.255.0/24 dev eth0 proto kernel scope link src 192.168.255.15
  11. 192.168.255.0/24 dev wlan0 proto kernel scope link src 192.168.255.7
Copy code


Does not respond to ping, I can see from above that default needs to be changed somehow. I am not very familiar with routing commands...

Thanks
-miha

0

threads

31

posts

109

credits

Registered member

Rank: 2

credits
109
Published in 2015-12-16 16:49:45 | Show all floors
Edited by miha at 2015-12-16 17:35

Well....

SSH in via wlan0 works now, even when eth0 is unplugged.

Status of routing is:

  1. root@tiger:~# ip route show
  2. default via 192.168.255.1 dev wlan0
  3. 192.168.255.0/24 dev wlan0  scope link
  4. root@tiger:~#
Copy code


These commands brings wlan0 alive:

  1. root@tiger:~# ip route del 0/0
  2. root@tiger:~# ip route del 192.168.255.0/24 dev eth0
  3. root@tiger:~# ip route add default via 192.168.255.1
  4. root@tiger:~# ip route show
  5. default via 192.168.255.1 dev wlan0
  6. 192.168.255.0/24 dev wlan0  proto kernel  scope link  src 192.168.255.7
  7. root@tiger:~#
  8. root@tiger:~#
  9. root@tiger:~#
Copy code


Now i need to implement commands to boot up procedure.
Br
-miha

EDITirty but working solution; added following to /etc/rc.local

  1. /sbin/ip route del 0/0
  2. /sbin/ip route del 192.168.255.0/24 dev eth0
  3. /sbin/ip route add default via 192.168.255.1
Copy code


I know that correct place is not rc.local, instead of that post-up command(s) should be used on file /etc/network/interfaces since rc.local will be executed  only on boot, so correction is needed for this still.
Also, eth0 is not usable at the moment but that's not an issue since place where I am going to locate OPI+ has no LAN (RJ45) available.  

Br
-miha



You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list