La scheda Arduino Yun è dotata di una interfaccia wireless embedded. Purtroppo tale interfaccia non consente l’utilizzo di una antenna esterna.
In effetti osservando lo Yun si può notare un connettore simile a quello U.FL per le antenne:
In realtà tale connettore, come spiegato sul forum ufficiale, viene utilizzato solo per testing e non è consigliato per un uso continuo.
Fortunatamente è possibile utilizzare degli economici adattatori USB->wifi che abbiano la possibilità di collegare antenne esterne, vediamo come fare…
Adattatori compatibili
Per prima cosa è importante scegliere un adattatore compatibile con la distribuzione Linux in esecuzione sullo Yun. Il mio consiglio è di verificare che i moduli kernel necessari per l’adattatore scelto siano inclusi nell’elenco dei pacchetti disponibili.
Io ho scelto un adattatore basato su chipset Ralink RT5370 (acquistato su eBay per circa 8 euro):
Configurazione
Una volta collegato alla porta USB dello Yun, lanciando il comando dmesg si nota come Linux abbia riconosciuto l’adattatore ma non abbia ancora a disposizione i drivers per utilizzarlo:
Per installare i corretti drivers, Yun deve essere collegato ad Internet. Eseguiamo i comandi:
opkg update opkg install kmod-rt2800-lib kmod-rt2800-usb kmod-rt2x00-lib kmod-rt2x00-usb |
Lanciando nuovamente dmesg, si vede che ora Linux ha registrato il driver corretto:
Per proseguire, eseguiamo un reboot del nostro Yun.
Dopo il reboot, il file /etc/config/wireless dovrebbe contenere la configurazione anche per il secondo adattatore radio1 (radio0 è quello onboard):
Configuriamo la connessione wifi attraverso il pannello di controllo web: clicchiamo Configure, quindi advanced configuration panel.
Selezioniamo il tab Network, quindi Wifi. Il nuovo adattatore viene visualizzato in stato disabled or not associated:
Per collegarci ad una rete wifi esistente, clicchiamo Scan:
Selezioniamo la rete wifi e clicchiamo Join Network:
Inseriamo la password, un nome per la connessione (io ho scelto wlan1) e come zona del firewall scegliamo lan:
Confermiamo con Submit, infine con Save & Apply.
Tornando nella tab Network, ora verrà visualizzata la nuova connessione wifi e Yun sarà raggiungibile in rete:
FANTASTICO!!!!! grazie mille per la tua guida!
Ciao Luca, scusa ma ho un’altra domanda.
Quindi se installo la Yun all’interno di una macchina carenata in metallo sono obbligato ad installare una antenna esterna per riuscire a captare il wifi ? se si…..
Se l’USB l’ho impegnata per la famosa interfaccia seriale per collegare il modulo HC-06 Bluetooth …. come faccio a metterci anche l’antenna ?
Grazie infinite.
Sì: un contenitore metallico blocca il segnale quindi sei obbligato a installare una antenna esterna. Il vantaggio dell’USB è che puoi tranquillamente collegare allo Yun un hub (meglio se alimentato!) e moltiplicare con quello le porte USB disponibili.
Ciao Luca,
ho eseguito alcune prove abbastanza massacranti sulla mia Yun. Richiusa nella famigerata carenatura metallica, con mio sommo piacere e soprattutto solievo, ho potuto testare la potenza del suo wi-fi. Effettivamente nei pressi della macchina segnale PIENO e sito installato sulla SD eseguibile in continuo refresh anche da più di 10 metri all’interno della stessa stanza. La temperatura di esercizio dentro la carena è di circa 45-50 °C ed è pure raggiunda da umidità prodotta da vapore che può trafilare verso l’interno della carena stessa.
La macchina presenta solo delle aperture nella parte bassa. Probabilmente funziona così bene grazie a queste.
Ci tenevo a comunicare questo perché chi ha condizioni simili alle mie, non si scoraggia ancora prima di iniziare.
grazie mille Mauro per aver condiviso la tua esperienza con la Yun, sarà sicuramente utile ad altri amici del blog!
Does it work also as a hotspot like the basic Yun’s wifi?
thanks
Hi! Yes it works, you can configure it using Luci webinterface
Thank you!
Ciao Luca,
grazie innanzitutto del post, ne cercavo uno così da tempo.
Vorrei anch’io rendere in modalità hotspot la nuova interfaccia dongle ma non riesco.
Ho installato i pacchetti correttamente e openwrt mi vede il dongle.
Poi sono entrato in luci e nella sezione Wifi ho cliccato su “enable” nella corrispondente sezione della nuova interfaccia.
Quindi il vecchio wifi si è scollegato e dal pc ho potuto vedere il nuovo “OpenWrt” . Purtroppo non riesco a connettermi poichè sul simbilo del Wifi mi compare il punto escalmativo di connessione limitata.
[…]
Sbaglio qualcosa? Sai darmi una mano?
Ti ringrazio per la disponibilità
Ciao Marco, connessione limitata potrebbe indicare che non funziona il DHCP server sullo Yun e quindi il PC non prende un indirizzo… hai provato a riavviare lo Yun?
Grazie per la risposta, sì credo sia questo il problema.
La yun si riavvia automaticamente di continuo. Tral’altro non so più come fare fare il factory reset perché nessuno dei 2 wifi funziona .
PS: sono riuscito con YunSerialTerminal e poi con putty a ripristinare il wifi interno, hai idee per il DHCP di linino? grazie
I bought mentioned antenna and I use ubuntu for setup the driver of device. it says opkg is not found did you mean dpkg. So i could not do that. Please help.
Hi! opkg is the packet manager for the Arduino Yun (http://arduino.cc/en/Tutorial/YunPackageManager), how could it be missing on your Yun?
I want to use USB Wifi Adapter too for my Yun, and I am excited when seeing this post, so I try to buy an USB dongle which look the same with yours.
But, when I plug it to the Yun, it detects that it is actually MT7601.
Can I use it? I am still new to OpenWRT so I don’t know how to install it (since I can’t install it with the way you do with “opkg install kmod ….”)
thanks
Hi, unfortunately it’s not easy to use your USB wifi dongle with OpenWRT… I found this project but it requires a bit of work (compiling…)
yeah, I’ve been reading about using MT7601 on openwrt, and from that link it’s said that we have to build our own package.
I will try it first, but if it fails I will just look for another USB wifi dongle and make sure it is using RT5370
thank you!
Ciao Luca, ti ringrazio perché questo è proprio il post che stavo cercando, in quanto ho abbandonato per sfinimento la ricerca di un adattatore dallo strano connettore onboard al classico SMA per l’estensione dell’antenna wifi (anche nel mio caso ho tutto in un case metallico). Volevo chiederti se i driver degli adattatori wifi USB compatibili con Linux possono essere scaricati e installati anche tramite l’interfaccia web dello Yùn o solo tramite riga di comando (o se alcuni modelli addirittura si autoinstallano). Grazie mille
Doesn’t seem to work anymore as it has been removed from the package list. I have tried downloading it directly(wget) and install the files manually only to find an endless dependency errors. Could you share a backup image of your Yun(after removing your credentials of course)?
Hi Dave! Are you sure? I can’t try now (my Yun is running a project) but I found recent posts in the Yun forum about the use of those kernel modules with the latest YunOS image…
Hi! Very interesting post.
But once I know the chipset of my wifi dongle how do I choose the correct driver package from the list of your link to the arduino website?
How did you know that for the Ralink chipset you needed right that specific driver?
Btw I have a Digicom wave 54.
Thank you
Hi John, unfortunately there’s no a generic answer to your question… google may help (searching for “USB WAVE 54 linux” brought me to the zd1211b chipset) but it may be a pain to find and install a suitable module (sometimes you must compile it!). It’s very easier to buy a supported dongle, from the official OpenWRT list.
Hi Luca,
I’m also trying to connect the wifi usb adapter to my arduino yun.
but when I try to install the drivers it tells me
Unknown package ‘kmod-rt2800-lib’.
Unknown package ‘kmod-rt2800-usb’.
Unknown package ‘kmod-rt2x00-lib’.
Unknown package ‘kmod-rt2x00-usb’.
Collected errors:
* opkg_install_cmd: Cannot install package kmod-rt2800-lib.
* opkg_install_cmd: Cannot install package kmod-rt2800-usb.
* opkg_install_cmd: Cannot install package kmod-rt2x00-lib.
* opkg_install_cmd: Cannot install package kmod-rt2x00-usb.
Hi! Is your Yun connected to the Internet? Did you enter the “opkg update” command before trying to install the modules?
yes I did
I finally got it to work. I had to update my yun linux to the latest version.
But I’m having a hard time connecting another device the MOD-WIFI-R5370-ANT wifi as it say “Failed to obtain IP”
Ciao Luca,
bellissima spiegazione. Una volta funzionante l’adattatore, posso disabilitare il wifi onborad?
assolutamente sì!
Hello,
My Yun doesn’t display the description of my antenna.
Do you have some ideas?
Take a look at the dmesg output… the Yun probably didn’t recognize the dongle…
Hi Luca,
Everything went well and i’ve got the message”new interface driver process rt2800usb”, but when i reboot yun and check for config-wifi device it’s still in radio0 🙁 Do you have idea what could be?
Thanks so much!
Salve,
a me il wifi non serve, è possibile disattivarlo senza problemi? ho sentito parlare di continui riavvii. A me serve solo la connessione via lan per la programmazione, il restante tempo sarà indipendente da wifi e lan.
Ciao Graziano: assolutamente sì, se non ti serve puoi spegnere direttamente l’interfaccia wifi.
Ciao Luca, complimenti per la guida.
Ho eseguito le istruzioni di installazione delle librerie, ma quando lancio il comando dmesg ho una serie di errori di questo tipo:
[ 39.400000] rt2800usb: Unknown symbol rt2x00mac_sw_scan_complete (err 0)
[ 39.410000] rt2800usb: Unknown symbol rt2800_config_shared_key (err 0)
[ 39.410000] rt2800usb: Unknown symbol rt2x00mac_add_interface (err 0)
[ 39.410000] rt2800usb: Unknown symbol rt2800_enable_radio (err 0)
[ 39.420000] rt2800usb: Unknown symbol rt2800_reset_tuner (err 0)
[ 39.420000] rt2800usb: Unknown symbol rt2x00mac_get_stats (err 0)
[ 39.420000] rt2800usb: Unknown symbol rt2x00mac_sta_remove (err 0)
[ 39.420000] rt2800usb: Unknown symbol rt2x00lib_txdone_noinfo (err 0)
[ 39.430000] rt2800usb: Unknown symbol rt2800_link_stats (err 0)
……..
Ciao Angelo, davvero strano… stai usando l’ultima versione del firmware per Yun? Quell’errore sembra indicare un problema nella compilazione del kernel 😮
Thanks a lot for this article. You really saved my project. Let me contribute that this method works as well with the arduino yun mini but a little more work is required:
Download the latest arduino yun image at https://www.arduino.cc/en/Main/Software#toc8
Update your Yun with this firmware (so you have the Arduino Yun control panel instead of the Linino stock image)
Connect the USB adapter to the USB+, USB-, 5V and GND of the Yun mini headers
Follow the steps described on this site.
Hi Dinu, thanks for your feedback!
Ciao Luca,
ho un dongle TP-LINK modello TL-WN722N
quando lancio il comando dmesg ho questa risposta:
[ 3109.820000] usb 1-1.1: USB disconnect, device number 6
[ 3121.830000] usb 1-1.1: new high-speed USB device number 7 using ehci-platform
[ 3121.980000] usb 1-1.1: New USB device found, idVendor=0cf3, idProduct=9271
[ 3121.980000] usb 1-1.1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 3121.980000] usb 1-1.1: Product: USB2.0 WLAN
[ 3121.980000] usb 1-1.1: Manufacturer: ATHEROS
[ 3121.990000] usb 1-1.1: SerialNumber: 12345
pensi che il sistema possa riconoscerla??
Grazie !!
Ciao Marco, tutti quegli “unknown symbol” erano apparsi anche a me ad una certa versione di Linino: c’era stato un errore nella compilazione dei moduli. Prova a scaricare l’ultima versione dal sito di Arduino e vedi se così funziona…
Ciao Luca,
Sto seguendo la tua guida per installare un adattatore D-Link (idProduct=3308).
Non sono al 100% sicuro che i pacchetti “kmod-rt2800-lib kmod-rt2800-usb kmod-rt2x00-lib kmod-rt2x00-usb” facciano al caso mio, nonostante il fatto che dopo l’installazione abbia comunque ricevuto il risultato della tua guida eseguendo il dmesg.
Il problema è che comunque dopo il riavvio, facendo un nano /etc/config/wireless non compare niente relativamente alla radio1, ma solo le impostazioni della radio0. Sai per caso indirizzarmi verso la soluzione? Questo adattatore di rete “dovrebbe” funzionare in quanto lo avevo già usato in passato con raspberrypi.
ciao, per capire qual è il modulo corretto da utilizzare dovresti collegarlo, lanciare dmesg e copiarmi le ultime righe dove viene stampato l’ID del device.
Luca
I bought the IDENTICAL package on Amazon in the US only to find the device is now sourced from RealTek and needs RTL8188 drivers which aren’t in the Yun modules.
🙁
Daron
Daron, thanks for sharing your experience. I found this forum post that may help, let me know if it works for you!
Hi Luca,
I follow the tuto step by step.
every thing went well until the configuration with the web interface.
The new adapter is listed with the status disabled or not associated.
but nothing went on when i click the scan button.
(with the embedded wireless network i can see all the existing network on scan click).
Do you have idea what could be?
Thanks so much!
Hi Jacuqes: is the adapter detected by the OS (dmesg…)? Did you reboot the Yun? Sometimes it may help.
Hi Lucas,
Thanks for your answer.
I guess the adaptater is detected dmesg give me the following answer:
usb 1-1.1: new high-speed USB device number 8 using ehci-platform
[170876.700000] usb 1-1.1: New USB device found, idVendor=148f, idProduct=5370
[170876.700000] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[170876.710000] usb 1-1.1: Product: 802.11 n WLAN
[170876.710000] usb 1-1.1: Manufacturer: Ralink
[170876.710000] usb 1-1.1: SerialNumber: 1.0
[170876.810000] usb 1-1.1: reset high-speed USB device number 8 using ehci-platform
and i try several reboot.
Any other idea ?
Thanks so much!
Hi Lucas,
I checked everything once again and noticed a difference with the tuto:
In the web interface Network / Wifi i have:
Generic 802.11 Wireless Controller (radio1)
SSID: OpenWrt | Mode: Client
Wireless is disabled or not associated
an not
Generic MAC80211802.11bgn(radio1)
May i help to find an issue
Thanks
Hi Luca, the adapter does not appear, the message that appears when I do dmesg is:
usb 1-1.1: new high-speed USB device number 5 using ehci-platform
Where is the problem? thankssssss
hi Fernando, which adapter are you using? Keep in mind that unfortunately the Yun board is discontinued so it lacks new features/upgrades