User Tools

Site Tools


doc:appunti:hardware:raspberrypi_car

This is an old revision of the document!


Raspberry Pi Car Device

Dongle USB Edimax

Ci vuole una versione custom di hostpad….

hostap

Si vuole che il Raspberry possa funzionare in modo master (access point), ma che sia facile passare al modo managed (station) in roaming.

La modalità master si ottiene con il software hostapd, i file di configurazione sono:

  • /etc/hostapd/hostapd.conf
  • /etc/default/hostapd

Le funzioni di Access Point si configurano in /etc/hostapd/hostapd.conf, le impostazioni diverse dal default sono: (FIXME)

# TODO: togliere il bridge?
bridge=br0
driver=rtl871xdrv
ssid=PiCar
country_code=IT
channel=7
auth_algs=1
wmm_enabled=0
wpa=1
# TODO: usare un file di password?
wpa_passphrase=MySecret
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Volendo avviare hostapd al bootstrap basta mettere in /etc/default/hostapd qualcosa del genere:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

tuttavia noi si vuole avviare l'interfaccia manualmente, quindi si imposta in /etc/network/interfaces:

allow-hotplug wlan0
iface wifi_master inet static
        address 192.168.5.1
        netmask 255.255.255.0
        up   start-stop-daemon --start --oknodo --quiet --exec /usr/sbin/hostapd --pidfile /var/run/hostapd.pid -- -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf >/dev/null || true
        down start-stop-daemon --stop  --oknodo --quiet --exec /usr/sbin/hostapd --pidfile /var/run/hostapd.pid || true

in questo modo è possibile usare i comandi per avviare o fermare l'interfaccia nella modalità Master:

ifup wlan0=wifi_master
ifdown wlan0=wifi_master

wpa_supplicant

doc/appunti/hardware/raspberrypi_car.1375786122.txt.gz · Last modified: 2013/08/06 12:48 by niccolo