If you’ve been following along, you should have a basic Debian Linux installation on your Olimex A13-OLinuXino-MICRO board and able to connect to WiFi. Make sure that the SSID and WPA password settings are correct in the /etc/wpa_supplicant/wpa_supplicant.conf file. See my guide on setting up WiFi with the A13-OLinuXino-MICRO and scroll down to the section on configuring wpa_supplicant.
Assuming you’re able to login to the OLinuXino and connect to a WiFi access point, we can change the default of DHCP to a static IP address.
Login as root on the Olimex (default is root/password) and bring the wireless interface down.
ifconfig wlan0 down
Make some changes to the interfaces file.
nano /etc/network/interfaces
You will see the following:
auto lo iface lo inet loopback #auto eth0 #iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
Change the last line with the static IP information:
auto lo iface lo inet loopback #auto eth0 #iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet static address 10.0.0.20 netmask 255.255.255.0 network 10.0.0.0 gateway 10.0.0.1
Note that the address, network, and gateway need to reflect your specific network. This information can be found by running the commands
ifconfig netstat -nr
Restart the networking daemon and bring the wlan0 interface up.
/etc/init.d/networking restart ifconfig wlan0 up
Check to see if you were able to attach to the network with a static IP. Run the ‘ifconfig’ command and you should see an output like the following:
root@debian:~# ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) wlan0 Link encap:Ethernet HWaddr 80:1f:02:7c:66:9b inet addr:10.0.0.20 Bcast:10.0.0.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:8 errors:0 dropped:64981 overruns:0 frame:0 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:179967 (175.7 KiB) TX bytes:20045 (19.5 KiB)
Where wlan0 is your WiFi interface and has the static IP address of 10.0.0.20. Try rebooting the Olimex board. The static IP address should stick.
As an added bonus, SSH already comes pre-configured with the Sunxi/Debian Linux install. From another computer running Linux, all you have to do is type:
ssh root@10.0.0.201
If you’re on Windows, you can SSH with PuTTY.
You can now setup the OLinuXino board somewhere out of site and login from anywhere on the network. Now, I think it’s time for some hot chocolate to celebrate this minor victory. It’s getting cold here.