Howto: OctoPrint Working on Pine 64
#1
Information 
So I've setup a guide on how to setup Octoprint on the Pine64 2gb model. It is kind of lengthy and the only thing I don't have working quite yet is webcam support. But it is coming! 

Pine64 Octoprint setup

1. Download Base Debian Image
2. cd /usr/local/sbin/
3. sudo ./resize_rootfs.sh
4. sudo apt-get update
5. sudo apt-get upgrade
6. sudo reboot now 


****WIFI SETUP****
****use ifconfig to find ip first, then ssh into ethernet ip***
1. sudo nano /etc/network/interfaces
2. add the following:
***comment out
#auto eth0
#iface eth0 inet dhcp
****will get stuck at boot without this when not connected to ethernet
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR-SSID-HERE"
wpa-psk "YOUR-PASSWORD-HERE"
3. sudo ifup wlan0
4. sudo ifconfig wlan0
5. ping router-ip-here
6. ping google.com
7. sudo service networking restart 
8. sudo reboot now 

****Octoprint Setup Without Webcam****
1. cd ~
2. sudo apt-get install python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential
3. git clone https://github.com/foosel/OctoPrint.git
4. cd OctoPrint
5. virtualenv venv
6. ./venv/bin/pip install pip --upgrade
7. ./venv/bin/python setup.py install
8. mkdir ~/.octoprint
9. sudo usermod -a -G tty debian
10. sudo usermod -a -G dialout debian

***To Test Octoprint is working
11. ~/OctoPrint/venv/bin/octoprint

***This section allows for starting Octoprint when at boot
12. sudo nano ~/OctoPrint/scripts/octoprint.init
***edit following to:
DAEMON=/home/debian/OctoPrint/venv/bin/octoprint
13. sudo nano ~/Octoprint/scripts/octoprint.default
**edit following to:
OCTOPRINT_USER=debian
DAEMON=/home/debian/OctoPrint/venv/bin/octoprint
14. sudo cp ~/OctoPrint/scripts/octoprint.init /etc/init.d/octoprint
15. sudo chmod +x /etc/init.d/octoprint
16. sudo cp ~/OctoPrint/scripts/octoprint.default /etc/default/octoprint
17. sudo update-rc.d octoprint defaults
18. sudo service octoprint {stop|start|restart}
----You should now be able to boot into octoprint from <PINEIP:5000> from a web browser

***Make everything accessible on port 80
1. sudo apt-get install haproxy
2. sudo nano /etc/haproxy/haproxy.cfg
***add following to bottom
   global
        maxconn 4096
        user haproxy
        group haproxy
        daemon
        log 127.0.0.1 local0 debug

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull
        retries 3
        option redispatch
        option http-server-close
        option forwardfor
        maxconn 2000
        timeout connect 5s
        timeout client  15min
        timeout server  15min

frontend public
        bind *:80
        use_backend webcam if { path_beg /webcam/ }
        default_backend octoprint

backend octoprint
        reqrep ^([^\ :]*)\ /(.*)     \1\ /\2
        option forwardfor
        server octoprint1 127.0.0.1:5000

backend webcam
        reqrep ^([^\ :]*)\ /webcam/(.*)     \1\ /\2
        server webcam1  127.0.0.1:8080

3. sudo nano /etc/default/haproxy
***add following to bottom
ENABLE=1

4. sudo nano ~/.octoprint/config.yaml
***add following to bottom
server:
host: 127.0.0.1

***This is will now allow you log in to OctoPrint from <PINE64IP>.

TO change that from <PINE64IP> to pine64.local 
1.sudo apt-get update && sudo apt-get install avahi-daemon
2. sudo reboot 
Note: If using Windows PC to log in to pine64.local install Bonjour
  Reply
#2
awesome work!! Please post up if you figure out the camera support, such as for logitech cameras thanks.
  Reply
#3
Thank you, fine work; please let me know when the camera support is available and I will pin this. I think we need a 3D sub-forum too; will ask Kh Goh to setup... thanks again.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply
#4
EDIT----- There are tons of errors on this post.. Whoops, but I'm leaving it here for archival reasons.


