So, Batman has Robin, Sherlock Holmes has Dr John Watson, Sheriff Andy Taylor has Deputy Barney Fife... Well, you get the idea: All heroes have a sidekick (if not, they are missing out).
You need a sidekickOr at least, your desktop does.
If your desktop is a Raspberry Pi, then you already know the life of a sidekick well, or at least you are learning it. This article is not really for you, although it might come in handy later. So, for all you Raspberry Pi owners who do everything on the Raspberry Pi, stay tuned to this blog for a future post: The Sidekick's Sidekick.
Unix, Linux or Mac DesktopThis will be smooth sailing. Open a terminal and type:
The first time you will be asked to accept the host key, say yes. Enter your password when prompted. If you entered the correct password, you are in.
$ ssh -X pi@raspberrypi pi@raspberrypi's password: Linux raspberrypi 3.1.9+ #168 PREEMPT Sat Jul 14 18:56:31 BST 2012 armv6l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Type 'startx' to launch a graphical session Last login: Tue Sep 11 15:32:33 2012 from v480-sunray pi@raspberrypi ~ $
Windows (XP, 7, ...)Ok, this is a little more involved.
- Download Putty
- Enter the following information in the configuration:
- Hostname: raspberrypi
- go to the ssh tab and click X11 forwarding
- Entere for Saved Session: raspberrypi
- click Save
I'm not going to go through all the details here. Simply to say that you need to go to the ssh tab and click X11 forwarding download Xming server which will add an X server to Windows. You then need to start the Xming server from the start menu, then open the session in Putty. For more detail, go here
- Double click on raspberrypi (or select and click open)
With that setup however, you only get a fraction of the functionality of what we did for Unix, Linux or Mac.
What are we doing again?You can now run any console application directly in that window, but even more interesting is the fact that you can run a graphical application on your Raspberry Pi, but the graphical display itself will be on your desktop.
Look, Ma, no VNC! For example, you want to run the midori browser. In the ssh window, at the prompt, type: midori
And you should get:
$ pi@raspberrypi ~ $ midori
And you should get:
$ pi@raspberrypi ~ $ idle
web.py is not installed by default.
pi@raspberrypi ~/Desktop $ sudo easy_install web.py Searching for web.py Best match: web.py 0.37 Processing web.py-0.37-py2.7.egg web.py 0.37 is already the active version in easy-install.pth Using /usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg Processing dependencies for web.py Finished processing dependencies for web.py
In the above example, it actually didn't download the library, because I had installed it already. In fact, one of the first thing I did. Web.py is like duct tape for web applications. Or Web services. Or template driven apps. Or scripts that need database access. I could go on. Although a web framework, each module can be used individually, or can be replaced, or used alongside similar modules. On the screenshot, I did a dir(web) to show what modules are available. If there is some interest, I'll do a tutorial on using web.py, just let me know in the comments.
Concluding on this way of working, I could be editing python code in idle, while viewing the result of my web application in a web browser (either locally through midori or remotely using my desktop's browser). But that, is just touching the tip of the iceberg. There will be more to come in the coming weeks.