Setup on BeagleBone Black running Ångström
Note: This guide still suggests to install OctoPrint globally instead of into a virtual environment. Anyone currently being able to test on a BBB and being able to document how to do it properly: Please update this page correspondingly, it's a wiki!
Important: This guide expects you to have a basic grasp of the Linux command line. In order to follow it you'll need to know
- how to issue commands on the shell,
- how to edit a text file from the command line,
- what the difference is between your user account (e.g.
octo) and the superuser account
- how to use the Internet to help you if you run into problems.
Ideally you'll also know
- how to SSH into your BBB (so you don't need to also attach keyboard and monitor) and
- how to use Git.
The following setup guide was created based on the Ångström BeagleBone Black image
Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone-2013.05.24.img.xz from the angstrom archive. Newer versions are available from the main angstrom download site.
First things first: If you haven't already, please create a user account for running OctoPrint from:
useradd octo passwd octo
Then login as that user.
For the basic package you'll need Python 2.7 (should be installed by default), pip and a couple of dependencies:
cd ~ su ntpdate -b -s -u pool.ntp.org opkg update opkg install python python-modules python-pyserial python-numpy python-setuptools python-misc python-pip git exit git clone http://github.com/foosel/OctoPrint cd OctoPrint su pip install . exit
Note: Without the
ntpdate line in the above steps,
pip might give an error regarding SSL, e.g.
Could not fetch URL https://pypi.python.org/simple/flask/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed>)
caused by your BBB thinking it's 2000. Running
ntpdate is a temporary fix for this. It will reset again when the BB restarts. A more permanent solution that will sync the time when an internet connection is available:
su opkg update ; opkg --force-reinstall install connman-angstrom-settings exit
Here you can find another permanent solution that uses NTP to sync the clock periodically. This also protects against bug clock skews due to a bug in the AM335x processor silicon.
You may need to add the pi user to the dialout group and tty so that the user can access the serial ports:
su usermod -a -G tty octo usermod -a -G dialout octo
You should then be able to start the OctoPrint server:
beaglebone:~/OctoPrint$ ./run 2013-06-02 10:50:21,232 - octoprint.server - INFO - Listening on http://0.0.0.0:5000
In order to update your installation to the current status from the repository, perform the following steps:
cd ~/OctoPrint/ git pull su pip install -r requirements-bbb.txt exit
If you want to switch to a different branch, e.g.
devel or a feature branch, perform the following commands:
cd ~/OctoPrint/ git pull git checkout <branch> su pip install -r requirements-bbb.txt exit
The stable branch is
master, the development branch is
devel, feature branches vary depending on the current development focus.
If you also want webcam and timelapse support, you'll need to download and compile MJPG-Streamer:
cd ~ su opkg install subversion libjpeg-dev imagemagick exit svn checkout svn://svn.code.sf.net/p/mjpg-streamer/code/ mjpg-streamer-code cd mjpg-streamer-code/mjpg-streamer-experimental make
This should hopefully run through without any compilation errors. You should then be able to start the webcam server:
beaglebone:~/mjpg-streamer-experimental $ ./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so" MJPG Streamer Version: svn rev: i: Using V4L2 device.: /dev/video0 i: Desired Resolution: 640 x 480 i: Frames Per Second.: 5 i: Format............: MJPEG [...] o: www-folder-path...: disabled o: HTTP TCP port.....: 8080 o: username:password.: disabled o: commands..........: enabled
If you now point your browser to
http://<your BBB's IP>:8080/?action=stream, you should see a moving picture at 5fps.
Note: I had issues with permissions for the webcam and the device disappearing from time to time. Still working on that, so take this with a grain of salt.
~/.octoprint/config.yaml (just create it if it doesn't exist yet) and add the following lines to it:
webcam: stream: http://<your BBB's IP>:8080/?action=stream snapshot: http://127.0.0.1:8080/?action=snapshot ffmpeg: /usr/bin/ffmpeg
Restart the OctoPrint server and reload its frontend. You should now see a "Webcam" tab with content.