Custom PC, Issue 106

Custom PC, Issue 106This month’s Custom PC Magazine includes my usual Mobile Tech Watch column along with a central feature: a hands-on guide to the Raspberry Pi.

First, the column. In a slight departure from the norm, I took a look at whether transparent, foldable electronics – as seen in films like Iron Man 2 and Ultraviolet (yes, I watched – and enjoyed – Ultravoilet. Don’t judge me) are in any way possible using current technologies.

The answer came as a surprise: yes, yes they are. Between Samsung’s transparent OLED displays, LG’s flexible electrophoretic screens, Rice University’s transparent and flexible electronics and Yuan Yang’s equally bendy see-through battery technology, it’s well within reach if a company has the R&D funds to spare.

The feature – the first full-length feature I’ve done for Custom PC in a long while – sits in the middle of the mag and holds the coveted “Plus” spot on the cover. Unlike my previous Raspberry Pi pieces, which have been reviews, this is a hands-on how-to tutorial starting off with an overview of what’s on the board and branching out into step-by-step guides on setting it up, turning it into a network attached storage (NAS) device, a home theatre PC, and how to address the general-purpose IO (GPIO) pins through Python. It also includes a section on overclocking, albeit with the required “it’s not a good idea to do this” warning in pride of place.

Sadly, there are a couple of hiccoughs with the piece, introduced during the layout and editing stage. It’s nothing major, although a couple of the commands won’t run correctly without modification. Custom PC’s editor, Ben Hardwidge, has promised that corrections will be published in the next issue and on the Custom PC Facebook page. Meanwhile, here are my original (correct) listings for each broken step:

Create a Raspberry Pi NAS Box

Step 3: Run ‘gksudo leafpad /etc/samba/smb.conf’ in the terminal, then add the following lines to the bottom of the file:
comment = Raspberry Pi NAS
browseable = yes
path = /media/partitionname
guest ok = yes
read only = no
create mask = 0775

Step 6: You should now have access to the contents of the attached storage device. For hints on securing access, go to the terminal and type ‘man smb.conf’ for a manual page on Samba.

Make a Raspberry Pi Media Centre

Step 6: When OpenELEC has finished compiling, you’ll need to copy the files across to the SD card. Re-insert it into the system to mount your partitions, then run:
sudo cp build.OpenELEC-RPi.arm-devel/bcm2835-driver-*/boot/arm128_start.elf /media/System/start.elf && sudo cp build.OpenELEC-RPi.arm-devel/bcm2835-driver-*/boot/bootcode.bin /media/System/ && sudo cp build.OpenELEC-RPi.arm-devel/bcm2835-driver-*/boot/loader.bin /media/System/ && sudo cp target/OpenELEC-RPi.arm-devel-*.system /media/System/SYSTEM && sudo cp target/OpenELEC-RPi.arm-devel-*.kernel /media/System/kernel.img

Step 7: For OpenELEC to work, we need a custom ‘cmdline.txt’, which passes various options to the Linux kernel. At this point, the quickest way to make this is to run:
sudo echo “dwc_otg.lpm_enable=0 root=/dev/ram0 rdinit=/init boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 ssh quiet” > /media/System/cmdline.txt

Programming the Raspberry Pi

Step 4: You’ll need to put ‘import RPi.GPIO as GPIO’ at the top of your Python project to use the GPIO library, after which you can start to use the Pi as an overpowered Arduino-alike.

Step 5: Configure with ‘GPIO.setup(NN, GPIO.XX)’ where ‘NN‘ is the pin number and ‘XX‘ either ‘IN’ or ‘OUT’. Read a pin with ‘input_value = GPIO.input(NN)’ or turn an output on with ‘GPIO.output(NN, True)’.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.