Autostart on the Asus Tinker board


#1

Gday Community,

im sorry if there should be a solution i should already found but im normally a windows user and not good in this code working.

i used the guide from here :

and get octaprint running with the command ~/OctoPrint/venv/bin/octoprint serve

now id like to create an autostart, so i used the following commands

wget https://github.com/foosel/OctoPrint/raw/master/scripts/octoprint.init && sudo mv octoprint.init /etc/init.d/octoprint
wget https://github.com/foosel/OctoPrint/raw/master/scripts/octoprint.default && sudo mv octoprint.default /etc/default/octoprint
sudo chmod +x /etc/init.d/octoprint
sudo update-rc.d octoprint defaults

the last command gives the feedback:


insserv: warning: script 'K01uart_init.sh' missing LSB tags and overrides
insserv: warning: script 'uart_init.sh' missing LSB tags and overrides

in the /etc/default/octoprint i edit it to following


# The init.d script will only run if this variable non-empty.
OCTOPRINT_USER=Lex

# base directory to use
BASEDIR=/home/linaro/.octoprint

# configuration file to use
CONFIGFILE=/home/linaro/.octoprint/config.yaml

# On what port to run daemon, default is 5000
PORT=5000

# Path to the OctoPrint executable, you need to set this to match your installation!
DAEMON=/home/linaro/OctoPrint/venv/bin/octoprint

/home/linaro/OctoPrint/venv/bin should be the installation place.

when i use the command sudo service octoprint {start|stop|restart} i get also no Feedack

so what i am doing wrong

thanks in advance
best regards
lex


#2

Why don't you give everyone more details of what's going on?

Operating System where you're installing OctoPrint:
Platform where you're installing OctoPrint:

If you're attempting to install OctoPrint on a Raspberry Pi 3 or similar Raspberry Pi computer, then the instructions normally suggested for most users would be the one involving installing the OctoPi image.

If you're interested in developing software on the Raspbian setup itself, then following those instructions you were using is the correct method (unless I'm mistaken).

The OctoPi-image route takes care of nearly everything for you, to include the autostart behavior and such.


#3

I tried my best to write all details sorry that i forgotten one.

The plaform is the Asus Tinker Board - see at the topic.
i tried to install the sd card image but it didnt start at all.
so i used the tinkerboard os with the img name
"20180222-tinker-board-linaro-stretch-alip-v2.0.5"

Thanks for your Advice


#4

I assume you meant the OctoPi image. Did you install that with Etcher to the microSD?


#5

I have serious doubts that the OctoPi image targeting the Raspberry Pi will boot on an Asus Tinkerboard, regardless how it was flashed to the SD. So a manual install will probably be needed.

You are saying there that the OctoPrint server is supposed to run under system user Lex but have its config and basedir in the home directory of the user linaro. Is this correct? Does the system user Lex exist and have read and write permissions to /home/linaro? Or did you maybe misunderstand this config and thought the OCTOPRINT_USER would be the user to use for logging into OctoPrint later? Because if so that's wrong and most likely your problem. OCTOPRINT_USER is supposed to be the system user that the server should be started under. Your config probably should rather look like this:

# The init.d script will only run if this variable non-empty.
OCTOPRINT_USER=linaro

# base directory to use
#BASEDIR=/home/linaro/.octoprint

# configuration file to use
#CONFIGFILE=/home/linaro/.octoprint/config.yaml

# On what port to run daemon, default is 5000
PORT=5000

# Path to the OctoPrint executable, you need to set this to match your installation!
DAEMON=/home/linaro/OctoPrint/venv/bin/octoprint

Note that I escaped BASEDIR and CONFIGFILE since an OctoPrint process running as user linaro will use these exact values by default anyhow.


#6

I tried the user name Lex because in the config of Octoprint i created a user named Lex.
before this i also tried the user linaro because its the standard user of the tinker board.
bBoth actions didnt work, and i wasnt shure wich user was meaned.

when i open thge folder with the file manager i can find the config file so i expect thats the right way


#7

Lex is definitely wrong then and linaro is what you should choose there. Set the user to linaro. Also come to think of it, leave the CONFIGFILE and BASEDIR settings in the config after all, I'm not completely sure right now if those must be present. Try this:

# The init.d script will only run if this variable non-empty.
OCTOPRINT_USER=linaro

# base directory to use
BASEDIR=/home/linaro/.octoprint

