N900 with a Slice of Raspberry Pi
N900 as a Remote Display
Now that I have a point-to-point local network between my N900 and Raspberry Pi, I've removed the need to connect a network cable, but I still have that pesky HDMI cable to get rid of. After all, you may want to hack on your Raspberry Pi in places where you don't have an HDMI-enabled display handy. Luckily, with a few tweaks you can use your N900 touchscreen as a display for the Raspberry Pi and still be able to use a keyboard or mouse you have connected to the Raspberry Pi for input.
Unfortunately, I can't just connect the composite out or HDMI out of
the Raspberry Pi into the N900, but what I can do is take advantage
of the relatively low-latency local USB network and share the N900 X
display over VNC. The first step is to install the x11vnc package on
the Raspberry Pi with
sudo apt-get install x11vnc.
Once x11vnc is installed, I need to set it up so that it automatically
launches when X launches. I suppose this isn't absolutely necessary.
After all, you could
ssh in every time and start it yourself, but I
think having it automatically launch is much more convenient. To do this,
create a file called /home/pi/.config/autostart/x11vnc.desktop with the
[Desktop Entry] Name=X11VNC Server Comment=Share this desktop by VNC Exec=x11vnc -forever Icon=computer Terminal=false Type=Application StartupNotify=false #StartupWMClass=x11vnc_port_prompt Categories=Network;RemoteAccess;
Next, I need to change the settings for the x11-common package so that
it allows X sessions to be launched by any user. This is necessary so
that I can run
startx at boot time automatically. Without this change,
X will detect it's not being run from a console session, and it will error
out. To do this, run
sudo dpkg-reconfigure x11-common, and when prompted
to select "Users allowed to start the X server", select Anybody.
The final step is to start X at boot time. There are a number of ways to do this, but one of the easiest ways on the Raspberry Pi is via the /boot/boot.rc file. By default, the file is not there, but if present, it allows you to specify commands to run during the boot process so you can do things like enable SSH or start X. The following /boot/boot.rc file does both:
# sourced from rc.local on Raspberry Pi # # Name this file as "boot.rc" and put it on the boot # partition if you want to run it. # echo "Checking ssh and enabling if absent" if ! ls /etc/rc5.d | grep "^S..ssh\$" >/dev/null; then insserv ssh service ssh start fi su pi -c startx
Once you boot the Raspberry Pi and set up the local USB network, if
ssh in and run
ps -ef, you should see that x11vnc is running. Now
you can launch a VNC client from the N900 (I prefer Presence VNC)
and connect to 10.8.174.10, and you should see a copy of your Raspberry
Pi X session (Figure 2). If you had the HDMI cable connected when the
Raspberry Pi booted, the X session should be at full 1080p resolution,
which might show up a bit small on the N900 screen. However, if you boot
without HDMI connected (which is the general use case for this hack),
the X session will be configured for composite output and be at a more
manageable 640x480. At this resolution, once you tell Presence VNC to go
full screen, it uses up the full N900 display, and because you are sharing
a real X session on the Raspberry Pi, you can use any keyboard or mouse
you have plugged in to it. Sure, it's not as nice as a giant 1080p display,
but then it's hard to fit one of those in your pocket.
Figure 2. Presence VNC on N900 Connected to the Raspberry Pi
Although I've talked about the N900 a lot for this hack, the same principles should work to turn just about any device that can run a VNC client into a display for the Raspberry Pi, provided the two devices can connect over the network. In fact, if you are one of the many people who carry a color tablet around anyway, that would be a quite ideal display for the Raspberry Pi.
Kyle Rankin is a VP of engineering operations at Final, Inc., the author of a number of books including DevOps Troubleshooting and The Official Ubuntu Server Book, and is a columnist for Linux Journal. Follow him @kylerankin.
|Happy Birthday Linux||Aug 25, 2016|
|ContainerCon Vendors Offer Flexible Solutions for Managing All Your New Micro-VMs||Aug 24, 2016|
|Updates from LinuxCon and ContainerCon, Toronto, August 2016||Aug 23, 2016|
|NVMe over Fabrics Support Coming to the Linux 4.8 Kernel||Aug 22, 2016|
|What I Wish I’d Known When I Was an Embedded Linux Newbie||Aug 18, 2016|
|Pandas||Aug 17, 2016|
- Happy Birthday Linux
- ContainerCon Vendors Offer Flexible Solutions for Managing All Your New Micro-VMs
- Updates from LinuxCon and ContainerCon, Toronto, August 2016
- New Version of GParted
- What I Wish I’d Known When I Was an Embedded Linux Newbie
- NVMe over Fabrics Support Coming to the Linux 4.8 Kernel
- Tor 0.2.8.6 Is Released
- All about printf
- Downloading an Entire Web Site with wget
- Blender for Visual Effects
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide