Configuration WIFI beaglebone black avec Debian

Bonjour,

Je travaille actuellement sur une beagle bone black avec Debian 8.4. j’y ai connecte un dongle WIFI de marque inconnue avec un chipset “Ralink Technology, Corp. RT5370 Wireless Adapter”. Je me connecte a une livebox 3 FR.

Je travaille en ligne de commande uniquement.

J’arrive a me connecter au reseau avec le dongle (ping a l’appui ci dessous) au travers de l’interface wlan0, mais pas automatiquement et c’est justement ce que je voudrais faire. Pour l’instant, apres le boot, je dois taper les commandes suivantes dans une fenetre ssh ( cable usb0) sudo ifdown wlan0 et sudo ifup wlan0.

immediatement apres le boot, j’obtiens:

###########################
debian@beaglebone:~$ifconfig
eth0 Link encap:Ethernet HWaddr d0:39:72:38:af:50
UP BROADCAST MULTICAST DYNAMIC MTU:1500 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:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:175

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:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:12960 (12.6 KiB) TX bytes:12960 (12.6 KiB)

usb0 Link encap:Ethernet HWaddr d0:39:72:38:af:51
inet addr:192.168.7.2 Bcast:192.168.7.3 Mask:255.255.255.252
inet6 addr: fe80::d239:72ff:fe38:af51/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:80 errors:0 dropped:0 overruns:0 frame:0
TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13564 (13.2 KiB) TX bytes:16502 (16.1 KiB)

wlan0 Link encap:Ethernet HWaddr 7c:dd:90:8b:9f:1a
inet6 addr: fe80::7edd:90ff:fe8b:9f1a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:44 errors:0 dropped:0 overruns:0 frame:0
TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12353 (12.0 KiB) TX bytes:8636 (8.4 KiB)
##########################################

##########################################
debian@beaglebone:~$ iwconfig
wlan0 IEEE 802.11bgn ESSID:"Livebox-CFFC"
Mode:Managed Frequency:2.412 GHz Access Point: 40:C7:29:34:CF:FC
Bit Rate=9 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=70/70 Signal level=-33 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:16 Missed beacon:0

lo no wireless extensions.

eth0 no wireless extensions.

usb0 no wireless extensions.

can0 no wireless extensions.

can1 no wireless extensions.
############################################

############################################
debian@beaglebone:~$ sudo ping -www.google.fr -c 5
ping: unknown host -www.google.fr
############################################

############################################
debian@beaglebone:~$ more /etc/network/interfaces
#This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet dhcp
# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE

# The secondary network interface
#auto eth1
#iface eth1 inet dhcp

# WiFi use: -> connmanctl
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

# Ethernet/RNDIS gadget (g_ether)
# Used by: /opt/scripts/boot/autoconfigure_usb0.sh
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.252
network 192.168.7.0
gateway 192.168.7.1
############################################

############################################
debian@beaglebone:~$ more /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="Livebox-CFFC"
psk=e52a130d07553afebc7c68623d645ee81fb109bc419ad23a84c2a926b5e9b837
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
}
############################################

############################################
debian@beaglebone:~$ sudo ifdown wlan0
Killed old client process
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit -https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/7c:dd:90:8b:9f:1a
Sending on LPF/wlan0/7c:dd:90:8b:9f:1a
Sending on Socket/fallback
DHCPRELEASE on wlan0 to 192.168.1.1 port 67
send_packet: Network is unreachable
send_packet: please consult README file regarding broadcast address.
dhclient.c:2331: Failed to send 300 byte long packet over fallback interface.
############################################

############################################
debian@beaglebone:~$ sudo ifup wlan0
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit -https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/7c:dd:90:8b:9f:1a
Sending on LPF/wlan0/7c:dd:90:8b:9f:1a
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.1.1
DHCPACK from 192.168.1.1
bound to 192.168.1.19 – renewal in 39823 seconds.
############################################

