Saturday, September 10, 2016

Raspberry Pi & Arch Linux - Day 1


Raspberry Pi & Arch Linux - Day 1

Today is the start of a new journey: learn linux system.

Past experience has taught me that doing experiment with linux on PC is too risky. At first I was thinking of getting a cheap used computer and install a linux system but this is still expensive. After some researches on the internet, the Raspberry Pi caught my attention. It is a mini computer that costs only $50. I am not sure if it is a powerful machine but obviously it is enough for me to learn the linux system. (For more information, please refer to https://www.raspberrypi.org)

The next question is which linux distribution to use. I have Ubuntu on my personal computer. Some people recommend to start with Ubuntu but I want something more challenging. Ubuntu is user-friendly precisely because it has everything pre-installed. In order to learn the linux, I believe it is better to build something on my own. This thought makes me finally chose the Arch Linux distribution which is a lightweight and flexible linux distribution. (For more information about Arch Linux, please refer to https://www.archlinux.org)


The first thing to do is to start the Raspberry Pi. I bought my Raspberry Pi from Amazon:

(https://www.amazon.com/CanaKit-Raspberry-Clear-Power-Supply/dp/B01C6EQNNK/ref=sr_1_6?s=pc&ie=UTF8&qid=1473563202&sr=1-6&keywords=raspberry+pi+3)

This product does not include the SD card and unexpectedly this makes the very first trouble.

Problem 1 : SD Card

For some reasons, I wanted to have a large SD card. I was thinking the larger the SD card is the better because SD card is used as a disk for the Raspberry Pi. I bought a 64G SD card but it turns out to be the first "mistake".

64G SD card uses a special filesystem: extFAT. According to Wikipedia:
exFAT is a proprietary and patent-protected file system with certain advantages over NTFS with regard to file system overhead.
exFAT is not backward compatible with FAT file systems such as FAT12, FAT16 or FAT32. The file system is supported with newer Windows systems, such as Windows Server 2003, Windows Vista, Windows 2008, Windows 7, Windows 8, and more recently, support has been added for Windows XP.[27]
exFAT is supported in OS X starting with version 10.6.5 (Snow Leopard).[26] Support in other operating systems is sparse since Microsoft has not published the specifications of the file system and implementing support for exFAT requires a license. exFAT is the only file system that is fully supported on both OS X and Windows that can hold files bigger than 4 GB.[citation needed]

Having no idea about these details, I tried to write the Arch Linux image file to SD card on a Linux machine but always got a permission error. I cannot even format the SD card on my linux machine and now I kind of understand this is a filesystem format issue. I did try to format the SD card on Mac but I chose the MS-DOS(FAT) which seems to make the situation worse.

After several attempts to write Arch Linux to the SD card, I finally gave up. At this point it is too difficult for me to solve this format problem. Once I format the SD card on Mac, it seems impossible for me to re-format on a Linux machine not to mention writing the image file to the SD card. The only choice is to buy a new SD card. This time I bought a 16G SD card and hopefully it can work.

(SanDisk Ultra 16GB Ultra Micro SDHC UHS-I/Class 10 Card with Adapter (SDSQUNC-016G-GN6MA, https://www.amazon.com/gp/product/B010Q57SEE/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1)

Following the instruction again (https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-3) and now everything works smoothly.




Now I can start the Arch Linux on my little Raspberry Pi, which is good and makes me excited, but soon I realize one important thing: Arch Linux is so simple that it has nothing! There is no GUI and everything is in command line. Interesting...

To play with Arch Linux, I need a real computer so that I can search useful information. This is a little bit annoying because I need to switch between to keyboards. So the next step is to get internet connection.



Problem 2: How to connect to Wifi

It turns out the Arch Linux Wiki has everything I need if I do not skip any sections on the page and strictly follow the instruction.(https://wiki.archlinux.org/index.php/Wireless_network_configuration#Getting_an_IP_address)

Here are the steps to connect to wifi:

  1. set up the wlan0 interface: ip link set wlan0 up
  2. connect to wifi: wpa_supplicant -B -D nl80211,wext -i wlan0 -c <(wpa_passphrase "your_SSID" "your_key"). wpa_supplicatn can run in the background. After entering this command, press ctrl+c to exit.
  3. getting an IP address: dhcpcd wlan0 
  4. (done.)


TODO list:
  1. how to automatically config the wireless connection?
  2. can we save the configuration/profile?
  3. [research] Filesystem
  4. [research] SD card
  5. [research] WPA/WPA2, WEP










No comments:

Post a Comment