Welcome! Log In Create A New Profile

Advanced

Implementing touch screen interface using Raspberry Octoprint

Posted by tatubias 
Implementing touch screen interface using Raspberry Octoprint
January 26, 2015 08:27AM
Original post: [forums.reprap.org]

What is need:
  • Raspberry
  • Touchscreen




Download the SD image of raspbian that supports the Touch screen already configured.

link: [www.watterott.net]

Burn it in your SD card.

insert it on the raspberry plug the screen and boot.

user: pi
Password: raspberry

run: sudo raspi-config


Then expand the file system, 
configure time zone 
enable the webcam support (if you have)
Save and reboot.

Now when it boot we need to update all the system run the following commands.
sudo apt-get update
sudo apt-get upgrade

install web server etc.
sudo apt-get install apache2  php5  bc  chromium-browser  matchbox x11-xserver-utils unclutter  mplayer

create the following directory were img of the interface will be placed
sudo mkdir /var/www/img


Lets install webcam support (MJPG-Streamer)
cd ~
sudo apt-get install subversion libjpeg8-dev imagemagick libav-tools cmake
git clone [github.com]
cd mjpg-streamer/mjpg-streamer-experimental
make
sudo make install

Now is time to install octoprint
cd ~
sudo apt-get install python-pip python-dev git
sudo apt-get install python-setuptools
git clone [github.com]
cd OctoPrint
sudo python setup.py install
mkdir ~/.octoprint
sudo usermod -a -G tty pi
sudo usermod -a -G dialout pi

Now we need to mount tmp on the memory

edit /etc/fstab like this:

sudo vi /etc/fstab

Add the following line.
tmpfs /tmp/ tmpfs defaults,noatime,mode=1777 0 0

if you want to be able to make the interface reboot the raspberry add the following lines or you can skip this step.
Run:
sudo visudo

Add:
brftv ALL=NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff  
www-data ALL=NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff, /usr/bin/mplayer

Now we need to install the interface software it self.
cd ~
wget [dl.dropboxusercontent.com]
tar xvf home-pi_v1.3.tar
	
cd /var/www
sudo rm index.html
sudo wget [dl.dropboxusercontent.com]
sudo tar xvf var-www_v1.3.tar

Download the img pack
cd ~
wget [forums.reprap.org]
unzip img.zip
sudo cp /home/pi/img/* /var/www/img/


Now is time to calibrate the lcd run:
cd ~
./start_touchscreen_calibration.sh



if your axes of the touch are mixed run:

sudo vi /usr/share/X11/xorg.conf.d/10-evdev.conf

Clean the file and left it like below.

Section "InputClass"
        Identifier "evdev touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Option "InvertX" "true"
        Driver "evdev"
	Option "Calibration" "214 3793 214 3984"
EndSection

If the Y axe is inverted when you press the screen modify the file and add this line.
Option "InvertY" "true"

if now is time to see if octoprint is working. run:
octoprint

from your pc, in your internet explorer addres bar put the ip of the raspberry 192.168.0.x:5000
5000 is the port were octoprint interface is working.

Add the following lines to make the interface runs on boot.

edit:
sudo vi /etc/rc.local

add before "exit 0" line.

/bin/sleep 10 && su pi -c '/home/pi/start_octoprint.sh' &

youtube videos:
[www.youtube.com]
[www.youtube.com]


some pictures:











More information at the original post: [forums.reprap.org]

the interface is developed by Christian Gassner
more information related the instalation [dl.dropboxusercontent.com]

Edited 3 time(s). Last edit at 01/26/2015 09:27AM by tatubias.
Re: Implementing touch screen interface using Raspberry Octoprint
January 26, 2015 09:21AM
Looks interesting, but some of your links to github and dropbox are just text; they're not links.
Re: Implementing touch screen interface using Raspberry Octoprint
January 26, 2015 09:27AM
Sory for the mistake, i have updated the post.
Re: Implementing touch screen interface using Raspberry Octoprint
March 01, 2015 06:29PM
hello i have the lcd sreen 3.2 and is not possibilite fonction ,

you knon why

my raspberry is pi b+ and the lcd sreen 3.2 inch rpi lcd (v3)


would you have a solution

thank you very much

smiling smileythumbs up
Attachments:
open | download - 3.2inch-RPi-LCD-B-6.jpg (126.6 KB)
Re: Implementing touch screen interface using Raspberry Octoprint
March 01, 2015 07:39PM
Quote
stefane
hello i have the lcd sreen 3.2 and is not possibilite fonction ,

you knon why

my raspberry is pi b+ and the lcd sreen 3.2 inch rpi lcd (v3)


would you have a solution

thank you very much

smiling smileythumbs up

Does this video about Pi2 help? [www.youtube.com]
Re: Implementing touch screen interface using Raspberry Octoprint
March 02, 2015 09:34AM
Watching on a 3" screen what's printing right next to it is like getting front row midfield seats to the SuperBowl and watching a telecast of it streamed to your cell phone. winking smiley The rest of the functionality I do like though.
Re: Implementing touch screen interface using Raspberry Octoprint
April 20, 2015 10:03PM
Quote
cdru
Watching on a 3" screen what's printing right next to it is like getting front row midfield seats to the SuperBowl and watching a telecast of it streamed to your cell phone. winking smiley The rest of the functionality I do like though.


You can watchnit all thught the web interface.
What you can watch i n the display is a just finished tie laps . Whie you wait to cool the glass.

Yes it has not much sence but its an pther litte thing that it has
Re: Implementing touch screen interface using Raspberry Octoprint
April 21, 2015 02:57PM
Or you can get yourself a cheap windows 8.1 tablet and run octoprint on that.


Like this tablet.... [www.microcenter.com] 70USD for the tablet, or less than 50USD open box. Would work fine methinks....


My Personal Blog. Build blog.
[engineerd3d.ddns.net]

Modicum V1 sold on e-bay user jaguarking11
Re: Implementing touch screen interface using Raspberry Octoprint
April 21, 2015 07:23PM
Hi,

This looks like a very interesting idea, i am currently using raspberry pi 2 and octoprint to control my prusa i3 wireless from my laptop. So just to clarify, using the pi in this way will allow me to control my printer via the touchscreen and i can still access the printer via a web interface wirelessly to upload print files from my laptop? Also, i dont currently have a lcd screen for the pi, does it matter which screen i buy for it? i have seen 2.8", 3.2" and 3.5" versions of the touchscreen, i am assuming that it should work with any of these screens?

I was looking at this one,
[www.ebay.co.uk]

My main goal would be to ditch my current LCD panel and use the Pi as the direct interface to my printer, getting rid of my LCD will take some of the load off from my electronics. I cant see why this wouldnt work.

Regards,
Chris

Edited 1 time(s). Last edit at 04/21/2015 07:25PM by Make_3D.
Re: Implementing touch screen interface using Raspberry Octoprint
May 04, 2015 07:42AM
Quote
Make_3D
Hi,

This looks like a very interesting idea, i am currently using raspberry pi 2 and octoprint to control my prusa i3 wireless from my laptop. So just to clarify, using the pi in this way will allow me to control my printer via the touchscreen and i can still access the printer via a web interface wirelessly to upload print files from my laptop? Also, i dont currently have a lcd screen for the pi, does it matter which screen i buy for it? i have seen 2.8", 3.2" and 3.5" versions of the touchscreen, i am assuming that it should work with any of these screens?

I was looking at this one,
t[www.ebay.co.uk]

My main goal would be to ditch my current LCD panel and use the Pi as the direct interface to my printer, getting rid of my LCD will take some of the load off from my electronics. I cant see why this wouldnt work.

Regards,
Chris

yes you can use the web interface or the touchscreen interface. you can even access to the touchscreen page thought you desktops, there is no provlem.

regadring the ebay product. probably will work.
Re: Implementing touch screen interface using Raspberry Octoprint
May 04, 2015 08:14AM
I think it's worth pointing out that there are a couple of other ways of achieving the same goals, i.e. accessing the printer over a network and have a graphical user interface that doesn't add a lot of load on the controller. First, some printer electronics (e.g. Duet and Smoothieboard) have an Ethernet port and support a web interface. For example, here is the web interface supported by the Duet:



It works on mobile devices too. Second, there is a colour touch screen control panel [full disclosure: I manufacture this], currently supported by the Duet, with Smoothieware support in progress. The controller board has its own processor to reduce the load on the main processor and supports 4.3 inch and 5 inch touch screens.





Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].

Re: Implementing touch screen interface using Raspberry Octoprint
August 06, 2015 01:04AM
I follow this tutorial, but I only can start web page with full screent (not touch screen like video), plz help me to open touch display .
Thanks!
Re: Implementing touch screen interface using Raspberry Octoprint
August 06, 2015 01:27PM
It works very well but the the small interface has no connection to octoprint



edit: smjpg-streamer also not start alone.

Edited 1 time(s). Last edit at 08/06/2015 02:35PM by chka.


Mendel 90 - Octoprint
Re: Implementing touch screen interface using Raspberry Octoprint
August 06, 2015 02:07PM
can not open GUI
errors below
_XSERVTransSocketOpenCOTSServer: Unable to open socket for inet6
_XSERVTransOpen: transport open failed for inet6/ThachPi:0
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for inet6

X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-2-mx5 armv7l Debian
Current Operating System: Linux ThachPi 4.0.7-v7+ #1 SMP PREEMPT Sat Jul 11 20:44:05 CEST 2015 armv7l
Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2709.boardrev=0xa01041 bcm2709.serial=0x17e63753 smsc95xx.macaddr=B8:27:EB:E6:37:53 bcm2708_fb.fbswap=1 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fbcon=map:1 rootwait
Build Date: 11 February 2015 09:31:17PM
xorg-server 2:1.12.4-6+deb7u6 (Julien Cristau )
Current version of pixman: 0.33.1
Before reporting problems, check [wiki.x.org]
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Wed Aug 5 22:07:22 2015
(==) Using default built-in configuration (12 lines)
wm_set_cursor_visibility: visible using XCreateFontCursor
[4890:4890:5179697085:ERROR:browser_main_loop.cc(165)] GLib-GObject: Attempt to add property GtkSettings::gtk-label-select-on-focus after class was initialised
[4890:4890:5179702348:ERROR:browser_main_loop.cc(165)] GLib-GObject: Attempt to add property GtkSettings::gtk-entry-select-on-focus after class was initialised
[4890:4890:5179703414:ERROR:browser_main_loop.cc(165)] GLib-GObject: Attempt to add property GtkSettings::gtk-entry-password-hint-timeout after class was initialised
[4890:4890:5179795878:ERROR:browser_main_loop.cc(165)] GLib-GObject: Attempt to add property GtkSettings::gtk-menu-bar-popup-delay after class was initialised
[4890:4890:5179798696:ERROR:browser_main_loop.cc(165)] GLib-GObject: Attempt to add property GtkSettings::gtk-can-change-accels after class was initialised
[4890:4890:5179799711:ERROR:browser_main_loop.cc(165)] GLib-GObject: Attempt to add property GtkSettings::gtk-menu-popup-delay after class was initialised
[4890:4890:5179800708:ERROR:browser_main_loop.cc(165)] GLib-GObject: Attempt to add property GtkSettings::gtk-menu-popdown-delay after class was initialised
[4890:4890:5179865033:ERROR:browser_main_loop.cc(165)] GLib-GObject: Attempt to add property GtkSettings::gtk-button-images after class was initialised
[4890:4890:5179975846:ERROR:browser_main_loop.cc(165)] GLib-GObject: Attempt to add property GtkSettings::gtk-menu-images after class was initialised
2015-08-05 22:07:24,436 - octoprint.server - INFO - Starting OctoPrint 1.2.4 (master branch)
2015-08-05 22:07:24,439 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/.octoprint/plugins, /usr/local/lib/python2.7/dist-packages/OctoPrint-1.2.4-py2.7.egg/octoprint/plugins and installed plugin packages...
2015-08-05 22:07:24,803 - octoprint.plugin.core - INFO - Found 5 plugin(s) providing 5 mixin implementations, 2 hook handlers
2015-08-05 22:07:24,822 - octoprint.filemanager.storage - INFO - Initializing the file metadata for /home/pi/.octoprint/uploads...
2015-08-05 22:07:24,825 - octoprint.filemanager.storage - INFO - ... file metadata for /home/pi/.octoprint/uploads initialized successfully.
2015-08-05 22:07:24,865 - octoprint.plugins.softwareupdate - INFO - Loaded version cache from disk
failed to create drawable
[4928:4928:5180520580:ERROR:gl_surface_glx.cc(276)] glXCreatePbuffer failed.
[4928:4928:5180521187:ERROR:gpu_info_collector.cc(25)] gfx::GLContext::CreateOffscreenGLSurface failed
2015-08-05 22:07:25,821 - octoprint.util.pip - INFO - Found pip at /usr/bin/pip, version is 1.1
2015-08-05 22:07:25,828 - octoprint.plugin.core - INFO - Initialized 5 plugin(s)
2015-08-05 22:07:25,831 - octoprint.plugin.core - INFO - 5 plugin(s) registered with the system:
| CuraEngine (bundled) = /usr/local/lib/python2.7/dist-packages/OctoPrint-1.2.4-py2.7.egg/octoprint/plugins/cura
| Discovery (bundled) = /usr/local/lib/python2.7/dist-packages/OctoPrint-1.2.4-py2.7.egg/octoprint/plugins/discovery
| Plugin Manager (bundled) = /usr/local/lib/python2.7/dist-packages/OctoPrint-1.2.4-py2.7.egg/octoprint/plugins/pluginmanager
| Software Update (bundled) = /usr/local/lib/python2.7/dist-packages/OctoPrint-1.2.4-py2.7.egg/octoprint/plugins/softwareupdate
| Virtual Printer (bundled) = /usr/local/lib/python2.7/dist-packages/OctoPrint-1.2.4-py2.7.egg/octoprint/plugins/virtual_printer
Re: Implementing touch screen interface using Raspberry Octoprint
August 06, 2015 03:24PM
mjpg will start with this
sleep 10s && ./home/pi/mjpg-streamer/mjpg-streamer-experimental/mjpg_streamer -i "/home/pi/mjpg-streamer/mjpg-streamer-experimental/input_uvc.so" -o "./home/pi/mjpg-streamer/mjpg-streamer-experimental/output_http.so -w ./home/pi/mjpg-streamer/mjpg-streamer-experimental/www"


Mendel 90 - Octoprint
Re: Implementing touch screen interface using Raspberry Octoprint
August 06, 2015 09:42PM
Nothing changed, I can not open a GUI like video, only show a webpage with full screen (kiosk mode).
Re: Implementing touch screen interface using Raspberry Octoprint
August 06, 2015 11:49PM
How I can disable connection to octoprint original and run your octoprint?
Re: Implementing touch screen interface using Raspberry Octoprint
August 07, 2015 12:22AM
With OCTOPRINT:5000 you find the octoprint page

How does the does the webpage look?

Edited 1 time(s). Last edit at 08/07/2015 12:22AM by chka.


Mendel 90 - Octoprint
Re: Implementing touch screen interface using Raspberry Octoprint
August 07, 2015 03:56AM
It's not include icon stored in /var/www/img, it's just original page of octoprint before I follow this app. like this: [3d.balonio.com]
It's can not link to the index.php page stored in /var/www/
When I type
$ octoprint
I think it's defaultly link to octoprint of [github.com] so no GUI, no icon glyphicons.
My goal is display a GUI with glyphicons not webpage.

Edited 1 time(s). Last edit at 08/07/2015 04:00AM by chilsfarm.
Re: Implementing touch screen interface using Raspberry Octoprint
August 07, 2015 12:09PM
please make a picture of your pi screen

btw the fils from the tmp folder are all empty, so the pages of the pi panal could not get any status from octoprint


Mendel 90 - Octoprint
Re: Implementing touch screen interface using Raspberry Octoprint
August 08, 2015 04:23AM
Dear chka ,
Can you help to repost this image : [www.watterott.net]
this is my screen:
[www.wired.com]
after I run ./start_octoprint.sh
It's not open a GUI like this video.
Thanks!
Re: Implementing touch screen interface using Raspberry Octoprint
August 08, 2015 09:13AM
Yes it will start octoprint not the separate gui

if you go step by step after the manual from tatubias : [dl.dropboxusercontent.com]
you forgot this part


Quote
cd ~
wget [url]https://dl.dropboxusercontent.com/u/20305979/octopi/home-pi_v1.3.tar[/url]
tar xvf home-pi_v1.3.tar

cd /var/www
sudo rm index.html
sudo wget [url]https://dl.dropboxusercontent.com/u/20305979/octopi/var-www_v1.3.tar[/url]
sudo tar xvf var-www_v1.3.tar

it will show you like my first post of this thread

Edited 1 time(s). Last edit at 08/08/2015 09:37AM by chka.


Mendel 90 - Octoprint
Re: Implementing touch screen interface using Raspberry Octoprint
August 08, 2015 09:58AM
ok now in know my problem i could not connect with the api can same body help me.

i have one user in the access control with his own api key F32D7E522B824A298B2B3F143264F59A the global key is this: 2DB6FFD6CC2F43FD8188DA1CDD8B7B26

if i start this in the command line of the pi

curl -H "Content-Type: application/json" --request POST --data '{"command": "disconnect"}' --header 'X-ApiKey: F32D7E522B824A298B2B3F143264F59A' --verbose [127.0.0.1]

this one is the output:

* About to connect() to 127.0.0.1 port 80 (#0)
*   Trying 127.0.0.1...
* connected
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> POST /api/connection HTTP/1.1
> User-Agent: curl/7.26.0
> Host: 127.0.0.1
> Accept: */*
> Content-Type: application/json
> X-ApiKey: F32D7E522B824A298B2B3F143264F59A
> Content-Length: 25
> 
* upload completely sent off: 25 out of 25 bytes
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 401 UNAUTHORIZED
< Content-Type: text/html; charset=utf-8
< Content-Length: 19
< Cache-Control: no-cache
< X-Clacks-Overhead: GNU Terry Pratchett
< Set-Cookie: session="Vy2pULu1Z3jlrpDovaWUzbWhQfE=?_id=UycwYWYxNzBiNThjYmI3YTYzY2YzZjE0MmViZTMwYjJiYScKcDEKLg=="; Path=/; HttpOnly
< Server: TornadoServer/4.0.1
< 
* Connection #0 to host 127.0.0.1 left intact
No API key provided* Closing connection #0

