-
1Step 1
Let's get cracking, get the Carambola up and running. I like to connect to the serial terminal, the development board features a usb ftdi chip allowing me to use a terminal program like PuTTy to connect.
Connecting to serial terminal
First step: see that (windows) installs FTDI drivers, if not see http://www.ftdichip.com/FTDrivers.htm
Serial settings be like:
Speed: 115200 baud Data bits: 8 Stop bits: 1 Parity: none Flow control: none
When we press connect we're greeted by <strikethrough>the openwrt banner</strikethrough> a blinking cursor!
Press enter
Presto!
If this your maiden voyage on the openWRT board be sure to set a root password.
Type passwd into the prompt. You will be prompted to set a new password for the user root:
root@carambola2:~$ passwd Changing password for root New password: Retype password: Password for root changed by root root@carambola2:~$
WiFi configuration: Android
This is the easy part, depending on geography and geekyness. Over here in The Netherlands the wifi hotspot functionality comes standard with Android, depending on your provider elsewhere this functionality might be blocked. You'd have to root your handset and install an app like android wifi tether: https://code.google.com/p/android-wifi-tether/
By the way, root will be necessary if you'd like to mount the samba share on your phone. More on this later.
For now, we'll use the standard android wifi hotspot functionality:
Go Settings > Wireless & Networks > More.. > Tethering & portable hotspot > Set up Wi-Fi hotspot
As you can see in the image this opens up a configuration screen.
Our SSID will be hackaday
Security WPA2 PSK
Password; pick a nice one :)
After pressing Save the window will close, mark the box next to Portable Wi-Fi hotspot.
WiFi configuration: OpenWRT
We're going to configure the device as a 'routed client' but only follow the process until half way, this device is going to be wireless only! Credit goes to the openWRT wiki.
For the entire guide see: http://wiki.openwrt.org/doc/recipes/routedclient
Before doing any actual configuration, the wifi interface must be enabled and put into station mode in order to be able to scan for networks in the vincinity:
uci del wireless.@wifi-device[0].disabled uci del wireless.@wifi-iface[0].network uci set wireless.@wifi-iface[0].mode=sta uci commit wireless wifi
- Remove the disable 1 option from the wireless configuration
- Set the mode option to station
- Save changed configuration file
- Start wireless using the wifi command
Now we can issue the iwlist scan command to list networks in range.
!Attention: In Barier Breaker RC3, the latest release candidate, iwlist has been depreciated in favor of iw. Usage is iw dev wlan0 scan.
Scroll around a little, if the hotspot is running on your phone a network like this will show up:
root@carambola2:~# iwlist scan wlan0 Scan completed : Cell 01 - Address: 00:1D:19:0E:03:8F ESSID:"hackaday" Mode:Managed Channel:9 Quality:3/5 Signal level:-69 dBm Noise level:-92 dBm IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : TKIP Pairwise Ciphers (2) : TKIP CCMP Authentication Suites (1) : PSK Preauthentication Supported IE: WPA Version 1 Group Cipher : TKIP Pairwise Ciphers (2) : TKIP CCMP Authentication Suites (1) : PSK Encryption key:on Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s 11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s 48 Mb/s; 54 Mb/s
We're going to edit a configuration file using vi, a terminal text editor. Here's a litte guide:
My usefull vi commands: 'i': start editing text 'esc': Only after using 'i', when done editing ':x': save and quit (only when not in editing mode) ':q!': quit without saving 'dd': remove entire line
Edit /etc/config/network and change the WAN interface by editing the existing ifname option:
Type vi /etc/config/network
config interface 'wan' option proto 'dhcp'
Supposed we want to connect to the network called "hackaday", the previous scan result revealed the following information:Note that the wan network section must not contain any ifname option.
- ESSID is hackaday
- Channel is 9
- The network uses WPA/WPA2 mixed mode
All except for the channel is configured in our Android Wi-Fi hotspot.
In /etc/config/wireless, locate the existing wifi-iface section and change its network option to point to the WAN interface. Change the mode option to sta (Station) and alter the encryption options to match those of the target network.
config wifi-device 'radio0' option type 'mac80211' option channel '6' option hwmode '11ng' option macaddr 'c4:93:00:00:1f:bf' option htmode 'HT20' list ht_capab 'SHORT-GI-20' list ht_capab 'SHORT-GI-40' list ht_capab 'RX-STBC1' list ht_capab 'DSSS_CCK-40' option mode 'sta' config wifi-iface option device 'radio0' option network 'wan' option mode 'sta' option ssid 'hackaday' option encryption 'psk2' option key 'mySuperSecretPasswordJustMadeUp'
Reconfigure the wireless network.
ifup wan wifi
> reboot the system
reboot
Make sure your phone is connected to 3G or LTE and ping google:
root@carambola2:~# ping <a href="http://www.google.com">www.google.com</a>
PING <a href="http://www.google.com">www.google.com</a> (173.194.65.106): 56 data bytes 64 bytes from 173.194.65.106: seq=0 ttl=41 time=473.932 ms 64 bytes from 173.194.65.106: seq=1 ttl=41 time=379.458 ms 64 bytes from 173.194.65.106: seq=2 ttl=41 time=386.784 ms
Done.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
You might be interested in what I have been working on as it would automate most of your setup. Please! By all means, use, integrate, and modify. I am interested to see how you change it!
Are you sure? yes | no