Setup OctoPrint on Raspberry Pi 2 with Ubuntu

OctoPrint is a server controlling a 3D-printer over web-interface, running on the small computer like Raspberry Pi or PCDuino with Linux OS. This article describes how to setup OctoPrint on Raspberry Pi 2 with Ubuntu OS. Read another article to setup OctoPrint on PCDuino.

Raspberry-Pi-2-with-connectors  OctoPrint-intro

Raspberry Pi 2 has ARMv7-based CPU on-board – this allows to run Ubuntu directly on this small computer. Ubuntu has plenty of features in compare to special editions of Linux distributives for such small devices and therefore less limitations with installing specific programs and components on it.

Rasspberry-Pi-2-on-3d-printer

Setup Ubuntu on RaspberryPi 2

For Windows users watch nice video instruction How to Setup a Raspberry Pi Without a Monitor or Keyboard. For Linux users – follow this instruction.

Put the CF-card into Raspberry Pi card slot, connect keyboard to USB, monitor to HDMI port and power supply to the micro-USB.

When Ubuntu is started – the console shows the OS version and prompts to login – enter the user name “ubuntu” and the password “ubuntu”

Ubuntu 14.04.2 LTS ubuntu tty1
ubuntu login:

Update and upgrade “apt-get” repository (this takes few minutes)

sudo apt-get update
sudo apt-get upgrade

hint Connect to the Raspberry Pi board with terminal from another PC

Install SSH server to be able to connect to the Raspberry Pi board with terminal from another PC so there wouldn’t need to use a keyboard and monitor connected to Raspberry Pi board – it only need to be connected to local network and to power supply

sudo apt-get openssh-server

Plug in the LAN cable connected to the home router and find out the IP address provided to the Raspberry Pi board

ifconfig

Ubuntu-ifconfig-find-out-lan-ip-address

“eth0” is the name of the LAN Ethernet adapter. For WiFi adapter this would be “wlan0”.

Open your favorite terminal application (e.g. PuTTY) on a PC computer. This PC should be connected to the same local network as Raspberry Pi (e.g. to the same home network router). Connect to the IP address found with the command ifconfig with the user “ubuntu” and password “ubuntu” (or appropriate password if the default password was changed)

PuTTY-connect-to-SSH

PuTTY-connected-via-SSH

Now most of operations can be performed remotely.

Follow the instruction for setting-up OctoPrint.

Follow the instruction for automatic starting-up the OctoPrint on booting of Raspberry Pi.

Raspberry-Pi-2-with-keyboard-monitor

hint Run Ubuntu with GUI

The setup described below runs Ubuntu without GUI. To be able to use desktop install Lubuntu, Xubuntu or Kubuntu. Lubunto might be preferable due to its low resource usage

sudo apt-get install lubuntu-desktop

This installation of Lubuntu contains many features (like LibreOffice), most of them can be removed by following command

sudo apt-get autoremove

It is expected to remove obsolete or not used dependencies but it will also remove some applications (e.g. LibreOffice).

Installed GUI desktop can be also used remotely with VNC server and client.

While wired LAN connection usually works without any effords just after plugging in LAN connector to Raspberry Pi, setting-up of  a WiFi USB-adapter can be a challenging operation.

hint Setup WiFi USB-adapter

WiFi USB-adapter (USB-dongle) consumes noticeable power but it brings more mobility to the Raspberry Pi. Linux firmware need to be installed to support it

sudo apt-get install linux-firmware

For configuring wireless connection with GUI and console utils there are many tutorials – for instance this and this. RaspberryPi.org also has instructions.

Network Manager is part of Ubuntu installation or can be installed manually (read more about Network Manager). Following commands install the program and an applet. The applet icon gets available in the tray after restart of the Raspberry Pi board.

sudo apt-get install network-manager
sudo apt-get install network-manager-gnome

Another popular network manager is Wicd. It has many settings

sudo apt-get install wicd

Check out also Basic Ubuntu Security Guide.

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmail

One thought on “Setup OctoPrint on Raspberry Pi 2 with Ubuntu

  1. Centos VPS

    OctoPrint does not need to run with root privileges, which it would need to to be able to bind to port 80 thanks to Linux privileged port restrictions

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *