Skip to main content

OrangePi OctoPrint Installation

This passage is based on YouTube Installing Armbian and OctoPrint on an Orange Pi, https://www.youtube.com/watch?v=LzLb_FnXu70.

Update and upgrade your OS
1. sudo apt-get update
2. sudo apt-get upgrade

Create your user and give it sudo permissions
3. sudo adduser octoprint
4. sudo usermod -a -G tty octoprint
5. sudo usermod -a -G dialout octoprint
6. sudo adduser octoprint sudo
7. sudo visudo

Scroll to the bottom of the document, and add the line at the bottom
octoprint ALL=(ALL) NOPASSWD:ALL
Ctrl + O to save, Ctrl + X to exit

Remove the password from the octoprint user
8. sudo passwd octoprint -d

Install the required support software to make this all work
9. sudo apt-get install git python-pip python-dev python-setuptools psmisc virtualenv
* This line cannot fully completed in my Armbian Focal with Linux 5.4.43-sunxi64.
* Probably we need to install both Python 2.7 and Python3, try
sudo apt-get install python2
sudo apt-get install python3

Switch to the octoprint user and confirm your identitiy
10.sudo su octoprint
11. whoami

Now install PySerial V2.7

12. cd ~
13. wget https://pypi.python.org/packages/source/p/pyserial/pyserial-2.7.tar.gz
14. tar -zxf pyserial-2.7.tar.gz
15. cd pyserial-2.7
16. sudo python setup.py install

Download and compile the latest version of OctoPrint
17. cd ~
18. git clone https://github.com/foosel/OctoPrint.git
19. cd OctoPrint
20. virtualenv venv
21. ./venv/bin/python setup.py install

Start OctoPrint for the first time

22. ~/OctoPrint/venv/bin/octoprint serve

With OctoPrint running, you should be able to access it using your local browser.
Open the page in your local browser by entering [yourorangepiipaddress]:5000

Now, all that's left to do is make OctoPrint run on startup
In putty, Control + Z to end your run. Issue a reboot to start fresh
23. sudo cp ~/OctoPrint/scripts/octoprint.init /etc/init.d/octoprint
24. sudo chmod +x /etc/init.d/octoprint
25. sudo cp ~/OctoPrint/scripts/octoprint.default /etc/default/octoprint
26. sudo nano /etc/default/octoprint
Change the user to octoprint, and then edit the DAEMON line to remove the hashtag ad the beginning, and set the proper operating directory
DAEMON=/home/octoprint/OctoPrint/venv/bin/octoprint
OCTOPRINT_USER=octoprint
Ctrl + O to save, Ctrl + X to quit

Update the defaults

27. sudo update-rc.d octoprint defaults
28. sudo service octoprint start



Kevin Lee
7 June 2020
Hong Kong.

Comments

  1. To get PIP installed with Python2 just follow these instructions: https://linuxize.com/post/how-to-install-pip-on-ubuntu-20.04/

    Ubuntu 20.04 does not ship python-pip package out of the box and needs some tricky approach.

    ReplyDelete

Post a Comment

Popular posts from this blog

Install/Setup Xfce and TightVNC to Armbian OrangePi

Following https://www.instructables.com/id/The-OrangePi-Lite/ , the next instruction after network started is usually VNC server setup. Many Internet resources suggested TightVNC, an open source software for this purpose. However, Armbian distribution for OrangePi does not include any X window desktop, therefore install TightVNC itself is just half of the journey. This is how I complete the work. 1. Make sure Armbian is updated: sudo apt-get update sudo apt-get upgrade 2. Install XFont used by TightVNC server sudo apt-get install xfonts-base 3. Install TightVNC server sudo apt-get install tightvncserver 4. Create a user dedicate for this service. I use user ID 'vnc' sudo adduser vnc gpasswd -a vnc sudo 5. Setup this user for VNC server, vncserver :1 We need to assign a password. No need to specify a view-only password. Use the command to confirm the server is running and the default options applied ps -ef | grep Xtightvnc 6. VNC Client can now conn...

Configure OrangePi Lite WiFi

There are many websites and Youtube videos show you how to install Armbian to OrangePi with a SD-card. There are many ways to connect to the initial console of the device. Most of them tell you to utilize the LAN interface. This is a quick and easy method, however, my OrangePi Lite simply lacks a LAN interface. We need to setup Wifi before we can use it for console connection. But without the console how can we setup Wifi connection? Finally I used a USB to TTL device. With only 3 wires I connected the device to OrangePi: Rx-Tx, Tx-Rx, and GND-GND. Then I can use PuTTY to bring up the console thru SSH. Up to this point basically I am following this website: https://www.instructables.com/id/The-OrangePi-Lite/ . I continued with the instructions and successfully connect to WiFi, but puzzle why I have do that with so many manual editings. Especially when I edit the /etc/network/interface file, it has a remark say "# Network is managed by Network manage". My question is can N...

Setup USB Camera to work in Octoprint

This passage summerize the website "Orange Pi Zero and Webcam for Octoprint", https://www.iot-experiments.com/orange-pi-zero-and-webcam-for-octoprint/, aimed to make my life easier. Check the USB webcam present, octoprint@orangepizero:~$ lsusb Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 002: ID 046d:0826 Logitech, Inc. HD Webcam C525 Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 007 Device 002: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub To discover webcam information, (octoprint@orangepizero:~$sudo apt-get install hwinfo) octoprint@ora...