Skip to content
This repository has been archived by the owner on Nov 24, 2019. It is now read-only.

How do I setup OctoPrint-TFT to automatically run at boot? #5

Closed
ismangil opened this issue Jan 5, 2018 · 19 comments
Closed

How do I setup OctoPrint-TFT to automatically run at boot? #5

ismangil opened this issue Jan 5, 2018 · 19 comments

Comments

@ismangil
Copy link
Contributor

ismangil commented Jan 5, 2018

I want the app to immediately start at boot up - kiosk mode.

How do I that?

@mcuadros
Copy link
Owner

mcuadros commented Jan 5, 2018

If you installed ocoprint-tft with the deb package, should work out of the box.

But you must to enable the graphical mode boot with:
systemctl set-default graphical.target

@ismangil
Copy link
Contributor Author

ismangil commented Jan 5, 2018

pi@octopi-tiacxy:~ $ systemctl get-default
graphical.target
pi@octopi-tiacxy:~/OctoPrint-TFT/build/jessie $ sudo dpkg -i octoprint-tft_0.0~git1d13338-1_armhf.deb

Successful install.

pi@octopi-tiacxy:~ $ sudo reboot

Still shows OctoPi console usual login screen (screenshot)

@mcuadros
Copy link
Owner

mcuadros commented Jan 5, 2018

Can you execute systemctl status display-manager? The server should be linkedind properly, witch package are you using? Its a custom build right? Why?

systemctl status display-manager
● octoprint-tft.service - OctoPrint-TFT
   Loaded: loaded (/lib/systemd/system/octoprint-tft.service; enabled)
   Active: active (running) since Fri 2018-01-05 16:19:42 UTC; 2h 36min ago
 Main PID: 1322 (xinit)
   CGroup: /system.slice/octoprint-tft.service
           ├─1322 /usr/bin/xinit /usr/bin/OctoPrint-TFT -- :0 -nolisten tcp -nocursor
           ├─1323 /usr/lib/xorg/Xorg :0 -nolisten tcp -nocursor
           ├─1334 /usr/bin/OctoPrint-TFT
           ├─1342 /usr/bin/dbus-launch --autolaunch 78055127b0d246778bb1b55d3da2a763 --binary-syntax --close-stderr
           ├─1343 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
           ├─1345 /usr/lib/at-spi2-core/at-spi-bus-launcher
           ├─1349 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
           └─1352 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session

@ismangil
Copy link
Contributor Author

ismangil commented Jan 5, 2018

So I should install the desktop environment? I'm running the default OctoPi, it doesn't have graphical environment. It suggests running the install-desktop script (https://github.com/guysoft/OctoPi/blob/devel/src/modules/octopi/filesystem/home/pi/scripts/install-desktop).

@mcuadros
Copy link
Owner

mcuadros commented Jan 5, 2018

No you don't need to do it. Can you past the result of systemctl status display-manager?

@ismangil
Copy link
Contributor Author

ismangil commented Jan 5, 2018

pi@octopi-tiacxy:~ $ systemctl status display-manager
● display-manager.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

@mcuadros
Copy link
Owner

mcuadros commented Jan 5, 2018

Strange looks like the postinst script didn't run properly.

Can you execute? and try again the status?
ln -sf /lib/systemd/system/octoprint-tft.service /etc/systemd/system/display-manager.service

@ismangil
Copy link
Contributor Author

ismangil commented Jan 5, 2018

pi@octopi-tiacxy:~ $ ls -al /etc/systemd/system/display-manager.service 
lrwxrwxrwx 1 root root 41 Jan  5 23:50 /etc/systemd/system/display-manager.service -> /lib/systemd/system/octoprint-tft.service
pi@octopi-tiacxy:~ $ systemctl status display-manager
● octoprint-tft.service - OctoPrint-TFT
   Loaded: loaded (/lib/systemd/system/octoprint-tft.service; enabled)
   Active: failed (Result: start-limit) since Fri 2018-01-05 23:52:30 UTC; 29s ago
  Process: 1056 ExecStart=/usr/bin/xinit /usr/bin/OctoPrint-TFT -- :0 -nolisten tcp -nocursor (code=exited, status=203/EXEC)
 Main PID: 1056 (code=exited, status=203/EXEC)```
  

@mcuadros
Copy link
Owner

mcuadros commented Jan 6, 2018

ls /etc/octoprint-tft-environment and journalctl -u octoprint-tft?

How you created the package? and why you didn't used the provided one?

@ismangil
Copy link
Contributor Author

ismangil commented Jan 6, 2018

pi@octopi-tiacxy:~ $ ls /etc/octoprint-tft-environment
/etc/octoprint-tft-environment
pi@octopi-tiacxy:~ $ journalctl -u octoprint-tft
No journal files were found.

I built the package from source by following the README.
make build so using Docker.

I built from source because I wanted to use the latest code, and also tinker with development.

I will try uninstalling this package and trying again with release package.

@mcuadros
Copy link
Owner

mcuadros commented Jan 6, 2018

xinit /usr/bin/OctoPrint-TFT -- :0 -nolisten tcp -nocursor works?

@ismangil
Copy link
Contributor Author

ismangil commented Jan 6, 2018

xinit is not available. Perhaps because OctoPi does not have it by default?

@mcuadros
Copy link
Owner

mcuadros commented Jan 6, 2018

ouch, so is a missing dependency. Can you install it? and try again?

@ismangil
Copy link
Contributor Author

ismangil commented Jan 6, 2018

OK I found the minimum to install is
sudo apt-get install xserver-xorg xinit

It is now working.

How do I set the resolution? My screen is 800x480, the program only fills partial screen.

@mcuadros
Copy link
Owner

mcuadros commented Jan 6, 2018

Ups, its hardcoded: https://github.com/mcuadros/OctoPrint-TFT/blob/master/ui/ui.go#L61

I will need make a configuration variable for it.

@ismangil
Copy link
Contributor Author

ismangil commented Jan 6, 2018 via email

@mcuadros mcuadros closed this as completed Jan 6, 2018
@mcuadros
Copy link
Owner

mcuadros commented Jan 6, 2018

I did the change 1218dd5, tomorrow I will do some tests and issue a new release.

About your resolution, maybe will be a bit big. Will be great if you can share some pictures. Thanks for using it.

@chrisdruckt
Copy link

chrisdruckt commented Feb 3, 2018

I have a similar issue. The PI boots to a login screen in the console...

systemctl status display-manager gives me the following:

`>octoprint-tft.service - OctoPrint-TFT

Loaded: loaded (/lib/systemd/system/octoprint-tft.service; enabled)
Active: active (running) since Sat 2018-02-03 16:12:41 UTC; 4min 2s ago
Main PID: 784 (xinit)
CGroup: /system.slice/octoprint-tft.service
├─784 /usr/bin/xinit /usr/bin/OctoPrint-TFT -- :0 -nolisten tcp -n...
├─791 /usr/lib/xorg/Xorg :0 -nolisten tcp -nocursor
└─892 /usr/bin/OctoPrint-TFT`

Am I doing something wrong?

@mertonal
Copy link

mertonal commented Aug 2, 2018

connecting to octoprint ... and does not open, what is the problem?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants