User Tools

Site Tools


doc:appunti:hardware:raspberrypi_car

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:hardware:raspberrypi_car [2013/08/06 12:36] – [Raspberry Pi Car Device] niccolodoc:appunti:hardware:raspberrypi_car [2019/02/01 17:04] (current) niccolo
Line 1: Line 1:
 ====== Raspberry Pi Car Device ====== ====== Raspberry Pi Car Device ======
  
-===== Dongle USB Edimax =====+===== Dongle USB Edimax in Mode Master (Access Point) =====
  
-Ci vuole una versione custom di hostpad.... +Normalmente l'interfaccia WiFi lavora in modalità //managed//, cioè come cliente di un //Access Point//Si vuole invece configurare il Raspberry come Access Point, cioè far lavorare l'interfaccia WiFi in Master ModeNon tutte le combinazioni di **hardware** + **modulo kernel** + **software hostapd** supportano tale modalità.
-===== hostap =====+
  
-Si vuole che il Raspberry possa funzionare in **modo master** (access point), ma che sia facile passare al **modo managed** (station) in roaming.+  [[http://elinux.org/RPI-Wireless-Hotspot|RPI Wireless Hotspot]] 
 +  [[http://www.daveconroy.com/turn-your-raspberry-pi-into-a-wifi-hotspot-with-edimax-nano-usb-ew-7811un-rtl8188cus-chipset/|Raspberry-PI WiFi hotspot with Edimax]]
  
-La modalità master si ottiene con il software **hostapd**, i file di configurazione sono:+Ci vuole una **versione custom di hostapd**, forse occorre anche un **modulo kernel custom**, a seconda del chip WiFi. Vedere le seguenti pagine:
  
-  * **''/etc/default/hostapd''** +  * https://github.com/jenssegers/RTL8188-hostapd 
-  * **''/etc/hostapd/hostapd.conf''**+  * https://github.com/quickreflex/rtl8188eus 
 +  https://github.com/lwfinger/rtl8188eu
  
-Volendo avviare hostapd al bootstrap basta mettere in **''/etc/default/hostapd''** qualcosa del genere:+Pare che ci siano risultati diversi a seconda del chip (RTL8188CUS, RTL8188EUS, ecc.):
  
-<file> +  * **[[https://www.raspberrypi.org/forums/viewtopic.php?p=385731|Previously Unsupported Edimax WiFi Hotspot (working)]]** 
-DAEMON_CONF="/etc/hostapd/hostapd.conf" +  * **[[https://docs.google.com/document/d/16hJS7fnPyKUwbvR33_nMku_b6XcYaBJXVpeCIMoJzcQ/pub|Convert a Raspberry Pi B2 standalone Wifi-AP using REALTEK chipset (e.g. EDIMAX)]]** 
-</file>+  * **[[https://www.raspberrypi.org/forums/viewtopic.php?t=61816|RTL8188EUS cannot setup access point]]**
  
-tuttavia noi si vuole avviare l'interfaccia manualmente, quindi si imposta in **''/etc/network/interfaces''**:+Altri riferimenti web: 
 + 
 +  * [[http://blog.sip2serve.com/post/48420162196/howto-setup-rtl8188cus-on-rpi-as-an-access-point|Howto setup rtl8188cus on rpi as an access point]] 
 +  * [[http://dl.dropbox.com/u/1663660/hostapd/hostapd|hostapd custom]] 
 +  * [[http://www.geeked.info/raspberry-pi-add-multiple-wifi-access-points/|WPA Managed in Roaming]] 
 + 
 +===== wpa_supplicant ===== 
 + 
 +**''/etc/network/interfaces''**:
  
 <file> <file>
 allow-hotplug wlan0 allow-hotplug wlan0
-iface wifi_master inet static + 
-        address 192.168.5.1 +# WiFi in Client (Managed) mode 
-        netmask 255.255.255.0 +iface wlan0 inet manual 
-        up /usr/sbin/hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf || true+        wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf 
 + 
 +# If network stanza has not "id_str", wpa_supplicant will use "default"
 +iface default inet dhcp
 </file> </file>
  
-Le impostazioni diverse dal default in **''/etc/hostapd/hostapd.conf''** sono FIXME:+FIXME C'è un problema: l'opzione **''wpa-roam''** deve essere associata ad una interfaccia fisica (es. **''iface wlan0 ...''**) e di tipo ''manual'', non viene accettata su un'istanza di interfaccia logica (es. **''iface master ...''**) oppure di tipo ''dhcp''. L'istanza di ''wpa_supplicant'' lanciata in questo modo cerca quindi un'eventuale istanza di interfaccia logica col nome specificato dalla stringa **''id_str''** ''wpa_supplicant.conf'', altrimenti utilizza la stringa ''default'' (esempio sopra, che causa la configurazione via DHCP). 
 + 
 +Una conseguenza di tutto questo è che non si riesce a lanciare ''wpa_supplicant'' in modalità roaming utilizzando un nome logico, ad esempio **''ifup wlan0=managed''**, in quanto il cliente DHCP non viene eseguito. 
 + 
 +===== hostap ===== 
 + 
 +Al bootstrap il Raspberry funziona per default in **modo managed** (station) in roaming (vedi paragrafo precedente), si vuole un sistema semplice per passare al **modo master** (access point). 
 + 
 +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)
  
 <file> <file>
-# TODO: togliere il bridge? 
-bridge=br0 
 driver=rtl871xdrv driver=rtl871xdrv
 ssid=PiCar ssid=PiCar
Line 47: Line 70:
 rsn_pairwise=CCMP rsn_pairwise=CCMP
 </file> </file>
-===== wpa_supplicant ===== 
  
 +Volendo avviare hostapd al bootstrap basterebbe togliere il commento in **''/etc/default/hostapd''**:
 +
 +<file>
 +#DAEMON_CONF="/etc/hostapd/hostapd.conf"
 +</file>
 +
 +tuttavia noi si vuole avviare l'interfaccia manualmente, quindi si imposta in **''/etc/network/interfaces''**:
 +
 +<file>
 +allow-hotplug wlan0
 +
 +# WiFi in Access Point (Master) mode.
 +# Activate with: ifdown wlan0; ifup wlan0=master
 +iface 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
 +</file>
 +
 +in questo modo è possibile usare i comandi per fermare o avviare l'interfaccia nella modalità Master:
 +
 +<code>
 +ifdown wlan0
 +ifup wlan0=master
 +</code>
 +
 +===== wpa_supplicant o hostap, mapping automatico =====
 +
 +Si vuole un **sistema automatico** per decidere se attivare l'interfaccia WiFi in modo **managed** oppure **master**, in teoria il **mapping** fornito da ''/etc/network/interfaces'' di Debian dovrebbe essere lo strumento adeguato.
 +
 +
 +===== dnsmasq =====
 +
 +===== Alimentazione a batteria =====
 +
 +Si è provato ad alimentare il Raspberry con un **2200mAh Li-Ion Rechargeable Power Bank** [[http://uk.rs-online.com/web/p/power-banks/7757504/|(RS Article: 7757504)]] ({{2200mah_power_bank.pdf|data sheet}}), caricato a sua volta tramite adattatore accendisigari-USB da 2A. Una situazione del tutto simile a quella descritta in questo articolo: [[http://raspi.tv/2013/testing-rs-5200-mah-usb-lithium-battery-pack-as-a-ups|Testing RS 5200 mAh USB lithium battery pack as a UPS]]. Sembra che in queste condizioni **la batteria è sempre sotto carica**, cioè una condizione non ottimale per la sua durata.
 +
 +Nelle nostre condizioni il Raspberry è rimasto in funzione per oltre 24 ore, ma **alla fine si è spento**, si suppone per scaricamento della batteria e quindi per alimentazione insufficiente.
 +
 +Una soluzione migliore potrebbe essere quella di utilizzare un circuito specifico per la ricarica/alimentazione, tipo questo: [[http://www.robotshop.com/productinfo.aspx?pc=RB-See-213&lang=en-US|SeeedStudio USB Charger]]. È specifico per batteria LiPo (litio-polimeri), mentre il power bank di cui sopra è litio-ioni, farà differenza?
 +
 +Attenzione alle batterie litio-polimeri! Hanno una resistenza interna molto bassa e quindi sono a rischio di carica/scarica violentissma, queste potrebbero essere le conseguenze: [[http://rc.runryder.com/helicopter/t519305p1/|Just a caution to all of you who play with Lipo's]].
doc/appunti/hardware/raspberrypi_car.1375785396.txt.gz · Last modified: 2013/08/06 12:36 by niccolo