i'm not allowed to connect the api


Mendel 90 - Octoprint
Re: Implementing touch screen interface using Raspberry Octoprint
August 08, 2015 09:11PM
I realize that *.sh file in /var/www can not run well, so it can not interact with octoprint server.
Re: Implementing touch screen interface using Raspberry Octoprint
August 08, 2015 09:15PM
* Connection #0 to host 127.0.0.1 left intact
No API key provided* Closing connection #0
this because the script of owner is wrong about API key:
try to change X-ApiKey to X-Api-Key, will remove this error.
Now I find the way to run those *.sh but "< HTTP/1.1 401 UNAUTHORIZED" is my problem, I can not solve it. Anyone plz help me! how I can change curl command to interact with server?

I think problem is the image file was removed, the owner dont want to open source it, some magic set up inside that image!
Re: Implementing touch screen interface using Raspberry Octoprint
August 09, 2015 05:20AM
we will come to the goal,

first you are right it is X-Api-Key and not X-ApiKey!

now it is possible to mange over the command line

it will not work over php because php use the user www-data and this user has no rights vor the tmp folder tmp


Mendel 90 - Octoprint
Re: Implementing touch screen interface using Raspberry Octoprint
August 09, 2015 05:32AM
so what i do know,

i will change all files from the /var/www folder to the right api, like the get_api_printer.sh i edit this:

