Getting WIFI in Snappy Ubuntu Core with Erle-Copter Erle Robotics May 21, 2015 The following article explains how to connect to the Internet wirelessly using Erle-Copter running Snappy Ubuntu Core. In order to do so (WiFi mode infrastructure) we’ll use wpa_supplicant. You’ll need the following armhf packages: • libpcsclite1_1.8.11-3ubuntu1_armhf.deb • libreadline5_5.2+dfsg-2_armhf.deb • wpasupplicant_0.7.3-6ubuntu2.3_armhf.deb You can easily install these deb packages by typing: dpkg − i <package−name> Once the packages are installed, you’ll notice that wpa_supplicant is in the path. Let’s make a script that helps automating the process of connecting to a network. Check the name of your wireless interface: ( E r l e R o b o t i c s ) r o o t @ l o c a l h o s t : / home / ubuntu# i f c o n f i g lo L i n k encap : L o c a l Loopback i n e t addr : 1 2 7 . 0 . 0 . 1 Mask : 2 5 5 . 0 . 0 . 0 i n e t 6 addr : : : 1 / 1 2 8 Scope : Host UP LOOPBACK RUNNING MTU:65536 Metric : 1 RX p a c k e t s :187347 e r r o r s : 0 dropped : 0 overruns : 0 frame : 0 TX p a c k e t s :187347 e r r o r s : 0 dropped : 0 overruns : 0 c a r r i e r : 0 c o l l i s i o n s : 0 txqueuelen : 0 RX b yte s :14804850 ( 1 4 . 8 MB) usb0 L i n k encap : E t h e r n e t i n e t addr : 1 9 2 . 1 6 8 . 7 . 2 TX bytes :14804850 ( 1 4 . 8 MB) HWaddr 06:59:8 e : d4 : 7 5 : da Bcast : 1 9 2 . 1 6 8 . 7 . 2 5 5 Mask : 2 5 5 . 2 5 5 . 2 5 5 . 0 i n e t 6 addr : fe80 : : 4 5 9 : 8 e f f : fed4 :75 da /64 Scope : L i n k UP BROADCAST RUNNING MULTICAST MTU:1500 Metric : 1 RX p a c k e t s :93258 e r r o r s : 0 dropped : 0 overruns : 0 frame : 0 TX p a c k e t s :92164 e r r o r s : 0 dropped : 0 overruns : 0 c a r r i e r : 0 c o l l i s i o n s : 0 txqueuelen :1000 RX b yte s :5366538 ( 5 . 3 MB) TX bytes :7672724 ( 7 . 6 MB) ( 8 1 8 . 2 KB ) Getting WIFI in Snappy Ubuntu Core with Erle-Copter 2 May 21, 2015 wlan0 L i n k encap : E t h e r n e t i n e t addr : 1 0 . 0 . 0 . 1 HWaddr 80:1 f : 0 2 : f9 : 1 f :75 Bcast : 1 0 . 0 . 0 . 2 5 5 Mask : 2 5 5 . 2 5 5 . 2 5 5 . 0 i n e t 6 addr : fe80 : : 8 2 1 f : 2 f f : f e f 9 : 1 f75 /64 Scope : L i n k UP BROADCAST RUNNING MULTICAST MTU:1500 Metric : 1 RX p a c k e t s :1243 e r r o r s : 0 dropped :317 overruns : 0 frame : 0 TX p a c k e t s :1235 e r r o r s : 0 dropped :32 overruns : 0 c a r r i e r : 0 c o l l i s i o n s : 0 txqueuelen :1000 RX b yte s :417444 ( 4 1 7 . 4 KB ) TX bytes :818244 ( 8 1 8 . 2 KB ) We’ll be using wlan0. Create the following script named wifi.sh w p a _ s u p p l i c a n t −iwlan0 −c / e t c / w p a _ s u p p l i c a n t / w p a _ s u p p l i c a n t . conf & d h c l i e n t wlan0 : Make sure that you configure your wpa_supplicant.conf appropriately. Here’s a guideline but it’ll depend on your router configuration: Getting WIFI in Snappy Ubuntu Core with Erle-Copter 3 May 21, 2015 c t r l _ i n t e r f a c e =/ var / run / w p a _ s u p p l i c a n t # U n s e c u r e Network network = { ssid=” ” key_mgmt=NONE priority= } # WEP Network network = { ssid=” ” key_mgmt=NONE wep_key0= ” ” priority= } # WPA Network network = { ssid=” ” psk= ” ” priority= } Getting WIFI in Snappy Ubuntu Core with Erle-Copter 4 May 21, 2015 Once the interface has been properly configured just launch wifi.sh: ( E r l e R o b o t i c s ) r o o t @ l o c a l h o s t : / home / ubuntu# s o u r c e w i f i . sh i o c t l [ SIOCSIWAP ] : Operation not p e r m i t t e d i o c t l [ SIOCSIWENCODEEXT ] : I n v a l i d argument i o c t l [ SIOCSIWENCODEEXT ] : I n v a l i d argument T r y i n g to a s s o c i a t e with 0 0 : 1 3 : 1 3 : 0 0 : 3 a :01 ( SSID = ’ e r l e −net ’ f r e q =2432 MHz A s s o c i a t i o n r e q u e s t to the d r i v e r f a i l e d A s s o c i a t e d with 0 0 : 1 3 : 1 3 : 0 0 : 3 a :01 CTRL−EVENT−CONNECTED − Connection to 0 0 : 1 3 : 1 3 : 0 0 : 3 a :01 completed ( auth ) [ That should do it: ( E r l e R o b o t i c s ) r o o t @ l o c a l h o s t : / home / ubuntu# p i n g g o o g l e . com PING google . com ( 1 7 3 . 1 9 4 . 3 2 . 2 2 5 ) 56(84) bytes o f data . 64 byte s from ber01s09−in−f1 . 1 e100 . net ( 1 7 3 . 1 9 4 . 3 2 . 2 2 5 ) : icmp_seq =1 t t l =51 64 byte s from ber01s09−in−f1 . 1 e100 . net ( 1 7 3 . 1 9 4 . 3 2 . 2 2 5 ) : icmp_seq =2 t t l =51 64 byte s from ber01s09−in−f1 . 1 e100 . net ( 1 7 3 . 1 9 4 . 3 2 . 2 2 5 ) : icmp_seq =3 t t l =51 ^C −−− google . com p i n g s t a t i s t i c s −−− 3 p a c k e t s t r a n s m i t t e d , 3 r e c e i v e d , 0% packet l o s s , time 1999ms If you wish to get a Ubuntu drone that has this an many more capabilities make sure to check Erle-Copter Ubuntu Core special edition. 1 LICENSE Unless specified, this content is licensed under the Creative Commons Attribution-NonComercial-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. If you plan on using this material for commercial purposes get in touch with us at contact@erlerobot.com Getting WIFI in Snappy Ubuntu Core with Erle-Copter 5
© Copyright 2024