Package: tentacle
Contents1Features2Installation2.1Linux / Raspberry Pi2.1.1Install with PIP32.1.2Manual startup2.1.3Autostart withsystemd2.2macOS3Configuration3.1Sectionoctoprint3.2Sectionqt3.3Sectionapp3.4Sectiontemp3.5Sectionmove3.6Sectiontool3.7Sectionser3.8Sectioncam3.9Sectioncommands4User’s Manual5Appendix5.1Raspberry Camera Setup5.2Setup an Adafruit PiTFT Plus 2.8”5.2.1Setup Hard keys5.2.2Touchscreen Calibration5.2.2.1Running the Calibration Tool on X115.2.2.2Save the Calibration Matrix forlibinput1FeaturesStylus-friendly UI suitable for tiny TFTsTFT Resolution of 320x240 and upwards supportedLow resource usage: PyQt5 running directly on framebuffer without X11All relevant OctoPrint parameters are available in UI Tabs:Shows details on current printJobShows available printFilesand allows to select one for printingShowsTemperature Curvesof Hotends and BedAMove Panelallows to move the toolsAGCode Displayshows the current layer while printingACamera Viewshows your streamed camera2Installation2.1Linux / Raspberry PiFirst setup your TFT and the (calibrated) touch input.
Typically your TFT’s framebuffer device is/dev/fb1SeeAppendixfor details on my setup.2.1.1Install with PIP3Install the PyQt5 package for Python 3 withapt:$sudoaptinstallpython3-pyqt5Installtentaclewithpip$sudoaptinstallpython3-pip$pip3installtentacleThis will installtentaclefor the current user only.
If you want to install the package system-wide usesudo:$sudopip3installtentacle2.1.2Manual startupNow you can test run the binary from a remote shell (ssh):$ tentacle -vUse manual startup to tweak yourConfiguration2.1.3Autostart withsystemdInsystemd/tentacle.serviceyou’ll find a template service file for
systemd. Adjust and copy this file to/etc/systemd/system/.Make sure the user is setup correctly. Default ispi.Try to run the service with:$sudosystemctlstarttentacleSee the status with:$sudosystemctlstatustentacleStop the service with:$sudosystemctlstoptentacleTo permanently enable the service for the next boot use:$sudosystemctlenabletentacleDone!2.2macOSYou can runtentacleon your Mac in a window to test the UI.First install PyQt5 with:$pipinstallpyqt5Then installtentacle:$pipinstalltentacle3ConfigurationWhiletentaclealready ships with a sensible set of default configuration
parameters you can adjust them as you need.The configuration file is calledtentacle.cfgand searched at the
following locations:current working directory (suitable for test runs)$HOME/.tentacle.cfg/etc/tentacle.cfg(suitable for systemd setup)The config has INI like syntax and is split into sections.
To get the default configuration just runtentacle--dump-configto write
it into a file:$tentacle--dump-configtentacle.cfg3.1SectionoctoprinturlThe URL to reach OctoPrint. Either usehttp:orhttps:. Make sure
the hostname matches (default:octopi).Default:http://octopiapi_keyGive the API key you created inOctoPrintto allow to execute commands
via the REST API.3.2Sectionqtfb_devThe frame buffer device of your TFT display.Default:/dev/fb0ts_devThe touch screen input device.Default:/dev/input/touchscreen3.3SectionappGlobal settings for the whole UI.font_familyandfont_sizeSpecify the font used for the UI.widthandheightThe size of your displaydarkEnabledarkmode. Disable to seelightmode.styleSelect a specific Qt widget style3.4SectiontempSettings for thetemptab in the UI.font_familyandfont_sizeSpecify the font used for the UI temperate labelsminandmaxSet the minimum and maximum temperature shown in graph.stepSet the line and label stepping in the graph display.3.5SectionmoveSettings for themovetab in the UI.unload_zThe Z axis position to move to when selecting theUnloadbutton.label_aandlabel_bThe label text to be displayed for the custom move buttons.pos_aandpos_bThe X,Y,Z position to move to when selecting a custom button.3.6SectiontoolSettings for thetooltab in the UI.t{0,1}_temp{1,2}andbed_temp{1,2}Set the default temperature for the tools 0, 1, and the bed.3.7SectionserSettings for thesertab in the UI.font_familyandfont_sizeSpecify the font used for the UI serial log output3.8SectioncamSettings for thecamtab in the UI.urlThe the URL ofmjpeg streamerto get the mjpeg stream from your camera.Default:http://octopi:8080/?action=stream3.9SectioncommandsConfigure various external commands triggered bytentacle.Note: Make sure the user runningtentacleis allowed to perform these
commands. You may need to addsudoand configure it to run the
commands without password input.restart_octoprintRestart the OctoPrint server.Default:/bin/systemctl restart octoprintreboot_sysReboot the whole system.Default:/sbin/rebootpoweroff_sysPower off the system.Default:/sbin/poweroffbacklight_onEnable the backlight of the TFT display.Default:+/scripts/backlight 1backlight_offDisable the backlight of the TFT display.Default:+/scripts/backlight 0Note: A path starting with+/is automatically expanded to thescriptsdirectory in thetentaclemodule.4User’s ManualHard keysThe following keys are recognized:escapeEnter the system menu to execute control commands.
In the menu abort the menu and close it.returnSave a screen shot.
In the menu select and activate an item.cursor upEnable the backlight of the display.
In the menu move one item up.cursor downDisable the backlight of the display.
In the menu move one item down.5Appendix5.1Raspberry Camera SetupIn myOctoPibased setup I added a Raspberry Pi Cam.
In order to make it work I enabled theVideo4Linuxdriver in/etc/modules:bcm2835_v4l2If the image has the wrong orientation you can flip it in any direction with
thev4l2-ctltool found in thev4l-utilspackage.:v4l2-ctl --set-ctrl vertical_flip=1 --set-ctrl horizontal_flip=1To make this change persistet simply add the line to/etc/rc.local.The camera is then auto detected bymjpeg streamerrunning on the OctoPi
system.5.2Setup an Adafruit PiTFT Plus 2.8”Adafruitoffers a nice small 2.8” display with 320 x 240 pixels, a resistive
touch panel and four hard keys.Follow theInstructionsfor initial setup. It boils down to adding the HAT
in/etc/config.txtwith:dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=pitft28-resistive,rotate=90,speed=64000000,fps=30Note therotation of 90 degreesso I can use landscape mode with the correct
orientation.5.2.1Setup Hard keysHard keys are not essential to runtentacle, but they offer useful functions
including controlling of the backlight without the need for touching.The following GPIOs are connected to the PiTFT+ Hardkeys (from top to bottom):17222327I added a device tree file that maps these to the following input keys (see
theLinux Kernel input event headerfor the codes):17: Escape (code 1)22: Cursor Up (code 103)23: Enter (code 28)27: Cursor Down (code 108)Enter the directorycontrib/pitft-keysand run the the suppliedMakefilethere to build the device tree overlay binary and
install it in/boot/.$cdcontrib/pitft-keys$makeinstallNote: It will ask for your user password to install the file viasudo.5.2.2Touchscreen CalibrationIt is essential to calibrate your touchscreen. Otherwise exact picking of UI
elements with a stylus or even your fingers is not possible.PyQt5 in frame buffer mode is compiled for Raspbian to uselibinputfor
receiving touch panel events.Unfortunately, all documented ways I found on the net either assumetslibor evenX11support for calibration. Here is my own way I found with lots
trial and error.5.2.2.1Running the Calibration Tool on X11Yes, we want to run on frame buffer only but the only calibration tool I found
still uses X11. So we install a minimal X11 runtime just to start the tool.A minimal X11 server can be installed with:sudoapt-getinstallxserver-xorgxserver-xorg-video-fbdevxinitEdit/etc/X11/Xwrapper.configto allow everybody to start the server:...
allowed_users=anyboadyNow selec the frame buffer of your display to run X11 on. My display uses/dev/fb1. Edit/usr/share/X11/xorg.conf.d/99-fbdev.conf:Section "Device"
Identifier "myfb"
Driver "fbdev"
Option "fbdev" "/dev/fb1"
EndSectionNow run the X11 server once (preferrably from a ssh shell):$startx&Make sure your current calibration matrix is reset:$DISPLAY=:0.0xinputset-prop"stmpe-ts"'Coordinate Transformation Matrix'100010001Run the calibration tool with:$DISPLAY=:0.0./xtcal-geometry320x240Pick the drawn crosshairs with a stylus each and after that you get the matrix
reported:xinput set-prop <device name> 'Coordinate Transformation Matrix' 0.015731 -1.135927 1.014818 1.123037 0.017117 -0.062198 0 0 1We are interested in the values of this matrix! So copy them in your
clipboard.Stop the X11 server as it is not needed anymore:$pkillstartx5.2.2.2Save the Calibration Matrix forlibinputWe need to assign the calibration matrix in an environment variable calledLIBINPUT_CALIBRATION_MATRIX. This variable has to be set any time the
touchpanel device is detected and setup.The PiTFT installer already has created audevrule file
that creates ainput/touchscrenlink for the touchpanel device.
In/etc/udev/rules.d/95-stmpe.ruleswe add the environment variable:SUBSYSTEM=="input", ATTRS{name}=="*stmpe*", ENV{DEVNAME}=="*event*", SYMLINK+="input/touchscreen", ENV{LIBINPUT_CALIBRATION_MATRIX}="0.015731 -1.135927 1.014818 1.123037 0.017117 -0.062198"Note that only the first 6 values of the matrix are used here.Reboot your Pi to make this matrix active.You can check if the matrix is setup correctly with thelibinput-list-devicestool.$sudolibinput-list-devicesDevice:stmpe-ts...Calibration:0.02-1.141.011.120.02