Monday, August 26, 2013

A Quick PSA - A must have for Raspbmc - Wireless mini keyboard/mouse



I got this in the mail last week and I must say my XBMC experience on the Pi is 100 times better. They are on ebay for ~$15 shipped and supposedly are compatible with PS3 and Xbox 360 as well. The listing didn't mention raspberry pi at all but I figured I'd take the risk. When I first plugged it in nothing happened, rebooted the Pi and bingo it works perfectly.

If you hate using the on screen keyboard I highly recommend getting one of these, it'll be the best $15 you ever spend :)

I don't want to link to a particular ebay listing since they are only valid for a short time. Instead just search ebay for "wireless handheld keyboard touchpad" and you should see a bunch. Just FYI they come in white too.

For a few dollars more one of my favourite Chinese retailers looks like it sells the same one:
http://dx.com/p/ipazzport-kp-810-12-wireless-2-4ghz-92-key-keyboard-for-google-tv-player-black-230388


Enjoy!

Sunday, August 18, 2013

PiFi Mini - SD Card Image

SD Image link reinstated, now hosted through Mega.co.nz here

For those who want to take the easy way out I'm providing an SD card image.

PLEASE READ THIS FIRST

What you need:
Raspberry Pi, model A or B, rev 1 or 2.
USB WiFi Dongle - RT5370 chipset (preferred), or RTL8192U chipset.
*According to one user the RT5372 chipset also works, this is unverified by me so try it if you already have one but if you're buying one get the RT5370 to be safe.
USB Keyboard (for initial setup only)
USB Thumbdrive (Optional - for storing your music)

This image is pre-configured for use with an RT5370 based wifi dongle.
Manual configuration will be required if you intend to use the RTLl8192U chipset, if you're using this chipset note that airplay via AP mode will not work properly. I strongly suggest buying an RT5370 based dongle instead but read this post first before buying on ebay. Instructions for the RTL8192U changes are included near the end of this page.

Note if you plan to add an LCD screen as per part 2 of my tutorial be aware that this image is pre-configured for a Rev 2 Pi, if you're using a Rev 1 pi then you will need to change some files as shown below in the Rev 1 LCD changes section. Just to clarify as of right now all model A pi's are considered rev 2, if you have a model B you can tell if it's a rev 2 by the fact that it has two mounting holes.

You will need an SD card at least 2GB in size but 4GB or higher is highly recommended!

First download the image from here.

Instructions for how to write the image file to the SD card are here:
http://elinux.org/RPi_Easy_SD_Card_Setup

For windows use the Win32Disk Imager instructions, to be safe remove any other removable drives and triple check that the drive letter is your SD card before writing! For Mac I'm sorry you're on your own since I've never done it, I'm sure if you google it you'll find lots of help though.

First boot if using an RT5370 based dongle

1. Once you have the image written to your sd card place it into your Pi and boot it up.

2. Since no network is configured the PiFi will fail-over into AP mode, it will take a little while to do so.

3. Using a wifi capable device (smartphone, laptop etc) watch for the PiFi_Mini_AP network to appear.

4. Connect to it and enter the password pifimini00 when prompted. It may take a little while for the connection to fully establish.

5. Once connected open a browser and enter 10.10.10.1 to open the web interface

6. Choose Easy Wifi Setup and enter the SSID and Password of the network you wish to connect to.

7. You can also view the instruction manual if you require more information.

8. Once rebooted it should connect to your network, if it doesn't and it fails over and creates an access point again then you've probably entered some information wrong. Try again.

Basic config for both RT5370 and RTL8192U (set timezones etc)

Note: The following settings are for Canada and US, hopefully if you're from another country you can figure it out for your needs. The image default settings are Int'l 102 key keyboard, en CA local, Regina, SK Canada for timezone (UTC -6:00 no dst).


*If you're using an RTL8192U chipset dongle do not plug it in yet, RT5370 users can have theirs plugged in though.



You'll need to connect a keyboard and a display connected to the Pi. Boot up and login, then type



Now if you're using an SD card >2GB you'll want to first choose expand_rootfs.


If you're not in Canada choose "change locale", for US choose both en_US.UTF-8 and en_US.ISO8859-15 by pressing the spacebar, press tab to highligh Ok and press enter.

Choose "change_timezone"

If you live in Canada or US chose America, then on the next screen find the closest city to you that's in the same timezone.

If you want to you can choose "change_pass" at this point to change from the default "raspberry" password.

DO NOT CHOOSE UPDATE - That could break stuff and since it ain't broke already we don't want to fix it :)

If you're using the RT5370 chipset you should be good to go, press tab and choose Finish. If you chose to expand root fs it may ask you if you want to reboot now, go for it.

If you're using the RTL8192U chipset you're not done yet, press tab and choose Finish. If you chose to expand root fs it may ask you if you want to reboot, choose no and proceed to the next section.

Extra config for using an RTL8192U based dongle


1. First we need to switch the hostapd binary file


2. Now we'll swap the hostapd.conf file and then safely shut down the Pi.

5. Wait about 30 seconds until there is no LED activity on the Pi, only the PWR LED should be lit, unplug power.

6. Plug in your wifi dongle and apply power to the Pi again. This time the unit should fail-over to AP mode, this takes a little while so be patient it's not broken :) If it takes more than 5 minutes then maybe it is broken.

7. Using a wifi capable device (smartphone, laptop etc) watch for the PiFi_Mini_AP network to appear.

8. Connect to it and enter the password pifimini00 when prompted. It may take a little while for the connection to fully establish. If using an iOS device wait until you see the wifi symbol at the top of your screen, this indicates you've obtained an IP from the PiFi.

9. Once connected open a browser and enter 10.10.10.1 to open the web interface.

10. Choose Easy Wifi Setup and enter the SSID, Encryption Type,  and Password of the network you wish to connect to. Then click "Submit & Reboot'

11. You can also view the instruction manual if you require more information.

12. Once rebooted it should connect to your network, if it doesn't and it fails over and creates an access point again then you've probably entered some information wrong. Try again.

Optional - USB Thumbdrive

The PiFi is configured to automount any USB thumb drives you plug in (note if you want to use an external hard drive they require more power and you'll need a powered usb hub). Simply place your music on the thumbdrive and insert into the PiFi. You'll have to refresh the mpd database to see the new songs, instructions vary depending on which app you're using to control MPD or if you're using the web client. In the user manual there are instructions for how to do this using the built in web-based MPD Controller.

NOTE: If you want to remove the USB drive while the PiFi is powered always use the web interface and select "Eject USB Drives", if you don't you could corrupt your USB drive.

If using an LCD display...

If you're going to be using an LCD screen you'll still need to follow part 2 of my other tutorial for wiring etc.

On the software side there are a few things you'll need to do.

For rev 1 Pi users only you'll need to switch the LCD.d conf file
Connect the pi up with a monitor and keyboard and login.



If you have an LCD connected you should see it text and the "Welcome to PiFi Mini".

For both rev 1&2 Pi users you'll need to edit your rc.local file and uncomment the lines which start the lcd script in both normal and AP modes.



Goto line 45 and remove the # from in front of this line:
#python /etc/mpc_lcd_info.py& #start lcd script that displays mpd info

Do the same on line 75.

Press control x, press y, press enter. Reboot (type sudo reboot) and you should see the welcome screen come up and after a short period of time you should see song info etc.

 Enjoy!