After playing for a day with my Raspberry Pi, here I'm compiling a list of tools that would help you setting RPi up correctly. As I'm testing everything under Python and I want to control it using my laptop (Windows 7), I need different ways to be more productive and faster when developing on it. In my case I'll need a Python editor like geany, GPIO library and remote desktop using Xming and PuTTY via SSH. As stated in my previous post I'll build a small robot using the following mechanical and electronic parts (All of them bought from HobbyTronics) expending less than £50:
root@raspberrypi:~# apt-get update
root@raspberrypi:~# apt-get install python geany xterm
Downloading GPIO RPi Python from Google code:
root@raspberrypi:~# wget https://raspberry-gpio-python.googlecode.com/files/python-rpi.gpio_0.3.1a-1_armhf.deb --2012-07-29 10:20:19-- https://raspberry-gpio-python.googlecode.com/files/python-rpi.gpio_0.3.1a-1_armhf.deb Resolving raspberry-gpio-python.googlecode.com (raspberry-gpio-python.googlecode.com)... 184.108.40.206, 2a00:1450:400b:c00::52 Connecting to raspberry-gpio-python.googlecode.com (raspberry-gpio-python.googlecode.com)|220.127.116.11|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 10824 (11K) [application/x-debian-package] Saving to: `python-rpi.gpio_0.3.1a-1_armhf.deb' 100%[======================================] 10,824 --.-K/s in 0.1s 2012-07-29 10:20:27 (71.2 KB/s) - `python-rpi.gpio_0.3.1a-1_armhf.deb' saved [10824/10824]
root@raspberrypi:~# sudo dpkg -i python-rpi.gpio_0.3.1a-1_armhf.debSelecting previously unselected package python-rpi.gpio. (Reading database ... 54876 files and directories currently installed.) Unpacking python-rpi.gpio (from python-rpi.gpio_0.3.1a-1_armhf.deb) ... Setting up python-rpi.gpio (0.3.1a-1) ...
Just open Geany and paste the following source code:
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(11, GPIO.IN) GPIO.setup(12, GPIO.OUT) #set up output 12 as true. GPIO.output(12, GPIO.HIGH) while True: time.sleep(1) input_11 = GPIO.input(11) print "%s %r" % ("Input 11 value is", input_11) time.sleep(1)
Compile it and run it. It should display the value of Pin 11. If you can change the state of that input, the display will show the change.
Starting up the SSH server:
root@raspberrypi:~# service ssh start
Download PuTTY and Xming and install them:
And enable the option X11 forwarding under connection options:
Once done, open the connection and use your credential to login (by default user: pi password: raspberry).
As soon as you are in, type startlxde and Xming will take over and it will display the RPi desktop on your local machine.
Check out the parameters for Xming as the short-cut should call: "...Xming.exe" -clipboard -rootless.