# Copy this script on raspberry to this location
# sudo cp /mnt/smb1/_octopi/static/get_api_printer.sh /var/www

cd /var/www/tmp/
wget -N 127.0.0.1:5000/api/printer --header 'X-Api-Key:2DE83FAD0F1D4018B48E06804F02C7F5'
grep -m 1 '"actual":' printer | awk -F ': '  '{print $2}' | sed 's/\,//g' > var_printer_bed_actual_temp
grep '"actual":' printer | tail -1 | awk -F ': '  '{print $2}' | sed 's/\,//g' > var_printer_extruder_actual_temp

grep -m 1 '"target":' printer | awk -F ': '  '{print $2}' | sed 's/\,//g' > var_printer_bed_target_temp
grep '"target":' printer | tail -1 | awk -F ': '  '{print $2}' | sed 's/\,//g' > var_printer_extruder_target_temp


also the tmp folder is directly in the /var/www folder

when you edit the lins 18 to 27 in the index4.php file to this

<?php
// get api data from script
exec("bash ./get_api_printer.sh");
// load variable from file
$var_printer_bed_actual_temp = round(file_get_contents('/var/www/tmp/var_printer_bed_actual_temp'), 0);
$var_printer_bed_target_temp = round(file_get_contents('/var/www/tmp/var_printer_bed_target_temp'), 0);
$var_printer_extruder_actual_temp = round(file_get_contents('/var/www/tmp/var_printer_extruder_actual_temp'), 0);
$var_printer_extruder_target_temp = round(file_get_contents('/var/www/tmp/var_printer_extruder_target_temp'), 0);

