Raspberry Pi, a small computer powered by ARM architecture is a very interesting board for learning embedded system. In this article we will discuss about how to install how to install Occidentalis v0.2 Rubus occidentalis.
For this article I use following:
- Slackware64 14.0
- Windows 8.1
- Raspberry Pi model B
- Official Occidentalis v0.2
You can use either Linux (in this article, Slackware) or Windows (in this article Windows 8.1). Just pick one and follow the rest of article for your choice.
About Occidentalis
Occidentalis is a embedded Linux distribution derived from Raspbian Wheezy. This distro is created and maintained by Adafruit Industries. The latest version is Occidentalis v0.2 which is derived from Raspbian Wheezy August 16 2012.
What differs occidentalis and other distro?
Occidentalis is tweaked in purpose to make DIY electronics more fun using Raspberry Pi. Yes, we have kernel modules for DS1307, AD525x, I2C digipots, HMC6352, BMP085, ADS1015, easy PWM/Servo control, and many more. It’s not very surprising as this distro is officially created for learning purpose in some Adafruit materials.
However, Adafruit is not full time linux distro maintainers, which means you can’t expect too much. Adafruit state that this distro is not for beginners or people who are new to linux.
Obtain the Materials
The Operating System images I used is Occidentalis v0.2 which can be downloaded from here. The size is about 900MB, per August 31, 2012.
Prepare the Disk (SD Card)
To boot the Raspberry Pi, an installation media and storage media is needed. All we need is a single SD card. On this article I use my 4GB SD card. The image we download on previous section will be stored on this card and later installed. Make sure you have a way to write on SD card.
Windows-based Instruction
For Windows user, you can follow this section to “burn” the image. For this purpose you need additional software for writing to SD card, such as Win32DiskImager utility.
- Extract the image (in this case Occidentalisv02.zip) so you will get an .img file.
- Insert SD card into SD card reader and check what drive letter it assigned to. For example G:\
- If it is not new, format it. Or at least make sure there is only one partition (FAT32 is recommended).
- Run the Win32DiskImager with administrator privileges.
- Select the image we have extracted (Occidentalis_v02.img).
- Select the drive letter of the SD card on our machine. Make sure you have the correct drive, or you will destroy data on that drive.
- Click Write and wait. The process should be not long.
- Exit the imager and eject the SD card
Beside Win32DiskImager, you can also use other tool such as Flashnul.
- Follow step 1 to step 3 for Win32DiskImager’s solution
- Extract Flashnul from the archive
- Open command prompt with elevated privilege (administrator privilege).
- Go to your extracted directory and run flashnul with argument “-p”. For example: flashnul -p
- You will get list of physical drive attached on your machine, and list of drive. Make sure the drive is correct. At time of writing this article, the SD card is detected as device number 1 with and mounted to drive G:
- Load the image to flashnul: flashnul 1 -L Occidentalis_v02.img
- If you get an access denied error, try re-plugging the SD card and make sure to close all explorer windows or folders open for the device. If still get denial, try substitute the device number with its drive letter: flashnul G: -L Occidentalis_v02.img
At this point, you have successfully written image to your SD card. And I assume you are. You can proceed to next stage.
Linux-based Instruction
Writing image on Linux is easier, in my opinion. The utility we use is “dd” which is already bundled on most distro. Make sure you know the correct device file for your SD card. In my machine I use a built in card reader and detect my SD card as /dev/sdb. It might be different on your system so better check it. For this article I use /dev/sdb to refer to SD card.
- Extract the image (in this case Occidentalisv02.zip) so you will get an .img file.
- Insert SD card into SD card reader .
- If it is not new, format it. Or at least make sure there is only one partition (FAT32 is recommended).
- Unmount the SD card if it is mounted. We need the whole SD card so if you see partition such as /dev/sdb1, etc its better you unmount them all.
- Write the image to SD card. Make sure you replace the input file after if= argument with correct path to .img file and “/dev/sdb” in the output file of= argument with your device. Also make sure to use whole SD drive and not their partition (i.e. not use /dev/sdb1, /dev/sdb1, etc). The command: dd bs=4M if=Occidentalis_v02.img of=/dev/sdb
- Run sync as root. This will ensure the write cache is flushed and safe to unmount SD card.
- Remove SD card from card reader.
If you hesitate to use terminal and prefer to use GUI method, here is the tutorial. Note that we
- Do step 1 to step 3 for previous tutorial. Make sure your directory or image file doesn’t contain any spaces.
- Install the ImageWriter tool from https://launchpad.net/usb-imagewriter
- Launch the ImageWriter tool (needs administrative privileges)
- Select the image file (in this case Occidentalis_v02.img) to be written to the SD card (note: because you started ImageWriter as administrator the starting point when selecting the image file is the administrator’s home folder so you need to change to your own home folder to select the image file)
- Select the target device to write the image to. In my case, it’s /dev/sdb
- Click the “Write to device” button
- Wait for the process to finish and then insert the SD card in the Raspberry Pi
At this point, you have successfully written image to your SD card. And I assume you are. You can proceed to next stage.
Running the Pi
You have write image and at this point your raspberry pi is ready. Now set up raspberry pi to boot: insert your SD card back to raspberry pi, put on power, plug video output (either HDMI or RCA).
To resize the SD card after installation, you can follow this article. Another way, you can use “raspi-config” utility to do it.
To log in on your Raspberry pi you can use the default login, which is:
Username: | pi |
Password: | raspberry |
Side Notes
I2C Support
I2C support is on SDA and SCL pins. To test, connect any I2C device to power, ground, SDA, and SCL. Run this command as root to detect which addresses are on the bus:
i2cdetect -y 0
SPI Support
SPI support is on the CLK/MOSI/MISO/CS0/CS1 pins. To test, connect your logic analyzer / scope to the pins and run following command to send some dummy data to the SPI port.
echo "xathrya test" > /dev/spidev0.0
You can simply read/write the /dev/spidev files to read/write from SPI.
One Wire Support
Most commonly used for DS18B20 temperature sensors. The Pi does not have ‘hardware’ 1-wire support but it can bit bang it with some success. Connect a DS18B20 with VCC to 2V, ground to ground, and Data to GPIO #4. Then connect a 4.7K resistor from Data to VCC.
Run following commands as root. Both command will be used to attach the temperature sub module.
modprobe w1-gpio modprobe w1-therm
You can then run following command to read the temperature data from the bus:
cat /sys/bus/w1/devices/28-*/w1_slave
WiFi Support
The kernel has been patched with RTL8192cu-based patches.
Adafruit Kernel Source Code
You can get the kernel source code here.
Have fun