You are viewing outdated content for BUG. If you have a BUG Y.T. edition or 2.0 series device, please visit our updated wiki: http://wiki.buglabs.net
Configuring WiFi from Command Line
From BUG Wiki
Contents |
Special Note
BUG Software version 1.4.2 and above uses a graphical tool to configure wifi called connman. You may want to start there if you have a LCD Module. The following instructions should be used if for some reason connman does not meet your needs.
Overview
This page describes how to associate a BUG with Wifi module to an access point via a shell session. Note that this example assumes WPA-PSK type encrypted wifi networks. It the steps that follow don't apply to WEP, open, or hidden SSID networks.
Setting up wifi connection automatically
Step 1: Connect to BUG
Get to BUG command line, either with usb, serial, or some other network connection:
ssh root@10.10.10.10 <enter>
Step 2: Verify network device
From session type iwconfig to confirm there is a network connection:
# iwconfig
Step 3: Edit interfaces
Edit "/etc/network/interfaces" file and change "eth1" to look like the following:
auto eth1
iface eth1 inet dhcp
wireless_mode managed
wireless_essid "MYSSID"
wpa-driver wext
wpa-conf /etc/myconf.conf
Step 4: creating a key
Create a key file that contains the AP name and key:
# wpa_passphrase <essid> <pass> > /etc/myconf.conf
Step 5: stop/remove connman
You have some options here. You can either stop connman from starting at boot and trying to manage eth1 (but without uninstalling it entirely) with:
# update-rc.d -f connman remove update-rc.d: /etc/init.d/connman exists during rc.d purge (continuing) Removing any system startup links for connman ... /etc/rc0.d/K23connman /etc/rc1.d/K23connman /etc/rc2.d/S23connman /etc/rc3.d/S23connman /etc/rc4.d/S23connman /etc/rc5.d/S23connman /etc/rc6.d/K23connman
If you'd like to get rid of the daemon and GUI entirely, try:
# ipkg remove --force-depends connman connman-gnome
Step 6: Reboot
Reboot so your network changes are picked up:
# reboot
Step 7: confirming connection
At this point you should have a working wifi connection if the AP details are correct and the AP is working. You can verify this by either sshing into the the BUG via usb (ssh root@10.10.10.10) and pinging the AP:
# ping <AP IP address>
or simply ssh into your BUG if you know it's ip:
# ssh root@<ip_of_bug_on_wifi>
