|Last modified: 19-07-2015|
The SheevaPlug (I used the 003-SP1001) is a tiny "walwart" Linux appliance based on the Kirkwood SoC with an ARM embedded Marvell Sheeva (88F6281, ARM9E ARMv5TE; "E" processors include DSP instructions; Sometimes referenced as ARMv5TEL) CPU core running at 1.2Ghz.
As of September 2009, the SheevaPlug that ships with the SDK
has 512MB RAM and 512M flash memory, an Ethernet connector, a mini-USB 2.0 plug
and an SD slot so you can have more storage space.
As of 2010, the SheevaPlug part of the Development Kit ships with Ubuntu 9.04 pre-installed ("Ubuntu 9.10 Karmic Koala is not going to work on the sheevaplug because as of Karmic, Ubuntu builds with ARMv6+VFP instructions (and as of 10.04 with ARMv7 instructions), which the ARMv5TE processor on the sheevaplug can't do." source) You should upgrade to Debian (or Android, for the more adventurous.)
Important: If the blue LED on top, next to the green LED, doesn't light up, the unit could have a faulty power supply, and you won't be able to connect to it. If you know enough about electronics, you can replace the faulty capacitors yourself, and if not, order a new PSU from either GlobalScale (USA) or NewIT (UK). More information here and here, and in "How to replace AD-DC power supply module for SheevaPlug" (with hands-on infos).
Connect the USB key to Windows, and let P'nP do its thing. If you need drivers, here they are (alternative here and here) and more information. Also, here's a howto on connecting to the SheevaPlug from Windows. Yet another tutorial.
You should be able to log on as root / nosoup4u
Unplug, replug the SheevaPlug, and watch it launch the UBoot boot-loader
A warm reboot of the SP while in Uboot can be done through "reset"; A warm reboot while in Linux requires "reboot". If you need to perform a cold reboot by unplugging and replugging the SP, on the workstation, you'll have to run chown + cu again
Once Ubuntu is up and running, you can connect to its SSHd server instead of working through the USB connection, using the same login/password as when connecting through the USB connection.
FYI, the device takes about 2mn to boot the whole Ubuntu until you can connect through SSH.
"Notice that on my Ubuntu machine, the device is writable by anyone in the dialout group. So I added myself to that group -- I had to log out and back in for the change to take effect. Of course you can run sudo chmod a+rw /dev/ttyUSB0 as a temporary fix." (source)
Next, follow those tips to fix issues in Ubuntu as shipped with the SheevaPlug.
apt-get --purge remove exim4
apt-get --purge remove openbsd-inetd
apt-get --purge remove nfs-kernel-server nfs-common portmap
apt-get --purge remove rpcbind
For some reason, this doesn't work when logging on through SSH: You need to add aliases in ~/.bashrc as well. Alternatively, log on and "source /etc/profile".
Turn off USB
As the SheevaPlug originally ships with Ubuntu which no longer supports the ARM processor used in this device, the only way to keep it up-to-date is to migrate from Ubuntu to Debian (or some other OS that supports that processor).
If you are using the Marvell version of Uboot, you need to upgrade it before upgrading to Debian. Based on Martin Michlmayr's Upgrading SheevaPlug's U-Boot:
Debian installer does not support installation to MTD. You must first install Debian on a USB stick or an SD card before copying the contents of the USB stick/SD card into the NAND memory.
Here's the procedure as explained in Matthias Blaicher's Installing Debian on a Sheevaplug into Flash:
You should know be a happy Debian 6.0 user.
To upgrade the kernel, simply run "apt-get update && apt-get upgrade", connect to the Sheevaplug through the mini-USB port and a serial terminal emulator, and type "reboot". You should then be running the latest and greatest.
You can also connect through SSH, hit "reboot", wait for the new kernel to start, and reconnect: If you can't connect, connect in Serial mode, and investigate.
Run "uname -a" to check that you are indeed running the latest release.
Here's how to install a fresh SD card, install Debian into the 512MB NAND flash memory, install user writable files in the SD card, and configure Linux to put temporary files in RAM to reduce wear on the NAND and SD card:
How to partition MTD to hold Uboot, and Debian?
How to partition SD card?
How to configure Debian so that
files in NAND are read-only (except
during upgrades), temporary files lives in RAM or SD card, and user
files are located on SD card?
How to check health of NAND and SD card?
Here's how to install Debian on an SD card
On the Sheevaplug, install a tested and reliable SD card in the slot
On an external host, install a TFTP server and the two following files
Connect the external host to the Sheevaplug through the mini-USB port, and connect to it with a terminal emulator (eg. for Windows: Putty)
Use a pin to restart the Sheevaplug (The reset hole is on the right of the SD slot), and, before Uboot starts the current OS, hit any key when you see the Uboot prompt
Type the following commands to tell Uboot to download the two files from the external host:
Launch the Debian installer:
Once Debian is installed on the SD, type "reboot" and hit any key when you see the Uboot prompt
Run the following command to save the boot code to ????
To reduce the number of writes to the NAND memorywww.plugcomputer.org/plugwiki/index.php/Reduce_Flash_Writes
"By default, the SheevaPlug has 512MB of NAND flash memory for storage, and 512MB or RAM. When you boot your plug from NAND it copies the necessary files to a RAM disk (a virtual disk on RAM which disappears when the plug is powered off). If I understand correctly, this will in effect reduce the available RAM since some of it is used by the file system."http://theblawblog.wordpress.com/2009/04/18/turning-my-sheevaplug-into-a-web-server/
Important: Ubuntu 9.04 is the last version that will run on the SP because later editions of ARM Ubuntu are compiled in such a way as to be incompatible with the SP ("Ubuntu no longer supports the ARMv5 line of processors"), so upgrading to a more recent Linux release requires moving to a different distro. Debian seems to be the favorite distro to move from Ubuntu, although other distros can run (Gentoo, Fedora, etc.).
The alternative Debian install method: "The script is a method of building your own SheevaInstaller or EISA root filesystem image based on the latest files from the Debian repository. To deploy it, you need to use sheeva installer or EISA "
I didn't actually go further since the procedure above worked.
Sheevaplug installer 1.0 (last updated 2009)
Lots of people have problems running either runme.php (Linux) or runme.exe (Windows). Didn't try the SP Installer.
Easy Plug Computer Installer (ESIA). Discontinued. QT-based, Windows appplication.
Didn't try but could be useful:
apt-get install openssh-server
First, upgrade to Vim, and see if it solves the problem.
apt-get install vim
# which vi
# vi --version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jul 12 2010 19:44:33)
# echo $TERM
Nginx is actively supported for ARM processors and is available directly from the Nginx site: Just update /etc/apt/sources.list, update, and install.
Note: "nginx -V" might not include "http_uwsgi_module" but still have been compiled with support for uWSGI.
Nginx keeps its docroot in /usr/share/nginx/html/.
I failed cross-compiling Nginx, but compiling directly on the SheevaPlug did work. But then, since the ARM port of Nginx is actively maintained, there's no need for compiling your own unless the official port is missing some bits.
uWSGI includes an HTTP which could be good enough for moderate use, but Nginx, Apache, or Lighttpd could be set up as front-end for more heavy-duty use.
The project got its name because Python was the first supported plug-in, but uWSGI handles more languages such as Lua or PHP.
Also, there's a confusion between the application (uWSGI) and one of the protocols it supports to talk to the web server (uwsgi, in addition to HTTP, FastCGI, and SCGI). Note that uWSGI can run as an HTTP server, or sit behind an HTTP server. As of April 2013, Nginx and Cherokee speak uwsgi natively.
Note: Compiling uWSGI directly on the SheevaPlug only takes a few minutes.
Here's how to write a WSGI script to call through uWSGI:
To make sure the syntax in the Python script is OK: "python -m py_compile foobar.py". When copy/pasting from a web page, an easy way to get rid of wrong invisible characters (tabs, carriage-returns) is to paste into eg. Windows Notepad before pasting it into vi on the SheevaPlug. Also check PyLint, PyFlakes, and PEP8.
If you get "Fatal Python error: exceptions bootstrapping error" when running uWSGI: Apparently, it's an old issue that pops up when starting uWSGI with a Python script and that's never been fixed. The work-around is to provide support for Python as a plugin instead of compiling it directly in the uWSGI binary:
Here's some info about recompiling Python, which seems to solve this issue.
What is a uWSGI process? Python interpreter + opcode version of Python script?
How does uWSGI work, stand-alone or with Nginx?
FastCGI + Flup
Gunicorn, uWSGI: Better option that FastCGI
We'll use FastCGI instead of CGI, as CGI is too slow on an appliance like the SheevaPlug.
fastcgi.server = (
".php" => ((
"bin-path" => "/usr/bin/php5-cgi",
"socket" => "/tmp/php.socket"
"django.fcgi" => (
"main" => (
"host" => "127.0.0.1",
"port" => 9090, #set the port numbers to what-eva you want
"admin.fcgi" => (
"admin" => (
"host" => "127.0.0.1",
"port" => 9091,
"PlugPBX was started to provide the world with an easy way of getting FreePBX and Asterisk working on the SheevaPlug."http://plugcomputer.org/plugforum/index.php?topic=98.0
apt-get install git-core build-essential autoconf automake libtool libncurses5 libncurses5-dev gawk libjpeg-dev libz-dev pkg-config
Marvell provides a binary toolchain for Linux ("Host SW Support Package For Linux").
Note that release 1.1 from 26 March 2010 contains two files, but the second file (Linux Host Filesystem - rootfs.tar.bz2), besides having spaces in its filename, isn't actually a BZ2 file but a regular tar.gz: Rename the file to eg. rootfs.tar.gz and decompress it with the usual "tar xzvf".
Once decompressed with "unzip", it creates two directories in LinuxHost/:
Download either "Host SWSupport" or the rootfs tar. Inside one there will be a shadow usr/include and usr/lib directory. You must point the host tools to these directories when compiling so they don't pick-up your development host versions. You need the headers and static/shared libraries as deployed to the SheevaPlug.
When using the toolchain, there's apparently no need to tell the compiler where to find the includes and libraries, as it is compiled with those paths included:
The compiler was compiled against Linux 2.6.14 ("file myfile").
Start by cross-compiling the "Hello, world!" sample using LinuxHost/gcc/bin/arm-none-linux-gnueabi-gcc as the compiler.
Some applications will cross-compile by just setting the CC environment variable:
Others might require editing the PATH variable to include the full-path to the gcc/bin/ directory:
To save space, embedded Linux usually uses uClibc instead of glibc, and busybox to pack a bunch of user-space binaries into a single binary.
Some useful articles in the Howtos section of Marvell's PlugComputer site.
How to check if an application really works as well as on x86, with no memory leaks, etc.?
Other solutions to compile your own toolchain:
toolchain for armel instead of armhf ("Debian officially provides
two ARM architectures, armel and armhf. armel is for lower end hardware, supports
the ARMv4 instruction set and hardware floating-point though a compatibility
mode which slows performance but allows compatiblity with code written for processors
without floating point units. armhf is for higher end hardware and supports
ARMv7 and faster, direct hardware floating point support without backwards compatibility.
These are roughly analogous to the i386 and i686 architectures.
Note that in Ubuntu, both armel and armhf are compiled for ARMv7 and above, so neither will work on the Raspberry Pi.")
For inspiration, here's the script to build the cross toolchain for the Xilka systems:
Here's an example:
Cross-compiling can be difficult or even impossible with some applications. If all else fails, try compiling the application directly on the SheevaPlug: If you're concerned about wearing out the NAND flash memory, use an SD card, a USB stick or an external hard drive instead.
Type? Biggest size allowed?
Edit /etc/privoxy/config, where 192.168.0.1 is the IP address of the host running Privoxy:
Edit /etc/apt/sources.list to comment out the single line and change it to this:
If using cu (Taylor UUCP) 1.07, log on to the embedded Linux, and type "~.<ENTER>"
To avoid running chown uucp /dev/ttyUSB0 after every reboot
Ubuntu 9.04 debian ttyS0
debian login: ~é[Unrecognized. Use ~~ to send ~]
Ubuntu 9.04 debian ttyS0
debian login: ~
Ubuntu 9.04 debian ttyS0
The original PSU is known to fry easily. Order a new PSU from GlobalScale/NewIT or change the electronics yourself.