############################################
debian@beaglebone:~$ sudo ping -www.google.fr -c 5
PING -www.google.fr (216.58.208.131) 56(84) bytes of data.
64 bytes from lhr25s08-in-f3.1e100.net (216.58.208.131): icmp_seq=1 ttl=51 time=44.1 ms
64 bytes from lhr25s08-in-f3.1e100.net (216.58.208.131): icmp_seq=2 ttl=51 time=43.7 ms
64 bytes from lhr25s08-in-f3.1e100.net (216.58.208.131): icmp_seq=3 ttl=51 time=44.5 ms
64 bytes from lhr25s08-in-f3.1e100.net (216.58.208.131): icmp_seq=4 ttl=51 time=44.0 ms
64 bytes from lhr25s08-in-f3.1e100.net (216.58.208.131): icmp_seq=5 ttl=51 time=44.8 ms

— -www.google.fr ping statistics —
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 43.702/44.273/44.847/0.459 ms
############################################

On voit qu’apres le boot, le dongle n’a pas recupere d’adresse IP, pouvez-vous m’aider a comprendre pourquoi?

d’autre part juste apres le boot, avec la commande suivante, j’obtiens ceci ci-dessous. Je suis un peu perdu dans qui fait quoi pour la configuration du wifi. pouvez-vous me pointer sur des docs ou m’expliquer la procedure? je voudrais reellement comprendre le sequencement de la configuration.

Merci a vous. bonne journee.

############################################
debian@beaglebone:~$ sudo wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0
Successfully initialized wpa_supplicant
wlan0: SME: Trying to authenticate with 40:c7:29:34:cf:fc (SSID=‘Livebox-CFFC’ freq=2412 MHz)
wlan0: CTRL-EVENT-DISCONNECTED bssid=40:c7:29:34:cf:fc reason=2 locally_generated=1
wlan0: Trying to associate with 40:c7:29:34:cf:fc (SSID=‘Livebox-CFFC’ freq=2412 MHz)
wlan0: Associated with 40:c7:29:34:cf:fc
wlan0: WPA: Invalid EAPOL-Key MIC when using TPTK - ignoring TPTK
wlan0: WPA: Could not verify EAPOL-Key MIC - dropping packet
wlan0: WPA: Invalid EAPOL-Key MIC when using TPTK - ignoring TPTK
wlan0: WPA: Could not verify EAPOL-Key MIC - dropping packet
wlan0: Authentication with 40:c7:29:34:cf:fc timed out.
wlan0: CTRL-EVENT-DISCONNECTED bssid=40:c7:29:34:cf:fc reason=3 locally_generated=1
wlan0: SME: Trying to authenticate with 40:c7:29:34:cf:fc (SSID=‘Livebox-CFFC’ freq=2412 MHz)
wlan0: Associated with 40:c7:29:34:cf:fc
wlan0: Authentication with 40:c7:29:34:cf:fc timed out.
wlan0: CTRL-EVENT-DISCONNECTED bssid=40:c7:29:34:cf:fc reason=3 locally_generated=1
wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid=“Livebox-CFFC” auth_failures=1 duration=10 reason=WRONG_KEY
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid=“Livebox-CFFC” auth_failures=2 duration=20 reason=CONN_FAILED
wlan0: CTRL-EVENT-DISCONNECTED bssid=40:c7:29:34:cf:fc reason=3 locally_generated=1
wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="Livebox-CFFC"
wlan0: SME: Trying to authenticate with 40:c7:29:34:cf:fc (SSID=‘Livebox-CFFC’ freq=2412 MHz)
wlan0: Trying to associate with 40:c7:29:34:cf:fc (SSID=‘Livebox-CFFC’ freq=2412 MHz)
wlan0: Associated with 40:c7:29:34:cf:fc
wlan0: CTRL-EVENT-DISCONNECTED bssid=40:c7:29:34:cf:fc reason=3 locally_generated=1
wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid=“Livebox-CFFC” auth_failures=3 duration=30 reason=WRONG_KEY
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid=“Livebox-CFFC” auth_failures=4 duration=60 reason=CONN_FAILED
wlan0: CTRL-EVENT-SCAN-FAILED ret=-16 retry=1
^Cnl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: CTRL-EVENT-TERMINATING
###########################################

Dans une de mes configurations fonctionnelles, j’ai mis allow-hotplug à la place de auto, essaie pour voir…