I put together an image for a 4gb card with octoprint along with the curaengine, and the ability to restart, reboot, or power off the pine from the web interface.

Octopine 12-04-16 Release

Just download it, write out to your favorite 4gb or greater card, and then login in using pi / raspberry.
The run 

sudo resize_rootfs.sh

reboot

I used the pi user name, in hopes that it will be able to update via the web interface.
pi user can sudo without any password now.
Curaengine is installed, along with camera support.

Original message follows.
______________________________________________________________________________________

Here's my notes on getting it working from default base image with camera.
This works with my Logitech c170 webcam.

the webcam.zip file from me is taken from the octopi distro and modified for the pine64 debian config.

Grab debian base and put it on a card.

Do the following.

sudo resize_rootfs.sh
reboot
sudo /usr/local/sbin/pine64_update_uboot.sh
sudo /usr/local/sbin/pine64_update_kernel.sh
reboot

sudo apt-get update
sudo apt-get upgrade
reboot

cd ~
sudo apt-get install python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential subversion libjpeg62-turbo-dev imagemagick libav-tools cmake
git clone https://github.com/foosel/OctoPrint.git
cd OctoPrint
virtualenv venv
./venv/bin/pip install pip --upgrade
./venv/bin/python setup.py install
mkdir ~/.octoprint
sudo usermod -a -G tty debian
sudo usermod -a -G dialout debian
sudo service octoprint start
sudo service octoprint stop
cd ~
git clone https://github.com/jacksonliam/mjpg-streamer.git
cd mjpg-streamer/mjpg-streamer-experimental
export LD_LIBRARY_PATH=.
make
mv * ..
cd ~/mjpg-streamer
mkdir temp
cd temp
wget http://www.svfdtn.com/mtx/webcam.zip
unzip webcam.zip
chmod +x default/webcamd
chmod +x init.d/webcamd
chmod +x home-mjpeg-streamer/webcamd
sudo mv default/webcamd /etc/default
sudo mv init.d/webcamd /etc/init.d
mv home-mjpeg-streamer/webcamd ~/mjpg-streamer
sudo update-rc.d webcamd defaults

sudo ~/.octoprint/config.yaml
______________________________________________________________________________________

** add the following lines to it:

webcam:
  stream: http://<your Raspi's IP>:8080/?action=stream
  snapshot: http://127.0.0.1:8080/?action=snapshot
  ffmpeg: /usr/bin/avconv
______________________________________________________________________________________


sudo nano ~/OctoPrint/scripts/octoprint.init
______________________________________________________________________________________
***edit following to:
DAEMON=/home/debian/OctoPrint/venv/bin/octoprint
______________________________________________________________________________________


sudo nano ~/Octoprint/scripts/octoprint.default

______________________________________________________________________________________
**edit following to:
OCTOPRINT_USER=debian
DAEMON=/home/debian/OctoPrint/venv/bin/octoprint

______________________________________________________________________________________

sudo cp ~/OctoPrint/scripts/octoprint.init /etc/init.d/octoprint
sudo chmod +x /etc/init.d/octoprint
sudo cp ~/OctoPrint/scripts/octoprint.default /etc/default/octoprint
sudo update-rc.d octoprint defaults
sudo apt-get install haproxy
sudo nano /etc/haproxy/haproxy.cfg

______________________________________________________________________________________
***add following to bottom
   global
        maxconn 4096
        user haproxy
        group haproxy
        daemon
        log 127.0.0.1 local0 debug

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull
        retries 3
        option redispatch
        option http-server-close
        option forwardfor
        maxconn 2000
        timeout connect 5s
        timeout client  15min
        timeout server  15min

frontend public
        bind *:80
        use_backend webcam if { path_beg /webcam/ }
        default_backend octoprint

backend octoprint
        reqrep ^([^\ :]*)\ /(.*)     \1\ /\2
        option forwardfor
        server octoprint1 127.0.0.1:5000

backend webcam
        reqrep ^([^\ :]*)\ /webcam/(.*)     \1\ /\2
        server webcam1  127.0.0.1:8080
______________________________________________________________________________________


sudo nano /etc/default/haproxy

______________________________________________________________________________________
***add following to bottom
ENABLE=1
______________________________________________________________________________________

