zondag 30 december 2012

Nokia LCD on Raspberry Pi GPIO


Using a Nokia PCD8544 LCD screen on a Raspberry Pi 

Old Nokia LCD screens, once used for playing snake, are now a great source for your DIY projects. They are widely available, cheap, graphical and easy to use thanks to all the PCD8544 libraries available on the Internet. PCD8544 is the name of the chip used to drive these displays.



Since this is a 3.3v display after all a 3.3V microcontroller (like the arduino mini and mini pro) or even the raspberry pi might be a better controller for this. These are the connections to use it with the library available from https://github.com/binerry/RaspberryPi/tree/master/libraries/c/PCD8544 . More instructions available at http://binerry.de/post/25787954149/pcd8544-library-for-raspberry-pi .
VDD => 3V3
SCK => GPIO0
SDIN => GPIO1
D/C => GPIO2
SCE => GPIO3
GND => GND
VOUT => x
RES => GPIO4
As long as you get these connections right there isn't much to worry about. Just double check that. On the below picture you can see how I got the small 1.5mm spaced connectors to something reasonable. You won't have to do this if you get a pcd8544 on a breakout board.


Now on a virgin raspbian wheezy image these are all the commands (in that sequence) you'll need to get the lcd working as a status screen. Open a terminal and ssh to your pi (ssh  with 0.0.0.0 matchin the ip of your pi). Default password for username pi is raspberry. Now from the shell execute these commands on your raspberry. You might have to hit ENTER when apt-get prompts for it.
sudo apt-get update
sudo apt-get install git-core
git clone git://git.drogon.net/wiringPi
Now you have the wiringPi library installed from https://projects.drogon.net/raspberry-pi/wiringpi/ Continue with the installation of the PCD8544 library. To simplify the compilation I also moved the sample into the current working directory. You can skip that but you'll need to check the paths in the cc command then.
wget https://github.com/downloads/binerry/RaspberryPi/Raspberry.Pi_PCD8544.Library.zip
unzip Raspberry.Pi_PCD8544.Library.zip 
mv ./samples/pcd8544_rpi.c ./
cc -o pcd8544_rpi pcd8544_rpi.c PCD8544.c  -L/usr/local/lib -lwiringPi
And at this point you'll have the pcd8544_rpi program compiled (if you didn't get any errors). Now to execute it run the following command. Again check your wires!
sudo ./pcd8544_rpi
You should get the following message on your terminal (and a working lcd screen) if all is OK.
Raspberry Pi PCD8544 sysinfo display
========================================
This is how it looks on the screen. Oh and don't mind the mess, once I moved in definitely all these wires will be running inside a wall hidden from human vision.




woensdag 26 december 2012

Turnigy 118B Needs a fix

Hit a real car some time ago and didn't find the time yet to repair this one. Had some great fun. Stock this is already a fast car.



If you'd like to get one of these this is the link for the Tunigy 118B product page on HobbyKing website. Don't mind the different shell. It has been updated since the introduction and I used another shell from ebay (check this blog for details).

Raspberry Pi power consumption

For everyone wondering what his raspberry pi might be consuming read this. You'll be happy to find out mine only measured 1,020W during boot with a raspbmc image on the sdcard. This is whit ethernet and hdmi connected, a real world usage example.



For comparing this is what my 24/7 intel atom based server takes with an SSD, no optical drive, no peripherals. I also added some other systems I had running here.

CPUMOBOPSUOSConsumption
AMD Athlon 64 X2 3200+AsRockATX 400WUbuntu Desktop80W
Intel Atom D525Intel D525MWATX 400WUbuntu Desktop40W
Intel Atom D525Intel D525MWITX 60WUbuntu Desktop19W
Intel Atom D525Intel D525MWITX 60WUbuntu Server16.5W

Edit


If someone is interested in more specific read outs please let me know and I'll see what I can do. 

maandag 24 december 2012

Copy files over ssh using scp command

Just a quick reminder on how to copy files from a remote location or vice versa over an ssh connection.
Copy files from your local computer to a remote server
scp somefile username@server:/home/username/
Copy files from a remote server to your local computer
scp username@server:/home/username/file_name /home/local-username/file-name
Original source: http://www.garron.me/linux/scp-linux-mac-command-windows-copy-files-over-ssh.html

zaterdag 8 december 2012

raspberry pi belkin n 300 wireless

Perform the following initial steps.
  • disconnect power from rpi
  • plug in belkin n 300 usb wifi adapter
  • power up rpi
Now check if the module is loaded with lsmod. This should show a 8192cu listing. With the latest raspbian image this driver is included. If not get the latest image or check where you can find a driver to compile yourself.

lsmod

Scan for available networks using iwlist. Write down the essid of the network you want to connect to.

iwlist scan

If using WPA encryption you'll have to generate the passphrase here with the following command. Replace the ESSID and the PASSWORD parameters. This will generate a hash that you'll need in the next step. 

wpa-passphrase [ESSID] [PASSWORD]

Edit the /etc/network/interfaces file for your network. 

sudo vi /etc/network/interfaces

And add the following content for a wpa protected network with dhcp:

auto wlan0
iface wlan0 inet dhcp
   wpa-ssid [ESSID]
   wpa-psk [PASSPHRASE]

Now you can restart your network interfaces with the following command. 

sudo /etc/init.d/networking restart

Now check if your network is live. Don't forget to unplug the cable if you configured all this over a wired connection :p.

All of this was tested with the latest raspbian image from http://www.raspberrypi.org/downloads and a brand new belkin N 300 wireless adapter. You can get a smaller belkin N 150 wireless adapter for the same price with only downside that the max speed of that smaller one is limited. However with 150Mbps it's still well over the 100Mbps your raspberry pi can handle anyway. The Belkin N 300 wireless adapter has a theoretical max speed of 300 Mbps.  

More information about wifi configuration on debian is available at http://wiki.debian.org/WiFi/HowToUse .