Skip navigation

This blog tutorial will address taking advantage of features available in X Windows on the Raspberry Pi.

 

What is X Windows

 

 

From Wikipedia:

The X Window System (X11, or shortened to simply X, and sometimes informally X-Windows) is a windowing system for bitmap displays, common on UNIX-like computer operating systems.

X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting with a mouse and keyboard. X does not mandate the user interface — this is handled by individual programs. As such, the visual styling of X-based environments varies greatly; different programs may present radically different interfaces.

X's design requires the clients and server to operate separately...

 

Modern X implementations use Unix domain sockets for efficient connections ...

 

Taking advantage of this design

 

OK. What does this mean to us. What we now know is that X Windows is the windowing system for UNIX/GNU Linux type operating systems. We know that the client and the server operate separately, and we know that it uses sockets for communication.

 

Taking advantage of the fact that the client and the server operate separately and communicate through sockets, we can run the client (the GUI program) on one machine and display the output on another machine running an X server.

 

On a linux system, this is a trivial task. I currently run Ubuntu on my desktop, and my Raspberry Pi is connected to my local network. Without any special configuration I can log in to my Pi via ssh, start a GUI program, and have it display on my local monitor. This avoids the necessity of having an additional keyboard and monitor setup just for the pi.

 

unix screenshot

 

You'll notice that in the terminal, I started out on my desktop, onyx, did

ssh -X pi@raspberrypi.home

 

Notice I typed the ssh command with the -X argument. This allows X11 information to be forwarded. There are security implications to this, but I leave the research of those up to the reader. For a home development network this is probably not an issue.

 

once logged in there, I simply typed

geany &

 

to start the geany program, and it displayed locally. The & means to run the program in the background, and to return control of the terminal to the user.

 

If you look at the title bar of the application, you can see that it says

 

Geany (on raspberrypi)

 

and I am able to open files on the raspberrypi in the geany editor, and display them locally. I can hit F9 to compile, and F5 to run, and the output displays on my screen, as if I were running locally.

This saves the step of editing locally and copying the files to the pi, or of logging into the pi and running a text based editor, such as vi or nano. All of the processing takes place on the pi. The compilation, the save, and the execution. Only the display is forwarded.

 

Realize this capability takes no (with the exception of the editor, geany, but any gui program will work)  additional software other than what comes with both a standard Ubuntu installation on my desktop, and raspian, as distributed, for the pi.

 

What about windows users?

 

Fortunately, you are in luck. There are packages available that will give you the same capability. One such program is MobaXterm, available at MobaXterm free Xserver and tabbed SSH client for Windows . There is a free Home Edition and paid for professional edition that each provide a terminal, an X Server, and other tools. This is one of several packages, but this is the one I have been using when I work from a windows system. I'm not going to cover setup and installation, it was a typical windows install. Once it is installed though, this is what you can expect:

 

windows screenshot

 

This is a capability I have taken advantage of for years that I get the feeling people new to the Raspberry Pi and linux world are not aware of. This is a great way to take advantage of your existing hardware without having to setup vnc or any other type of screen sharing system. It allows you to only display the applications that you are using integrated seamlessly into your current desktop.

 

Bear in mind, there are configurations, network setups, etc..., that can cause this not to work as easily as I have demonstrated above, I would urge you to search google for the answers for issues you encounter if you decide to attempt this. This technology is 20+ years old, and there is a wealth of information for it already on the net.

 

If you were aware of this prior to this post and have something to add, please leave a comment, if this is new to you, I hope it helps.

 

BTW, this is not limited to the Raspberry PI, this works on odroids, beagle bones, and pretty much any of the SBCs running a variant of linux, It also works the other way as well, if you have a ras pi with a monitor and keyboard connected, you can login to another pi or unix machine on your network and do the same thing.

http://www.pcworld.com/article/3027446/hardware/irate-comcast-subscriber-turns-raspberry-pi-into-a-watchdog-for-slow-internet-speeds.html

 

One Comcast customer has a Raspberry Pi complain to the company every time his fast connection becomes too slow.

There’s nothing more frustrating than dealing with slow Internet at home, especially when you’re paying a steep premium for a fast connection speed. Washington, DC-basedReddit user and Comcast customer AlekseyP came up with an interesting solution for this problem. Instead of wasting time calling up Comcast over the issue, he is using the power of Raspberry Pi to complain to the Internet Service Provider over Twitter under the name @A_Comcast_User.

Every hour, AlekseyP’s Raspberry Pi (he didn’t specify which model) runs Internet speed tests and then stores that data. If his Internet speed drops below 50 megabits per second, the Pi tweets at Comcast about the slow speeds. AlekseyP says he pays for 150mbps down and 10mbps up.

Since AlekseyP’s Twitter script went live on October 30, his bot has tweeted at Comcast 16 times over Internet connection speeds. He says Internet usage at home is not causing the drop in bandwidth. In fact, he says that many times the tweets happened when no one was at home, or late at night when everyone was asleep.

Comcast tends to respond to most direct consumer complaints on Twitter and in this respect the company hasn’t failed AlekseyP. But the Reddit user declines Comcast’s request for help every time it’s offered. “I have chosen not to provide them my account or address because I do not want to singled out as a customer; all their customers deserve the speeds they advertise,” he said on Reddit.

 

The impact on you at home: If you’re a Comcast customer, or with another ISP that handles customer service on Twitter, you can play along with a Raspberry Pi, too. AlekseyP posted the code to his Python script on Pastebin. This code will help get you started, but you’ll also need to install dependent programs and utilities such as speedtest-cli, a command line interface program that tests your bandwidth speeds via speedtest.net. Python, the core scripting language behind the tool, should already be installed on your Raspberry Pi’s operating system.

Filter Blog

By date: By tag: