GithubHelp home page GithubHelp logo

octopitouchpanel's Introduction

OctoPiTouchPanel

Touchscreen interface for OctoPrint using the kivy gui framework

The layout is designed for the official Raspberry Pi Foundation 7" touchscreen. I would recommend using the Raspberry Pi 2 or 3 Model B for the Octoprint server. I think the Pi 1 might be a bit under powered for running this touchscreen app.

Installation

Big thanks to Tim Vaillemans for documenting this installation process.

Installation for python2

Install OctoPi (https://octopi.octoprint.org/)
ssh to your Octoprint server
sudo su -
apt-get update
apt-get upgrade
apt-get install python-pip
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \
   pkg-config libgl1-mesa-dev libgles2-mesa-dev \
   python-setuptools libgstreamer1.0-dev git-core \
   gstreamer1.0-plugins-{bad,base,good,ugly} \
   gstreamer1.0-{omx,alsa} python-dev libmtdev-dev \
   xclip
pip install -U Cython==0.27.3
pip install git+https://github.com/kivy/kivy.git@master
pip install kivy-garden
garden install graph

Installation for python3

Install OctoPi 0.16 or higher (https://octopi.octoprint.org/)
ssh to your Octoprint server
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3 python3-pip python3-dev python3-setuptools
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \
   pkg-config libgl1-mesa-dev libgles2-mesa-dev git-core \
   gstreamer1.0-plugins-{bad,base,good,ugly} libgstreamer1.0-dev \
   gstreamer1.0-{omx,alsa}  libmtdev-dev xclip

python3 -m pip install --upgrade --user pip wheel setuptools
python3 -m pip install --upgrade --user Cython==0.29.10 pillow PySDL2
python3 -m pip install --user git+https://github.com/kivy/kivy.git@master
~/.local/bin/garden install --upgrade graph

Configure kivy to use the touchscreen input

[Copied from https://kivy.org/docs/installation/installation-rpi.html]
If you are using the official Raspberry Pi touch display, you need to configure Kivy to use it as an input source. To do this, edit the file ~/.kivy/config.ini and go to the [input] section. Add this:

mouse = mouse
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput

Disable console screen blanking

Raspbian Jessie has console screen blanking turned on by default. It is set to 600 seconds. To disable this you must edit this file:

vi /boot/cmdline.txt

After 'console=tty1' add 'consoleblank=0'. Your cmdline.txt should look something like this:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 consoleblank=0 root=PARTUUID=17e26144-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

Note the cmdline.txt file must be a single line of text. After saving this file reboot your Pi.

Clone this repo

cd ~
git clone https://github.com/matt448/OctoPiTouchPanel.git

Configure OctoPiTouchPanel

cd OctoPiTouchPanel
cp octoprint.cfg.sample octoprint.cfg
edit octoprint.cfg (with vim, nano, etc.)
The important items to edit are in the APISettings section.
- host: should almost always be 127.0.0.1
- apikey: get API key from your octoprint webpage. Looks something like AADDEEDD0BA48F891F3966F856765FB
- nicname: Use ifconfig to identify network interface Looks something like eth0 or wlan0

Configure system to start touchscreen app on boot

Older Linux distros use start scripts in /etc/init.d. Newer Linux distros use start scripts in /etc/systemd/system. I've included both with this project but since systemd is now the standard I will detail how to set that up.

sudo cp OctoPiTouchPanel/etc/systemd/system/touchscreen.service /etc/systemd/system
sudo chmod +x /etc/systemd/system/touchscreen.service
sudo systemctl enable touchscreen

The touchscreen app should now launch when the Pi boots up.

Manually starting and stopping the app

sudo systemctl start touchscreen
sudo systemctl stop touchscreen

Screenshots

screenshot


screenshot_control


screenshot_temps


screenshot_temps


screenshot_temps

octopitouchpanel's People

Contributors

matt448 avatar

Stargazers

 avatar  avatar David Crook avatar  avatar  avatar Sumit avatar  avatar  avatar Janddda avatar  avatar  avatar Daniel Chote avatar Dinesh Cyanam avatar Chris Whiteford avatar Anil Kumar avatar

Watchers

 avatar James Cloos avatar  avatar Stacy avatar Anil Kumar avatar  avatar Janddda avatar  avatar

octopitouchpanel's Issues

Support dual extruders

  • Parse out tool1 temperature from octoprint api response
  • Show temperature of second hotend on Status tab
  • Set temperature of second hotend on Temps tab
  • Add selector on extruder control buttons to pick E0 or E1 on Control tab

Add a pop-up to confirm Exit and Reboot actions

The Exit and Reboot buttons on the OS Utils screen perform their actions as soon as they are touch. It would be better if there was a pop-up that asked Yes or No before executing the action.

Sample code for pop-ups in kivy:

popup_sample_code

Disable jog and home buttons on Control tab while printing

The X/Y/Z jog and home buttons should be disabled when there is a print job running.

  • Add a disabled property to all of the jog and home buttons and set it to False by default.
  • When the job status changes to 'printing' set disabled: True for jog buttons.

Add fine adjustment arrows to Temp controls

Add a set of left and right arrows to each temperature control to allow for 1C fine adjustments of the slider values. I occasionally have have trouble setting a temperature to an exact value with the sliders.

Pressing the right arrow increases the temperature by one degree celsius.
Pressing the left arrow decreases the temperature by one degree celsius.

User still needs to press the set button after adjusting the slider value.

Increase the spacing between the bed and hot end temperature controls to allow room for the arrow buttons. Keep in mind the addition of preset buttons when placing the arrow buttons.

Issues executing OctoPiTouchPanel from Pi

Greetings Matt, I have been trying to get the touch panel to startup on the Raspberry pi desktop via an Icon, rather than using the terminal or a SSH session. I cannot figure out how to get it to work. It seems like it is not properly accessing the octoprint.cfg file.

Any Ideas?

the app also seems to time out after a while and end, I am not sure if this is due to the fact that i am launching from a SSH session...

Add preset buttons to the 'Temps' tab

Might be nice to have a few preset buttons on the Temps tab to make setting common temperatures quicker.

Presets should be configurable in the config file.

Should the preset buttons immediately activate heating? Or should they just set the slider and then user has to press the 'Set Bed Target' button?

Add Extruder control buttons

I was just switching filament in preparation for starting a print. I realized that the control screen does not have extruder controls. Perhaps buttons for extrude and retract? My suggestion would be to have four buttons one each for extrude slow, Extrude fast, retract slow and retract fast, they could also be linked to the 4 buttons for selecting the amount of movement.

Add file browser to Jobs tab

Allow user to select from previously uploaded files and start a new job.

  • Add a file browser widget.
  • Variable for file selected.
  • Button to load file (pressing the button send API request to load file)
  • Print button starts the job.

Testing with Makergear M2

Hello Matt, I am the one who noticed your app on Thingiverse, and you directed me to it. Very Nice app, i like where you are going with it, much cleaner and easier to use on Rpi official 7" display. than the web Touch UI

I am new to Kivy, but was able to install it, and run your app, I thought I would give you some feedback of the things I see/came across: - Note I am testing with a Makergear M2 running Marlin fw

-Installation was fairly simple, however i had to find the Garden.graph module, once it installed the app was up and running on my RPI.
-i found that i had to put the port (in my case :5000) after the IP address in octoprint.cfg - once i did this the app connected to the printer.
-once connected to the printer i tested the control first, Works very well, very responsive, however for some reason my axis's seem to be inverted (all 3) perhaps your configuration and mine differ in which way is positive and negative? - a polite suggestion would be to perhaps add an Invert axis option?
-Temperature control, Again, works well, the only thing I see here is that your bed limit is 100°C... I routinely heat my bed to 110°C to 115°C for printing ABS.

Thank you for Sharing your efforts with this, I am very excited to find this.

As i said, I am new to Kivy, I have modest programming experience in a few languages C++ VB, and a long time ago Assembly...as well i am somewhat rusty with Linux, that being said, i would be willing to spend some time assisting with testing, or perhaps even code. Either way, thank you!

Trim printer status message text

Printer status message overflows the field on the Status and Control tabs. Format the string so only X number of characters are displayed.

Move 'Cancel' button on Jobs tab

Description

The 'Cancel' button on the Job tab is too close to the 'Pause' button.
This could lead to accidentally pressing the wrong button when doing things like pausing the job to change filament.

Details

  • Move the 'Cancel' button over to the right side of the screen
  • Increase the spacing between the 'Print' and 'Pause' buttons
  • Increase the size of the 'Print' and 'Pause' buttons

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.