# configuration file to use
CONFIGFILE=/home/linaro/.octoprint/config.yaml

# On what port to run daemon, default is 5000
PORT=5000

# Path to the OctoPrint executable, you need to set this to match your installation!
DAEMON=/home/linaro/OctoPrint/venv/bin/octoprint

See what happens if you run /etc/init.d/octoprint start manually from the command line. Also check ~linaro/.octoprint/logs/octoprint.log, that might contain infos.


#8

text in the terminal

linaro@tinkerboard:~$ /etc/init.d/octoprint start
[ ok ] Starting octoprint (via systemctl): octoprint.service.
linaro@tinkerboard:~$ 

logfile:

2018-06-29 16:22:36,194 - octoprint.startup - INFO - ******************************************************************************
2018-06-29 16:22:36,194 - octoprint.startup - INFO - Starting OctoPrint 1.3.8
2018-06-29 16:22:36,195 - octoprint.startup - INFO - ******************************************************************************
2018-06-29 16:22:37,239 - octoprint.util.connectivity_checker - INFO - Connectivity changed from offline to online
2018-06-29 16:22:37,513 - octoprint.startup - INFO - Blacklist processing done
2018-06-29 16:22:37,629 - octoprint.plugin.core - INFO - Loading plugins from /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins, /home/linaro/.octoprint/plugins and installed plugin packages...
2018-06-29 16:22:39,900 - octoprint.plugin.core - WARNING - Plugin "OctoPi Support Plugin" did not pass check
2018-06-29 16:22:40,480 - octoprint.plugins.discovery - INFO - pybonjour is not installed, Zeroconf Discovery won't be available
2018-06-29 16:22:40,486 - octoprint.plugin.core - INFO - Found 9 plugin(s) providing 9 mixin implementations, 4 hook handlers
2018-06-29 16:22:40,609 - octoprint.server.heartbeat - INFO - Starting server heartbeat, 900.0s interval
2018-06-29 16:22:40,679 - octoprint.server - INFO - Intermediary server started
2018-06-29 16:22:40,680 - octoprint.plugin.core - INFO - Loading plugins from /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins, /home/linaro/.octoprint/plugins and installed plugin packages...
2018-06-29 16:22:40,688 - octoprint.plugin.core - WARNING - Plugin "OctoPi Support Plugin" did not pass check
2018-06-29 16:22:40,981 - octoprint.plugin.core - INFO - Found 9 plugin(s) providing 9 mixin implementations, 4 hook handlers
2018-06-29 16:22:41,003 - octoprint.filemanager.storage - INFO - Initializing the file metadata for /home/linaro/.octoprint/uploads...
2018-06-29 16:22:41,005 - octoprint.filemanager.storage - INFO - ... file metadata for /home/linaro/.octoprint/uploads initialized successfully.
2018-06-29 16:22:41,037 - octoprint.plugins.softwareupdate - INFO - Loaded version cache from disk
2018-06-29 16:22:44,463 - octoprint.util.pip - INFO - Using "/home/linaro/OctoPrint/venv/bin/python2 -m pip" as command to invoke pip
2018-06-29 16:22:46,194 - octoprint.util.pip - INFO - Version of pip is 10.0.1
2018-06-29 16:22:46,195 - octoprint.util.pip - INFO - pip installs to /home/linaro/OctoPrint/venv/lib/python2.7/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes
2018-06-29 16:22:46,196 - octoprint.util.pip - INFO - ==> pip ok -> yes
2018-06-29 16:22:46,198 - octoprint.plugin.core - INFO - Initialized 9 plugin implementation(s)
2018-06-29 16:22:46,202 - octoprint.plugin.core - INFO - 9 plugin(s) registered with the system:
|  Announcement Plugin (bundled) = /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins/announcements
|  Core Wizard (bundled) = /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins/corewizard
|  CuraEngine (<= 15.04) (bundled) = /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins/cura
|  Discovery (bundled) = /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins/discovery
|  Logging (bundled) = /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins/logging
|  Plugin Manager (bundled) = /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins/pluginmanager
|  Printer Safety Check (bundled) = /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins/printer_safety_check
|  Software Update (bundled) = /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins/softwareupdate
|  Virtual Printer (bundled) = /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins/virtual_printer
2018-06-29 16:22:46,212 - octoprint.environment - INFO - Detected environment is Python 2.7.13 under Linux (linux2). Details:
|  hardware:
|    cores: 4
|    freq: 1800.0
|    ram: 2112024576
|  os:
|    id: linux
|    platform: linux2
|  python:
|    pip: 10.0.1
|    version: 2.7.13
|    virtualenv: /home/linaro/OctoPrint/venv
2018-06-29 16:22:46,221 - octoprint.server - INFO - Reset webasset folder /home/linaro/.octoprint/generated/webassets...
2018-06-29 16:22:46,237 - octoprint.server - INFO - Reset webasset folder /home/linaro/.octoprint/generated/.webassets-cache...
2018-06-29 16:22:46,540 - octoprint.server - INFO - Shutting down intermediary server...
2018-06-29 16:22:46,958 - octoprint.server - INFO - Intermediary server shut down
2018-06-29 16:22:46,971 - octoprint.events - INFO - Processing startup event, this is our first event
2018-06-29 16:22:46,973 - octoprint.events - INFO - Adding 1 events to queue that were held back before startup event
2018-06-29 16:22:46,991 - octoprint.filemanager - INFO - Adding backlog items from all storage types to analysis queue...
2018-06-29 16:22:46,998 - octoprint.filemanager - INFO - Added 0 items from storage type "local" to analysis queue
2018-06-29 16:22:47,025 - octoprint.plugins.cura - INFO - Path to CuraEngine has not been configured or does not exist (currently set to None), Cura will not be selectable for slicing
2018-06-29 16:22:47,062 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on tinkerboard for SSDP
2018-06-29 16:22:47,076 - octoprint.server - INFO - Listening on http://0.0.0.0:5000
2018-06-29 16:22:47,147 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'query_string': 'l10n=de', 'path': '/', 'base_url': 'http://192.168.178.69:5000/'}
2018-06-29 16:22:47,284 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from https://plugins.octoprint.org/plugins.json
2018-06-29 16:22:47,358 - octoprint.plugins.announcements - INFO - Loaded channel _important from https://octoprint.org/feeds/important.xml in 0.32s
2018-06-29 16:22:47,376 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from https://plugins.octoprint.org/plugins.json
2018-06-29 16:22:47,408 - octoprint.plugins.announcements - INFO - Loaded channel _important from https://octoprint.org/feeds/important.xml in 0.32s
2018-06-29 16:22:47,509 - tornado.access - WARNING - 404 GET /intermediary.gif?_=1530289367459 (192.168.178.69) 35.66ms
2018-06-29 16:22:48,052 - octoprint.plugins.announcements - INFO - Loaded channel _releases from https://octoprint.org/feeds/releases.xml in 0.23s
2018-06-29 16:22:48,442 - octoprint.plugins.announcements - INFO - Loaded channel _blog from https://octoprint.org/feeds/octoblog.xml in 0.29s
2018-06-29 16:22:48,565 - octoprint.plugins.announcements - INFO - Loaded channel _blog from https://octoprint.org/feeds/octoblog.xml in 0.25s
2018-06-29 16:22:48,930 - tornado.access - WARNING - 404 GET /intermediary.gif?_=1530289368510 (192.168.178.69) 57.89ms
2018-06-29 16:22:48,972 - octoprint.plugins.announcements - INFO - Loaded channel _plugins from https://plugins.octoprint.org/feed.xml in 0.22s
2018-06-29 16:22:49,147 - octoprint.plugins.pluginmanager - INFO - Loaded plugin notices data from https://plugins.octoprint.org/notices.json
2018-06-29 16:22:49,199 - octoprint.plugins.announcements - INFO - Loaded channel _plugins from https://plugins.octoprint.org/feed.xml in 0.36s
2018-06-29 16:22:49,257 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2018-06-29 16:22:49,491 - octoprint.plugins.announcements - INFO - Loaded channel _octopi from https://octoprint.org/feeds/octopi.xml in 0.32s
2018-06-29 16:22:49,527 - tornado.access - WARNING - 404 GET /cached.gif?_=1530289369459 (192.168.178.69) 56.71ms
2018-06-29 16:22:49,550 - octoprint.plugins.announcements - INFO - Loaded channel _octopi from https://octoprint.org/feeds/octopi.xml in 0.2s
2018-06-29 16:22:50,025 - tornado.access - WARNING - 404 GET /intermediary.gif?_=1530289369931 (192.168.178.69) 50.58ms
2018-06-29 16:22:50,090 - octoprint.util.pip - INFO - Using "/home/linaro/OctoPrint/venv/bin/python2 -m pip" as command to invoke pip
2018-06-29 16:22:50,726 - tornado.access - WARNING - 404 GET /cached.gif?_=1530289370530 (192.168.178.69) 161.30ms
2018-06-29 16:22:51,875 - tornado.access - WARNING - 404 GET /cached.gif?_=1530289371731 (192.168.178.69) 132.06ms
2018-06-29 16:22:52,895 - tornado.access - WARNING - 404 GET /cached.gif?_=1530289372872 (192.168.178.69) 13.42ms
2018-06-29 16:22:54,098 - octoprint.util.pip - INFO - pip installs to /home/linaro/OctoPrint/venv/lib/python2.7/site-packages/ (writable -> yes), --user flag needed -> no, virtual env -> yes
2018-06-29 16:22:54,099 - octoprint.util.pip - INFO - ==> pip ok -> yes
2018-06-29 16:22:54,121 - tornado.access - WARNING - 404 GET /cached.gif?_=1530289373901 (192.168.178.69) 29.30ms
2018-06-29 16:22:54,128 - octoprint.plugins.softwareupdate - INFO - Saved version cache to disk
2018-06-29 16:22:55,363 - tornado.access - WARNING - 404 GET /cached.gif?_=1530289375126 (192.168.178.69) 95.16ms
2018-06-29 16:22:56,437 - tornado.access - WARNING - 404 GET /cached.gif?_=1530289376369 (192.168.178.69) 34.30ms
2018-06-29 16:22:57,357 - octoprint.server.preemptive_cache - INFO - ... done in 10.21s
2018-06-29 16:22:57,457 - octoprint.server.views - INFO - Found path / in cache (key: ui:_default:http://192.168.178.69:5000/:de), signaling as cached
2018-06-29 16:22:59,544 - octoprint.server.util.sockjs - INFO - New connection from client: 192.168.178.69
2018-06-29 16:23:30,978 - octoprint.server - INFO - Shutting down...
2018-06-29 16:23:31,155 - octoprint.events - INFO - Processing shutdown event, this will be our last event
2018-06-29 16:23:31,156 - octoprint.events - INFO - Event loop shut down
2018-06-29 16:23:31,161 - octoprint.server - INFO - Goodbye!

i alwazs need to enter the user password when id like to start or tstop the server that whay, maybe thats killing the autostart? during the start process (after booting) i dont need to enter the password


#9

ok it seems that in the cofig file an s get lost, now it works with the autostart.
thanks for your support and time !


#10

Could you share your final config here so that people wanting to run a similar setup into the future have something to go on? Feel free to also mark your own post with that as the solution then with the little :marksolved:


#11

linaro is the szstem username
in my case the "s" of the word "yes" was lost so it didnt started

# Configuration for /etc/init.d/octoprint

# The init.d script will only run if this variable non-empty.
OCTOPRINT_USER=linaro

# base directory to use
BASEDIR=/home/linaro/.octoprint

# configuration file to use
CONFIGFILE=/home/linaro/.octoprint/config.yaml

# On what port to run daemon, default is 5000
PORT=5000

# Path to the OctoPrint executable, you need to set this to match your installation!
DAEMON=/home/linaro/OctoPrint/venv/bin/octoprint

# What arguments to pass to octoprint, usually no need to touch this
DAEMON_ARGS="--port=$PORT"

# Umask of files octoprint generates, Change this to 000 if running octoprint as its own, separate user
UMASK=022

# Process priority, 0 here will result in a priority 20 process.
# -2 ensures Octoprint has a slight priority over user processes.
NICELEVEL=-2

# Should we run at startup?
START=yes

I also added in

/etc/rc.local

/home/YOUR_USERNAME_HERE/OctoPrint/venv/bin/octoprint &

before the
exit 0

by using the command

sudo nano /etc/rc.local

#12

You shouldn't need that. The service should be the preferred way of starting things, and it's either one or the other. Your rc.local line also will try to run OctoPrint as root, which it doesn't like, so it currently probably doesn't do anything at all.


#13

oh okay then it wasnt the helpfull part :smiley:
now i need to check why the plugins cant be installed but i think i do a new topic for that