?>

it work :-)

So i have to edit all files

Edited 1 time(s). Last edit at 08/09/2015 05:33AM by chka.


Mendel 90 - Octoprint
Re: Implementing touch screen interface using Raspberry Octoprint
August 09, 2015 06:28AM
use this [www.dropbox.com]

edit all API to your own in these files ist is 2DE83FAD0F1D4018B48E06804F02C7F5

deleate all files from /var/www with sudo rm *

load it in the /var/www folder

edit the rights over the command line

sudo chown -cR www-data tmp/
sudo find . -type d -exec chmod 777 {} \;
sudo find . -type f -exec chmod 777 {} \;

have fun :-)


Mendel 90 - Octoprint
Re: Implementing touch screen interface using Raspberry Octoprint
August 09, 2015 12:39PM
Thanks for your sharing.

Edited 1 time(s). Last edit at 08/10/2015 02:13PM by chilsfarm.
Re: Implementing touch screen interface using Raspberry Octoprint
October 16, 2015 06:07AM
Quote
chilsfarm
I follow this tutorial, but I only can start web page with full screent (not touch screen like video), plz help me to open touch display .
Thanks!

Yeah same here.

Looks like that:

It's like the new design isn't loaded.

Edited 1 time(s). Last edit at 10/16/2015 08:06AM by BearTechandTools.
Sorry, only registered users may post in this forum.

Click here to login