sudo nano ~/.octoprint/config.yaml

______________________________________________________________________________________
***add following to bottom
server:
host: 127.0.0.1
______________________________________________________________________________________


sudo install avahi-daemon
sudo reboot
  Reply
#5
wow!! awesome work!! hopefully this works for my logitech, have u noticed a performance difference with the pine 64 octoprint over the octopi?
  Reply
#6
I didn't actually use octoprint on my pi.
I went straight from sd printing to the pine.
  Reply
#7
I put together an image for a 4gb card with octoprint along with the curaengine, and the ability to restart, reboot, or power off the pine from the web interface.

Octopine 12-04-16 Release

Just download it, write out to your favorite 4gb or greater card, and then login in using pi / raspberry.
The run

sudo resize_rootfs.sh

reboot

I used the pi user name, in hopes that it will be able to update via the web interface.
pi user can sudo without any password now.
Curaengine is installed, along with camera support.

Edit 12-9-16... Updating from Octoprint works!

set the checkout folder to

/home/pi/OctoPrint


Later,
dabone
  Reply
#8
(12-04-2016, 06:38 PM)dabone Wrote: I put together an image for a 4gb card with octoprint along with the curaengine, and the ability to restart, reboot, or power off the pine from the web interface.

Octopine 12-04-16 Release

Just download it, write out to your favorite 4gb or greater card, and then login in using pi / raspberry.
The run

sudo resize_rootfs.sh

reboot

I used the pi user name, in hopes that it will be able to update via the web interface.
pi user can sudo without any password now.
Curaengine is installed, along with camera support.

Edit 12-9-16... Updating from Octoprint works!

set the checkout folder to

/home/pi/OctoPrint


Later,
dabone
awesome!! thank you can't wait to try, logitech webcam support working?
  Reply
#9
(12-10-2016, 08:53 AM)JAYJAYN Wrote:
(12-04-2016, 06:38 PM)dabone Wrote: I put together an image for a 4gb card with octoprint along with the curaengine, and the ability to restart, reboot, or power off the pine from the web interface.

Octopine 12-04-16 Release

Just download it, write out to your favorite 4gb or greater card, and then login in using pi / raspberry.
The run

sudo resize_rootfs.sh

reboot

I used the pi user name, in hopes that it will be able to update via the web interface.
pi user can sudo without any password now.
Curaengine is installed, along with camera support.

Edit 12-9-16... Updating from Octoprint works!

set the checkout folder to

/home/pi/OctoPrint


Later,
dabone
awesome!! thank you can't wait to try, logitech webcam support working?

Works fine with my C270.
  Reply
#10
You sir are the man! I have been waiting for something to do with my pine64. I have yet to power it since arrival. This will be perfect! Thank you so much
Neil
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Debian installer on Pine A64+ but no hdmi mrwick 1 2,110 07-28-2020, 01:49 PM
Last Post: kuleszdl
  Captive portal at school not working on the Pinebook pro WilliamZieg 2 1,838 02-06-2020, 10:41 PM
Last Post: xmixahlx
  Q4OS WiFi Dongle not working cheezmeister 3 2,586 04-07-2017, 08:01 AM
Last Post: iccoldbeer
  HowTo working with MPD and analog sound caragk 3 6,040 11-09-2016, 08:44 AM
Last Post: jkmooney
Exclamation JAVA App. not working correct wrongway 0 1,026 09-14-2016, 11:14 AM
Last Post: wrongway
  Anyone got jackd working? jkmooney 4 2,562 08-27-2016, 08:18 AM
Last Post: pfeerick
  32bit Apps on Pine djinn5150 2 2,078 08-09-2016, 11:03 AM
Last Post: xalius
  Can ping between Pine 64 on a switch, but unable to ssh MikeJewski 4 2,620 07-28-2016, 08:40 PM
Last Post: MikeJewski
  Internet not working properly cezar.suteu@gmail.com 2 1,712 06-17-2016, 01:12 AM
Last Post: cezar.suteu@gmail.com
  wget not working? slerched 3 2,194 06-01-2016, 08:15 AM
Last Post: slerched

Forum Jump:


Users browsing this thread: 1 Guest(s)