Reminder: this is not a tutorial on how to set up a
Raspberry Pi. I'll be going a long way "off piste" compared to the usual way of doing things. This illustrates how flexible and customisable Linux can be, but when I get into difficulty there's no support to help solve problems.
Memory usage
I was slightly surprised when I first ran the '
free -h
' command to see that the Pi has swap enabled by default. Using swap on flash memory (such as an SD card) is a seriously bad idea, given the limited number of write cycles flash memory allows. I can only assume the normal Pi user is likely to run out of physical memory, making swap essential. I'll be adding an external disc drive later, and putting some swap area on that, but until then I've disabled the swap as follows:
sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall
sudo update-rc.d dphys-swapfile remove
Wi-fi connection
My wired computer network only extends as far as my "office" - elsewhere in the house I need wi-fi so I've bought a USB wi-fi dongle to use with the Pi. The dongle was recognised immediately I plugged it in to the USB hub, as shown by the output of '
lsusb
'. I found several conflicting guides to setting up wi-fi on a "headless" Pi. I eventually got it working with the following
/etc/network/interfaces
file:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid xxxxxxx
wpa-key-mgmt WPA-PSK
wpa-group TKIP CCMP
wpa-psk xxxxxxxxxxxxxxxxx
Lastly I changed the hostname used by the wired interface so I don't have duplicate hosts on my network if both interfaces are connected. This can't be set within
/etc/network/interfaces
so I had to edit
/etc/dhcp/dhclient.conf
instead, adding the following lines:
interface "eth0" {
send host-name = "firefly-hw";
}
It would be nice to get the "firefly" part of the name from
gethostname()
but I couldn't find a way to do this.
No comments:
Post a Comment