Code Monkey home page Code Monkey logo

papertty's Introduction

PaperTTY

Overview

PaperTTY is a simple Python module for using affordable SPI e-ink displays as a computer monitor, with a Raspberry Pi being the typical computer interfacing with the display. Most of the tested displays are Waveshare branded, but also others - particularly ones using the IT8951 controller - might work.

Things it can display on the e-ink:

Subcommand Description
fb Framebuffer (/dev/fbX)
terminal Linux virtual console (/dev/vcs[au]X)
vnc VNC desktop
image Image files
stdin  Standard input

To use any feature, you need to select an appropriate driver for your e-ink display as a top-level option (papertty --driver X ...). To see the list of drivers, use papertty list.

To see help for individual subcommands, use --help with them, ie. papertty --driver X --terminal --help.

Usage

PaperTTY is currently packaged using Poetry, however it can be installed via pip too. The instructions here are for Raspberry Pi (please open an issue if you need support for another platform).

You need to enable SPI first:

  • sudo raspi-config
    • Interfacing Options -> SPI -> Yes
  • May want to reboot just in case

Then, you also need some system dependencies:

  • sudo apt install python3-venv python3-pip libopenjp2-7 libtiff5-dev libjpeg-dev libfreetype-dev

Install with pip to virtualenv

If you just want it installed as packaged in PyPi (if you need to modify something use the Poetry way instead - also note that it is possible for the package in PyPi to not match the latest source):

python3 -m venv papertty_venv
source papertty_venv/bin/activate
pip install papertty
papertty_venv/bin/papertty --help

Install with Poetry

The "correct" way to set up PaperTTY is using Poetry. This gives you the most flexibility and handles the virtualenv creation automatically. Sometimes with VNC issues one may need to downgrade vncdotool to 0.13.0, too, which is not as easy with the pip method.

First you need to install Poetry, refer to their instructions.

Then:

git clone https://github.com/joukos/PaperTTY.git
cd PaperTTY
poetry install  # if you change something with the deps, do a `poetry update`
poetry run papertty --help

To get a direct path for the script (which will be run in the virtual environment with all the dependencies), run in the directory: echo $(poetry env info -p)/bin/papertty. Append any options you need and this is what you want to start in a SystemD unit or so, possibly with sudo depending on the OS configuration and the feature you wish to use.

The rest of this page has not been updated but is left as reference until a more holistic documentation update is actually done. If you have any issues, please search the existing issues and create a new one if necessary. joukos/2022-01-17

Warning - old stuff ahead!


PyPi!

This is still WIP.

You can now install PaperTTY via PyPi. The updated (simplified) documentation is still a bit unfinished and things moved around somewhat, so the rest of this page is not quite up to date yet on all details.

TL;DR:

sudo apt install python3-venv python3-pip libopenjp2-7 libtiff5 libjpeg-dev
# # optionally configure a virtualenv before running pip:
# python3 -m venv papertty_venv
# source papertty_venv/bin/activate
pip3 install papertty

Image display command

@colin-nolan has contributed a subcommand to display image files on the screen, allowing to test the displays or easily make a photo slideshow or similar. Try image --help to check it out.

Partial refresh support for 4.2" (2020-03-01)

Thanks to @gdkrmr, the 4.2" module now has a new driver that supports partial refresh. Note that now the default behavior is to do partial updates and you'll need to add --nopartial to driver settings if you want to use the full refresh instead.

Interactive Update (2020-02-18)

Starting terminal with the --interactive option adds a menu to the Ctrl-C handler that allows you to change the font, font size and spacing on the fly. This should be helpful when trying out fonts.

Cursor Update (2020-01-25)

The terminal mode now supports different cursors. --nocursor had been deprecated in favor of --cursor=none. The usual underscore-like cursor is set via --cursor=default, which, as the name suggests, is also the default mode. There is also a --cursor=block option, which inverts the colors at the cursor's location. Finally, there is also an option to provide a numerical value, e.g. --cursor=5, which draws an underscore cursor shifted 5 pixels towards the top; --cursor=default and --cursor=0 are thus equivalent.

Unicode Update (2020-01-22)

On systems with /dev/vcsu* (e.g. Raspbian Stretch or Buster, with kernel 4.19+) and when using a TrueType font, the terminal mode now has full support for Unicode output. This is automatic, with a fallback to 8-bit if either of these requirements isn't met. We've also changed the standard encoding for 8-bit to ISO-8859-1, which should be a little closer to what the vcs device provides.

IT8951 Optimization II (2020-01-15)

The previous optimization was improved further to speed up VNC output too. If you try it, please leave a comment at #32 (and create a new issue if there's problems).

IT8951 Optimization (2020-01-11)

An optimization by @chi-lambda for the IT8951 driver was merged and may speed up the bit-packing in TTY mode even by up to 10x for these displays, so the refresh rates should be significantly better now. Please create an issue if there are problems (the unoptimized version can be checked out with the tag v0.03_unoptimized).

IT8951 Update (2019-11-03)

Support for IT8951 based displays kindly provided by @fimad has been merged. This means that Waveshare 6", 7.8", 9.7" and 10.3" may work since they use this controller. At least the 6" and 9.7" displays have been verified to work. A big thanks to everyone involved with the discussion and code contributions (#25)!

If you have one of these displays and want to test it, add your experiences to #32.

Here is a picture of the 9.7" in action (by @math85360):

YouTube video

VNC Update (2019-07-07)

So, it's been almost a year since last update and I've been very very busy.

Since I'm going to be even busier for the next two years or so, and probably won't have much time to spend on this project, I wanted to see if I could kludge this one last thing that I think is needed (and was referenced in #23 (comment)): a VNC client to PaperTTY.

I'm happy to announce that it works! It's not the most elegant or beautiful thing, but now you can run a graphical desktop and any programs you wish on these epaper screens. It also solves many problems and complexities with text-only terminals, namely encoding/font issues and other quirks. I've tested it with the 4.2" and the 2.13" displays.

The performance is pretty much the same as before, maybe a tad more image processing though, but the bottleneck is the display refresh anyway. All the complex stuff is done by vncdotool by Marc Sibson, since it was the most mature-seeming VNC library I could find that would work with Python 3 without extra work. It's also overkill for the job - all that's needed is to read the screen content periodically.

The way this works is pretty simple: PaperTTY will connect to the VNC server, then just reads the screen content in a loop. If the image changes, the region containing the changes will be updated on the display. This is not actually very efficient and originally I planned to have it update the native VNC "dirty rectangles", but it was simpler to kludge it like this for a start, and it seems to work fine, so it's perhaps easier to make better now.

Some benefits and features

  • Run all CLI and GUI programs
  • Dithers colors so you can throw anything at it and hopefully it's legible on the display
  • About as fast as just using the terminal mode, but much less hassle (sort of)
  • Has options for rotating and inverting the colors
  • Rescales the VNC screen to fit the display (panning not implemented)
  • Simplistic, surely buggy and doesn't fix the other problems PaperTTY might have

Quick start

  • Install PaperTTY from PyPi:
    • pip install papertty
  • Start a VNC server somewhere (on the RPi for example)
    • ie. vncserver -geometry 250x128 :1
  • Run PaperTTY as usual, but use the vnc subcommand (see --help for options)
    • ie. sudo papertty --driver epd2in13 vnc --display 1 --password supAPass --sleep 0.1 --rotate 90
    • This would (by default) connect to localhost, display 1 (= port 5901), using the 2.13" driver, specifies the password, sleeps 0.1 seconds after each update, and rotates the screen by 90 degrees
  • If image looks wonky, make sure you have the right orientation for the VNC server (ie. -geometry 300x400 vs. -geometry 400x300) and the correct --rotate value.

Standalone RPi with mouse and keyboard

So, you have your nice display and a RPi that you want to combine into a cool e-ink laptop, using peripherals plugged into the RPi. There's currently no automation or service files for this purpose, but what you can try is this (for the 2.13"):

  • Install or enable a desktop environment / window manager, unless it already exists (ie. if you plug in the HDMI port, you should get a graphical session)
  • Install x11vnc on the RPi
  • Plug in keyboard and mouse
  • Start a tmux session on the RPi and run the following commands, in their own windows (to easily find out if something goes wrong)
  • # tmux window/pane #0
    sudo lightdm    # start lightdm if not already started
    export $(sudo x11vnc -findauth)	# find the X authority file (probably /var/run/lightdm/root/:0)
    sudo x11vnc -usepw -display :0 -forever	# start x11vnc
    # tmux window/pane #1
    sudo papertty --driver epd2in13 scrub      # scrub for clear image
    sudo papertty --driver epd2in13 vnc --display 0 --password supAPass --sleep 0.1 --rotate 90   # display the session
  • If all went well, you should now be able to see the login screen (or whatever is in your display :0) and can interact with the GUI using mouse and keyboard plugged into the RPi, making it a cool standalone unit.

Here's a quick video showing this in action

YouTube Video

The RPi Zero W is quite sluggish though and the default resolution was used here, so downscaling it to 2.13" makes it pretty unreadable even without the background images and other crud. It's a proof of concept anyway and just needs a bit of polish.

I'll try to add more details later if I have time, but here's some more screenshots:

FreeCiv, downscaled from 800x600

IRC and surfing action

Freedoom, why not

Early image of testing some X progs

And a YouTube video to showcase some partial refresh action

YouTube Video

As always, create issues if there's problems. I'd also be very interested if someone with a 9.7" display gets this to work with partial refresh.

The rest of this page is not updated to cover the VNC feature yet.


This is an experimental command-line driven Python module to render the contents of a Linux virtual terminal (/dev/tty[1-63]) or standard input onto a Waveshare e-Paper display. See list of supported displays.

Note: Testing has been minimal and I probably forgot something, so 'caveat utilitor'. I am also not affiliated with Waveshare in any way.

Note: relevant changes listed in the changelog.

Some features

  • Designed to be used with a Raspberry Pi and Raspbian.
  • It should enable you to run interactive console programs (vim, tmux, irssi, nethack ...) and display whatever you want easily with scripts.
  • Especially with a small font, it is fast enough for interactive use but could be improved to be even faster. Also, it's quite a bit snappier on the Raspberry Pi 3 than the Zero.
  • Only the changed region is updated on the display, so typing is faster than full screen scrolling.
  • The cursor is also drawn and the image updated as it moves.
  • Flicker-free.
  • Allows changing the font, font size, orientation and some other parameters.
  • Supports TrueType and bitmap fonts (in PIL format).
  • Bundled with a systemd service unit to start the service early at boot and gracefully stop it.

It isn't perfect and has only been tested with the monochrome 2.13" HAT, but it might work for other models too, and allows you to at least try.

  • The PaperTTY code is in the public domain and you run it at your own risk.
  • The driver code (in drivers/) is GPL 3.0 licensed, because it is based on Waveshare's GPL code - you still run it at your own risk.

Screenshots

Collage of running various programs in tmux

Running Nethack outside in the noon sun, powered directly by a solar panel, connected to a Bluetooth keyboard

Action video - terminal usage (Raspberry Pi Zero W)

Showcasing input feedback.

Youtube Video

Action video 2 - cacafire (Raspberry Pi 3)

The RPi3 is noticeably faster - cacafire is 3x slower on the Zero. Typical terminal usage works pretty well.

Youtube Video

Installation

All of the code was written for Raspbian Stretch and Python 3.5+. These instructions assume you're going to run this on a Raspberry Pi, otherwise you're on your own.

The code includes a reimplementation/refactoring of the Waveshare reference drivers - unlike the rest of the code which is CC0, the drivers have the GPL 3.0 license, because that's what Waveshare used. The drivers for models that aren't in the repo have been acquired from their Wiki's demo code packages.

See the driver page for details and the supported models.

The earlier, initial version of PaperTTY (tag: v0.01) did not have instructions for using virtualenv (though it would work) - you can still run it as before using the system packages and alongside this new version. Using the virtualenv means that PIL and Pillow can also coexist on the same system.

Requirements

  • Enable SPI (sudo raspi-config)
    • Interfacing Options -> SPI -> Yes
    • Reboot

Steps

  1. Install virtualenv, libopenjp2 and libtiff5
    • sudo apt install virtualenvwrapper python3-virtualenv libopenjp2-7 libtiff5
  2. Source the wrapper to use mkvirtualenv (you may want to add this to ~/.bashrc)
    • source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
  3. Create the Python 3 virtualenv and install packages in requirements.txt
    • mkvirtualenv -p /usr/bin/python3 -i papertty requirements.txt papertty
    • This will create ~/.virtualenvs/papertty which contains the required environment
  4. After creating the virtualenv, it should become active and you should see (papertty) on your prompt
    • Note: the software needs to be run with sudo in the typical case, so you need to explicitly start the interpreter within the virtualenv - otherwise the program attempts to import system packages instead
    • You should now be able to run sudo papertty list to see the available drivers and start using the software
  5. Not really needed, but to (de)activate the virtualenv afterwards, run:
    • ~/.virtualenvs/papertty/bin/activate - activate the virtualenv
      • Or, workon papertty if you have sourced virtualenvwrapper.sh
    • deactivate - deactivate the virtualenv

Fonts

You can use TrueType fonts or bitmap fonts, but the bitmap fonts need to be in the right format. With bitmap fonts the --size option is ignored.

Included as default is a very small bitmap font called Tom Thumb, it is fairly readable for its tiny size and fits 20 rows with 62 columns on the 2.13". Thanks go to Brian Swetland and Robey Pointer for their work on the font and for releasing it under CC0.

Another included font is the nanofont, which is an extremely tiny (3x4 pixels) font and also released under CC0. Thanks go to the author, Michael Pohoreski. The conversion was done by generating the BMP, then transformed it with Pillow so that everything was on one line, then used Fony to save a BDF and converted that to PIL.

Why would you use such a microscopic font, I hear you ask? One good reason is that some programs refuse to start unless the terminal size is big enough, and using this font will allow you to get things theoretically readable and run those programs even on the smaller displays. One example being Dungeon Crawl Stone Soup which wouldn't otherwise start on the 2.13" display (hooray!):

Playing the game like this would be quite challenging, however...

Unless you're happy with the awesome default font, find a nice monospaced TrueType or bitmap font: Andale Mono (sudo apt install ttf-mscorefonts-installer) is pretty great for very small sizes and on the 2.13" (128x250 pixels) can fit 17 rows and 50 columns

  • You can use a proportional font but the terminal will probably look horrible

Pillow includes a utility called pilfont.py, you can use this to convert a BDF/PCF font file into a .pil and a .pbm (I didn't have luck with some fonts - remember to use the pilfont.py version that's on your Pi):

# convert Terminus 
gunzip -c /usr/share/fonts/X11/misc/ter-u12b_unicode.pcf.gz > terminus-12.pcf
pilfont.py terminus-12.pcf
# you should get terminus-12.pil that you can pass with the --font option

All font options expect a path to the font file - the system font directories are not searched for them.

Usage

If you have PaperTTY installed in a virtualenv, remember to use its interpreter when running the program with sudo or being root: sudo ~/.virtualenvs/papertty/bin/python3 papertty

  • You'll want to sudo unless you've set it up so that SPI works without and you've given read access to /dev/vcsa*

To do anything useful, you'll need to tell the script which model you're using - in my case this would be epd2in13. Use the top-level option --driver to set the desired driver.

Append --help with the subcommands to get help with their parameters.

You can just edit papertty.py to your liking - the code is very simple and commented.

Top-level options

These should come before the subcommands and they control general settings.

Option Description Default
--driver NAME Select driver to use - required no default
--nopartial Disable partial refresh even if the display supported it disabled
--encoding NAME Select encoding to use utf-8

Note: The encoding settings are a bit questionable right now - encoding/decoding is done explicitly to have ignore on any errors, but I think this needs some more work as it's not an entirely trivial issue. If you feel like there's a big dum-dum in the code regarding these, a PR is very appreciated.

Note 2: To get scandinavian accents to show (ä,ö etc.), try --encoding cp852.

Commands

list - List display drivers

# Example
sudo papertty list

scrub - Scrub display

This command mostly makes sense with the partial refresh models, although you can run it with full refresh too - it's just going to take a pretty long time to run. I needed this because my own unit can't handle a full refresh so it was the only way to clear the screen properly!

If you're left with "burn-in" or the display doesn't seem to work properly, this usually helps to even it out (may even need to run it twice sometimes if the display is not in a steady state).

This will slowly fill the screen with bands of black, then white.

Option Description Default
--size N Chunk width (pixels) to fill with (valid values: 8-32) 16
# Example
sudo papertty --driver epd2in13 scrub

stdin - Render standard input

Render stdin on the display, simple as that. Leaves the image on the display until something else overwrites it. Very useful for showing script output or just about anything that updates irregularly.

Option Description Default
--font FILENAME Path to a TrueType or PIL font to use - strongly recommended to use monospaced tom-thumb.pil
--size N Font size 8
--width N Fit to a particular width (characters) display width / font width
--portrait Enable portrait mode disabled
--nofold Disable folding (ie. don't wrap to width) disabled
--spacing Set line spacing 0
# Example
cowsay "Hello World" | sudo papertty --driver epd2in13 stdin --nofold

terminal - Render a virtual terminal

The most prominent feature.

This requires read permission to the virtual console device (/dev/vcsa[1-63]) and optionally write permission to the associated terminal device (/dev/tty[1-63]) if you want to set the TTY size via ioctls.

If you're going to use terminal with a display that doesn't support partial refresh, you probably want to set --sleep a bit larger than the default, such as a few seconds, unless you enjoy blinking.

The process handles two signals:

  • SIGINT - stop and clear the screen (unless --noclear was given), same as pressing Ctrl-C
    • sudo pkill -INT -f papertty.py
    • By default, the systemd service unit attempts to stop the process using SIGINT
  • SIGUSR1 - apply scrub and keep running
    • sudo pkill -USR1 -f papertty.py

See details on how all of this works further down this document.

Option Description Default
--vcsa FILENAME Virtual console device (/dev/vcsa[1-63]) /dev/vcsa1
--font FILENAME Path to a TrueType or PIL font to use - strongly recommended to use monospaced tom-thumb.pil
--size N Font size 8
--noclear Leave display content on exit disabled
--nocursor Don't draw cursor disabled
--sleep Minimum delay between screen updates (seconds) 0.1
--rows Set TTY rows (--cols required too) no default
--cols Set TTY columns (--rows required too) no default
--portrait Enable portrait mode disabled
--flipx Mirror X axis (experimental / buggy) disabled
--flipy Mirror Y axis (experimental / buggy) disabled
--spacing Set line spacing 0
--scrub Apply scrub when starting disabled
--autofit Try to automatically set terminal rows/cols for the font disabled
--vcom Set the VCOM value of the panel. Entered as positive value x 1000. eg. 1460 = -1.46V no default
--disable_a2 Disable fast A2 panel refresh for black and white images disabled
--disable_1bpp Disable fast 1bpp mode disabled
# Examples

# by default the first virtual terminal (/dev/vcsa1 == /dev/tty1) is displayed
sudo papertty --driver epd2in13 terminal

# set font size to 16, update every 10 seconds, set terminal rows/cols to 10x20
sudo papertty --driver epd2in13 terminal --size 16 --sleep 10 --rows 10 --cols 20

# auto-fit terminal rows/cols for the font and use a bitmap font
# (fitting may not work for very small fonts in portrait mode because of terminal restrictions)
sudo papertty --driver epd2in13 terminal --autofit --font myfont.pil

How to use the terminal

Logging in?

After you've gotten the terminal to render, you'll want to run something there.

As the program mirrors the system virtual terminals, you can either attach a keyboard to the Pi and simply log in or use the openvt program to start something there without messing around with cables, if you already have SSH access.

The following commands are run over SSH.

For example, to start htop for user pi on tty1 (via sudo, twice):

# "as a sudoer, start sudo forcibly on VT 1 (tty1) to run 'htop' as the user 'pi'"
sudo openvt -fc 1 -- sudo -u pi htop

After you exit the process, agetty may go haywire though (hogging CPU). Give it a nudge to fix it:

sudo pkill agetty

And you should have the login prompt there again.

In practice, you'll want to use tmux (or screen, if you prefer) to have the most flexible control over the terminal (these are terminal multiplexers, and if you haven't used one before, now is the time to start):

# start a new tmux session (or just run 'tmux' with a connected keyboard)
sudo openvt -fc 1 -- sudo -u pi tmux
# (see the session starting up on the display)
# now, attach to the session
tmux attach

Lo and behold! You should now be attached to the tiny session visible on the display.

You can kill the papertty.py process at any time - the stuff that runs in the TTY will be unaffected (unless they react badly to console resizing) and you can just restart the terminal to get the display back and play around with the settings.

Start up at boot

A simple systemd service unit file is included with the package, called papertty.service. It calls start.sh so that instead of editing the service file, you can edit the start script (and easily add whatever you need) without needing to run systemctl daemon-reload all the time.

  • You can simply put the command in the service file too, it's your choice
  • You probably want to set the script to be owned and writable by root only: sudo chown root:root start.sh; sudo chmod 700 start.sh
  • Remember: to run the command under the virtualenv, you need to run the python3 command from within the virtualenv's bin directory - this will ensure the environment is correct

To have the display turn on at boot, first edit the command you're happy with into start.sh:

# Remember: you probably want to set rows and cols here, because at reboot they're reset.
# Also, when booting up after a power cycle the display may have some artifacts on it, so 
# you may want to add --scrub to get a clean display (during boot it's a bit slower than usual)
VENV="/home/pi/.virtualenvs/papertty/bin/python3"
${VENV} papertty --driver epd2in13 terminal --autofit

Then make sure you have the right paths set in the service file:

...
### Change the paths below to match yours
WorkingDirectory=/home/pi/code/PaperTTY
ExecStart=/home/pi/code/PaperTTY/start.sh
###
...

Then (read the unit file more carefully and) do the following steps:

sudo cp papertty.service /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable papertty
# To disable the service:
# sudo systemctl disable papertty
# sudo systemctl stop papertty

This will incorporate the service with systemd and enables it. Before rebooting and trying it out, you may want to stop any other instances of the papertty.py and then see if the service works:

sudo systemctl start papertty
# (the service should start and the terminal should appear on the display,
# if you need to edit any settings, run 'systemctl daemon-reload' again after
# saving the service file)
sudo systemctl stop papertty
# (the service should stop and the display should be cleared, unless you used --noclear)

If the service seemed to work, try rebooting and enjoy watching the bootup. If you need to scrub the display while the service is running, you can send the SIGUSR1 signal to the process.

If the service didn't work, check that the paths are correct and that start.sh has the execute bit set.


Why?

Kindles and the like have been around for a long time already, but there have been very few attempts at a general purpose e-ink display. General purpose meaning that I can use the programs I'm used to using and can display them on the e-ink display.

Why would anyone want such a thing, anyway? Here are some reasons:

  • First of all, their power consumption is very low, making them suitable for many embedded applications where you just need to display some information periodically
  • They are beautiful and easy on the eyes
  • They are readable in direct sunlight with no glare to speak of - and could run indefinitely off solar too
  • Many of us spend most of their time reading and editing mostly static text, and this is where e-ink should excel
  • Sometimes the refresh rate does not matter at all, as long as the eventual feedback is there - you may not want a backlit, power-hungry display for something you need updated just once a day
  • You can still read your ebooks - in Vim!

The problem

Aside from digital price tags and similar special markets, there are some viable commercial offerings for mainstream computing on e-ink, such as the Onyx Boox Max2 that not only boasts a proper tablet form factor with an e-ink display, but also an HDMI input for using it as a secondary display (squee!). While it seems really cool, it's quite expensive, rare and more than just a simple display unit (and those cost just as much).

The display modules sold by Waveshare are exceptional in that they are very affordable (~15-90 USD), offer a wide range of sizes (1.54" up to 7.5") and even have "color" models (black/white/red). Earlier such offerings simply weren't there and people used to hack Kindles in very complex ways to get any of the fun.

So now that anyone can buy cheap e-ink, there is but one problem: how to get your content on it?

The display looks really cool and nifty but all you'll get in the package is just that and some code examples to draw something on it - with a program you need to write yourself. After unboxing, how does someone browse the Internet with it? Sadly, they don't.

The solution

I've had a Waveshare 2.13" HAT for the Raspberry Pi for a while now, and from time to time I've tried to find if someone had already implemented something like this since it sounds simple enough, but at the time of writing I don't know of any programs that mirror the terminal onto an e-ink, so I had a go at it.

For my purposes I just need proper terminal program support. The next step might be implementing a VNC client which should naturally translate quite well to e-ink's partial updating, but I don't have the time.

How it works

The principle of operation is deceptively simple:

  • Reads the virtual terminal contents via /dev/vcsa* (see man vcsa)
    • For example, content of /dev/tty1 (that you get with Ctrl-Alt-F1) is available at /dev/vcsa1
    • This includes the attributes, but they are ignored (if I had a tricolor display, they could be useful)
    • Terminal size (character and pixel) is encoded in the first four bytes - this is used to read the rows and columns
  • Optionally sets the desired terminal size with ioctls (requires write access to the /dev/ttyX device)
  • Adds newlines according to the terminal width (unlike the screendump utility that reads from /dev/tty*, reading from a vcsa* does not include newlines)
  • Renders the content and the cursor on an Image object
  • Compares the newly rendered content to the previous content and updates the changed region on the display
    • Done in a very simple fashion with just one bounding box
    • This results in non-flickering updates and decent speed in typical use cases

Caveats, shortcomings

Some notes:

  • Hardly tested, developed for a particular model - other models may not work or may need some code tweaking first
    • If it sorta works but crashes or something else goes wrong and your display doesn't seem to work like usual anymore, don't panic, try the scrub command a couple of times first and wait for it to finish - powering off and disconnecting the module completely ought to help as a last resort
    • Turns out my particular unit is actually flawed and doesn't do full refreshes properly so implementing it for other models has been mostly guesswork and wishful thinking
      • The scrub feature may be entirely unnecessary for normally functioning units
  • The code is surely littered with bugs and could use some refactoring
  • You need to figure out the parameters, font and encodings that work for you
  • Not much thought given to tricolor displays - you need to modify the part where attributes are skipped and implement it yourself (or donate such a display and I might take a look...)
  • Minimal error handling
  • You can't set an arbitrary size for the terminals with ioctls - it would be better to use some pseudo terminal for this but then again, sometimes you specifically want tty1 (imagine server crashing and having the kernel log imprinted on the e-ink)
  • Cursor placement is a bit obscure - this has to do with how the imaging library handles fonts and their metrics and it's not always very clear to me how they scale with the font... it works well enough though
  • The mirroring features were just an afterthought and don't work perfectly (probably simple to fix), also arbitrary rotation is missing (but easy to add)
  • The code was written for Python 2 - there are some forks and improvements on the Waveshare code around, but I wanted to make this work on the stock offering so didn't bother incorporating that stuff here
    • The code is now for Python 3
  • While testing out some imaging library functions, I noticed that on another computer the library seemed to lack the spacing keyword argument for drawing text - this may be a problem in some environments but I didn't think much of it

Conclusion

Even with all the caveats in mind, I still think the program is very useful and fills a niche. I wish I could have tested it with more than one display model, but that's why I'm releasing it as public domain, so anyone can try it out and hopefully turn it into something better.

- Jouko Strömmer

papertty's People

Contributors

badrihippo avatar burlapsax avatar chi-lambda avatar colin-nolan avatar edwardbetts avatar fimad avatar fpammer avatar gdkrmr avatar joukos avatar mcarr823 avatar mil avatar sonic74 avatar thegreydiamond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

papertty's Issues

Partial window support for 7.5inv2

Last month, I managed to get a partial window working on my 7.5" screen (the GDEW075T7) but haven't found the time to iron out everything and clean up the code. I'll get to this by and by, but instead of sitting on it, I decided to paste the code out here in case someone else wants to use it without waiting.

7in5v2partial.snippet.py.txt

This is built upon my previous pull request at #35, as well as the work done later by @colin-nolan in #51. I managed to get a partial window working (only that part of the screen gets refreshed), but not a partial refresh (simple change of pixels with no blink, blink each time). To get it working, you need to

  1. append the code to drivers/drivers_partial.py
  2. add drivers_partial.EPD7in5v2partial to driverlist (under the get_drivers function in papertty.py)

Like I said the code is very messy, and I'll come clean it up at some point. Just wanted to get the code out in case it helps someone in the meantime.

Why is CS pin controlled through GPIO and not with SPI?

I would like to use a second device on the SPI, which requires to let control of CS pin to spi-dev. Otherwise the code simply sets CS pin active while driver for second device currently has CS pin for second device active and transfers data. IT8951 would then receive data meant for second device.

trouble running papertty.py

File "./papertty.py", line 716, in
cli()
File "/usr/lib/python3/dist-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/decorators.py", line 27, in new_func
return f(get_current_context().obj, *args, **kwargs)
File "./papertty.py", line 502, in vnc
ptty = settings.get_init_tty()
File "./papertty.py", line 394, in get_init_tty
tty.init_display()
File "./papertty.py", line 246, in init_display
self.driver.init(partial=self.partial)
File "/home/pi/PaperTTY/drivers/drivers_partial.py", line 69, in init
if self.epd_init() != 0:
File "/home/pi/PaperTTY/drivers/drivers_base.py", line 184, in epd_init
self.SPI = spidev.SpiDev(0, 0)
FileNotFoundError: [Errno 2] No such file or directory

Trouble running VNC

I'm trying to make PaperTTY work through VNC, I have my Waveshare 9.7".
When running papertty --driver it8951 vnc --display 1 --sleep 0.1 --rotate 90
this is what happens:

$ papertty --driver it8951 vnc --display 1 --sleep 0.1 --rotate 90 Loading PIL font /home/pi/.local/lib/python3.7/site-packages/papertty/resources/tom-thumb.pil. Font size is ignored. width = 1200 height = 825 img_addr = 0011a1e0 firmware = SWv_0.2.1T lut = M841 VCOM = -2.00V Timeout to server localhost:1

Sorry if I'm being lame (new to this)

Burn in?

I am developing the partial refresh 4.2 inch driver and during development I always use htop for testing and sometimes I just leave the display running for an hour or two. Now I can see the htop layout every time my screen does a refresh. After doing constant refreshes for 5 minutes, the `htop screen has faded a bit on displayed images, but is still very much noticeable during refreshes.

I guess terminals are the worst case scenario for burn ins, because they have characters always at the same positions.

Anyone else with this problem?
Is this going to be permanent?
Do we need a random frame buffer for refreshing or random shifts (like OLED displays) to avoid this?

Safety and image clarity

In order to prevent any potential damage for long running applications and keep the image clean, a couple of things ought to be done:

  • Set the panel to deep sleep after a refresh
  • Apply a full-refresh update every now and then for terminal mode (vnc does this already)
    • Also allow to manually initiate (such as scrub currently - but it's not as useful)

Rationale for deep sleep is an entry in the FAQ tab of Waveshare wiki page for 2.13" (not sure when it was added but I don't remember seeing this particular mention earlier):

Question:
Why my e-paper has ghosting problem after working for some days
Answer:
Please set the e-paper to sleep mode or disconnect it if you needn't refresh the e-paper but need to power on your development board or Raspberry Pi for long time.Otherwise, the voltage of panel keeps high and it will damage the panel

Rationale for full refreshes every now and then is also on the same FAQ page:

Note that you cannot use Partial refresh all the time, you should full refresh e-paper regularly, otherwise, ghost problem will get worse even damage.

Also regarding the three-color variants, there's yet another note (though its exact meaning is a bit vague to me):

You need to update the content of three-color e-Paper at least one time every 24h to avoid from burn-in problem.

The last thing I want is someone's display suffering damage from running PaperTTY too long (which might be a very typical use case), so I think these should be addressed.

Fix encoding issues

Implement "proper" support for different encodings and error handling, meaning that the program shouldn't for example crash because of a character that can't be drawn. For now it just barely works.

There's a few things to consider, such as:

  • virtual console charset (and char device to read from)
  • locale settings
  • glyph support in various fonts
  • tmux supports UTF-8 only, for example
  • etc.

Goal would be to handle any garbage without problems and displaying it as well as possible using default settings - if this were to be used as the only means to get output from a RPi, it should never crash.

CPU usage

What is the expected CPU load on a Pi Zero? I'm seeing constant 50-70% load on my Zero just sitting at a terminal prompt and I'm curious if that is expected for this hardware or something is wonky.

Mirror function for VNC

I have a 10.3" 1872x1404 display. I'm able to get VNC working on it great, but I can't get VNC to mirror the image, so all the text is backwards.

Cannot start papertty.py, missing PIL error

On a clean June 27, Raspbian Stretch Lite install on a Pi Zero W 1.1, I followed your installation instructions.

I set up the virtualenv with:

mkvirtualenv -p /usr/bin/python3 -r requirements.txt papertty

which says (the second time I ran it to be sure, which is why they're already satisfied):

Installing setuptools, pkg_resources, pip, wheel...done.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: Pillow in /home/pi/.virtualenvs/papertty/lib/python3.5/site-packages (from -r requirements.txt (line 1)) (5.2.0)
Requirement already satisfied: RPi.GPIO in /home/pi/.virtualenvs/papertty/lib/python3.5/site-packages (from -r requirements.txt (line 2)) (0.6.3)
Requirement already satisfied: spidev in /home/pi/.virtualenvs/papertty/lib/python3.5/site-packages (from -r requirements.txt (line 3)) (3.2)
Requirement already satisfied: click in /home/pi/.virtualenvs/papertty/lib/python3.5/site-packages (from -r requirements.txt (line 4)) (6.7)

When I finally get into the PaperTTY virtualenv following the above, I receive the following when I run:

sudo ./papertty.py list

Traceback (most recent call last):
File "./papertty.py", line 14, in
import drivers.drivers_base as drivers_base
File "/home/pi/PaperTTY/drivers/drivers_base.py", line 18, in
from PIL import Image
ImportError: No module named 'PIL'

Any suggestions? This is a completely clean Pi Zero and I just imaged it from Raspbian.

Issue running terminal

Sorry if this is incredibly basic, but I've installed papertty on my raspberry pi 3 with a 9.7" waveshare epaper screen and it's been running quite well. I've gotten the VNC, image, etc... features running without issue. However, when trying to run terminal, it's outputting absolutely tiny font and in the wrong orientation (see this image: https://postimg.cc/QBtb0sCQ). I'm running Debian 10 (Buster) which may be part of the reason for the error. Per the dev updates on the front page, it looks like unicode support was incorporated for this particular OS. However, when I run papertty terminal it provides an error message about unicode being unsupported and defaulting to 8 bit, which may be part of the issue.

In addition to the tiny sideways text, it appears that the terminal on my papertty screen is not receiving input commands, as nothing I type is showing up.

Forgive me if this issue is extremely pedestrian. If it's been addressed elsewhere, just let me know. I'm not very familiar with programming for drivers, but I have some experience with python, so if this seems like an error of some kind that you could use help fixing, I wouldn't mind helping out if you could point me to where I can learn some about how all this works.

Thanks and this has been a wonderful project to stumble on to! I was worried I'd have to learn how to program an IT8951 driver for this bad boy myself, which probably would have required a great deal of time.

Reimplement and refactor the display driver code

The current drivers are essentially exactly the same as the reference drivers - they leave a lot to be desired:

  • the frame buffer handling / drawing / bit fiddling is done in an unnecessarily convoluted fashion - they could be made much simpler and more readable
  • the repetition in the display commands etc. is quite dull and redundant - many parts of the drivers could be reduced to more readable oneliners
  • there are confusing comments, non-pythonic code, varying naming schemes and code that makes one wonder if it works correctly or not
  • etc.

Having more knowledge of the particulars of these displays (and the actual hardware available for testing!) should yield a rewrite that is much simpler and nice to read.

Pull requests / issues are very welcome.

Clean up and organize README

The main README is too long. There's old but valid documentation way too far to be comfortably scrolled to because of meandering hit-and-run updates and not having the time to keep the docs concise and updated.

Some stuff to do:

  • VNC feature should be included in the command line instructions
    • VNC instructions could be a bit more thorough, too
  • Images are nice to have, but they could be clickable thumbnails in tables (or something) so they won't take most of the space
  • Clean up, fix historical remarks etc.

This would be easiest for me to do, but since it's so hard to get a proper moment to do it, I've created this issue to nag me. And if I never get around to it, maybe someone else with a knack for documentation will :)

Test IT8951 displays

Comment on this issue for your experiences with the IT8951 support.

Tested:

  • 6" - works
  • 6" HD - works
  • 7.8" - works
  • 9.7" - works
  • 10.3" - works

Flashing?

Hi there! General question:

Does the entire screen flash whenever something changes?

waveshare 2.13b (blk/wht/red) displays nothing but mostly red garbage.

Hi there!

firstly thanks for all the awesome work on this. I'm super excited to play with it.

It seems the 2.13b is different enough that the standardization of the driver seems to have sorta rendered it unfunctional.

I'll play around with it and see if I can't get something working, but figured I'd open an issue first before digging in.

Tested on Waveshare 2.7 inch epaper Pi Hat but issue with external Keyboard Input

Just tested on the Waveshare 2.7 Inch epaper Pi Hat (https://www.waveshare.com/wiki/2.7inch_e-Paper_HAT) and can confirm everything installed and that the terminal commands work when using ssh. The script to run at boot also works however I'm not able to use an external keyboard (screen remains static in the login prompt and all key presses are not reflected or refreshing). Was there anything that you e configured to allow usb keyboard inputs to show up on the mirrored terminal?

Beyond raspberry pi?

I'm guessing this is only feasible on the raspberry pi because Waveshare sell with hats - but is there any info/discussions/plans for using this on a generic box?

Trouble getting papertty to run

I have the 4.2 Waveshare display and I can run their python demo code fine. For papertty I have installed in a virtualenv as indicated in the readme. When I try the following command (from within the virtualenv)
papertty --driver EPD4in2 image --image test-img.bmp
, both as root or regular user, I get the following error:

Traceback (most recent call last):
  File "/home/pi/papertty_venv/bin/papertty", line 10, in <module>
    sys.exit(papertty.cli())
  File "/home/pi/papertty_venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/pi/papertty_venv/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/pi/papertty_venv/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pi/papertty_venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pi/papertty_venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/papertty_venv/lib/python3.7/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/home/pi/papertty_venv/lib/python3.7/site-packages/papertty/papertty.py", line 567, in image
    ptty = settings.get_init_tty()
  File "/home/pi/papertty_venv/lib/python3.7/site-packages/papertty/papertty.py", line 398, in get_init_tty
    tty = PaperTTY(**self.args)
  File "/home/pi/papertty_venv/lib/python3.7/site-packages/papertty/papertty.py", line 75, in __init__
    self.driver = get_drivers()[driver]['class']()
  File "/home/pi/papertty_venv/lib/python3.7/site-packages/papertty/drivers/drivers_4in2.py", line 72, in __init__
    super(drivers_partial.WavesharePartial, self).__init__(name='4.2"',
NameError: name 'drivers_partial' is not defined

Other attempts to run papertty produce similar errors.

ImportError: libtiff.so.5: cannot open shared object file: No such file or directory

I followed the install instructions to the letter on a fresh install, but on the first run of I got the following error:

(papertty) rroels@piz:~/PaperTTY $ sudo ~/.virtualenvs/papertty/bin/python3 ./papertty.py list
Traceback (most recent call last):
File "./papertty.py", line 14, in
import drivers.drivers_base as drivers_base
File "/home/rroels/PaperTTY/drivers/drivers_base.py", line 18, in
from PIL import Image
File "/home/rroels/.virtualenvs/papertty/lib/python3.7/site-packages/PIL/Image.py", line 93, in >
from . import _imaging as core
ImportError: libtiff.so.5: cannot open shared object file: No such file or directory

Luckily the solution is trivial:

sudo apt install libtiff5

Maybe this should be added to the install instructions?

SENSATIONAL WORK

My Pi Zero W with the same epaper display was also recently featured by hackday:
https://www.youtube.com/watch?v=1h0B2MWSVmQ
I've put the files on thingiverse.

I had the same idea as you, I wanted to display basic info about the system's state on the display, like wifi ssid / ip address and interact with it. I was really dreaming of having a terminal on it.
You made it happen! Can't wait to try it out at home!

BTW, the bigger Waveshare displays don't have partial refresh and it's really complicated to make them fast enough. There's a bigger display incl partial refresh from papirus:
https://uk.pi-supply.com/products/papirus-epaper-eink-screen-hat-for-raspberry-pi
I'm planning to design a bigger case for the Pi3 and that display, would love to see your terminal on that one, too.

Would be great to stay in touch!

Sudo with papertty?

EDIT: sudo is working now, not sure what I did

I am stuck. I try to use sudo and get an error...

sudo papertty --driver EPD4IN2 terminal
sudo: papertty: command not found

...and without....

papertty --driver EPD4IN2 terminal
Loading PIL font /home/pi/.local/lib/python3.7/site-packages/papertty/resources/tom-thumb.pil. Font size is ignored.
No read access to /dev/vcsa1 - maybe run with sudo?

.....any suggestions?

Multiple screen support?

Would this be in scope for this project? Hardware issues aside, I imagine straightforward configurations (e.g. 2x2 screens of the same size) would be pretty trivial to code. Of course, hardware would be the main problem and this isn't my area - does anyone have any ideas, or can link relevant discussions? Naively, it looks like only 8 pins are needed, and the Pi has more than that ... so maybe?

Rewards

Thanks for authoring this. You should add a "Buy me a coffee" or similar reward so people can show you some appreciation.

Refactor: OO, device support

For future reference:

  • Refactor code to have a class for the display and make the code overall more maintainable
  • Add support for all the displays, relevant repo: https://github.com/soonuse/epd-library-python
    • Code appears to be MIT licensed?
  • If the device doesn't support partial refresh, allow using it with full refreshes
  • Make it easy to replace the drawing method in order to support other types of displays

Create PyPi package

It would be very nice if it was possible to simplify the installation of PaperTTY to just pip install papertty. Any help with achieving this is appreciated.

Replace PIL with Pillow

This issue is for future reference.

@cclauss outlined some steps to replace the imaging library with Pillow in #2 (comment).

Currently there's some wrinkles in going for it because the Waveshare library uses PIL. There are forks around already.

Scrub command error with EPD 2.7" (monochrome)

Hi, thank you very much for the code, this is really great work.
It's my first post in Github in my life, but it seems I've found error, so just made account of Github.
I'm not good at programming, so posting this with hoping this is right manner...

I'm using EPD 2.7" (monochrome) of waveshare,
and tried command
sudo ./papertty.py --driver epd2in7 scrub

but got error (text file attached) hope this can be useful.
error.txt

by the way I have EPD1.54" also, and command worked for this display.

Add config file

Add support for reading a configuration file to simplify usage.

Write tests

Now that there's more than enough features, should also add proper tests.

Support waveshare 9.7in display

Hi,

I acquired an 9.7 inch e-ink display which, according to the waveshare, supports partial refresh. I've used their example code for full refreshes, but did not yet find out how to do a partial refresh - the displays refreshes partially, but doesn't display new text in the refreshed area - yet ;)

I'd be very interesting in working on PaperTTY support for this display, but I am new to e-ink displays in general and the 9.7in model seems to work quite differently compared to the smaller models. It uses a IT8951 controller. As far as I understand, I'd need the LUT values for PaperTTY? They seem to be stored in the hat, at least I haven't found them in the demo code yet. And information on the public internet seems sparse.

Anyone else interested in this?

More Infos on the official Wiki page: https://www.waveshare.com/wiki/9.7inch_e-Paper_HAT, the chinese version has a bit more info and code: http://www.waveshare.net/wiki/9.7inch_e-Paper_HAT

Implement pseudo-terminal

Instead of reading /dev/vcsa*, allocate a pseudo TTY.

A big problem with the VT buffer is that the original unicode value is lost.

Having an option to use a pty should:

  • make the encoding issues easier to handle
  • enables the use of more symbols, block characters, languages etc.
  • allow to have an arbitrarily sized terminal, instead of ioctl complaining - currently some of the display/font combinations are such that not all of the panel can be utilized optimally

Replace prints with Logging

Low priority, since journalctl can show the service stdout and there's not much output anyway, but when running as a service (or debugging), being able to configure the logging level might be a nice feature to have, and simple to implement.

Scrub does not accept size of 32

Scrub states that you can specify a size between 8 and 32. It won't accept 32 but then tells you it must be 8-32.

pi@raspberrypi:~/PaperTTY $ sudo ./papertty.py --driver epd2in13 scrub --size 32 Invalid stripe size, must be 8-32

Font size ignored for terminal

I'm running the Waveshare 4.2 display and the epd4in2 display driver. stdin is not responsive, but the terminal option works. However, any setting for the --font argument does nothing. I'm running on a Raspberry Pi 3, Raspbian, and running directly without virtualenv. What other info do you need for a diagnosis?

Add documentation on pypy use

Just though I'd share my notes here on how to use pypy with papertty. I'm working on a 4in2 display with a pi zero and am trying to improve performance. Not sure yet if pypy helps, but here's a short how-to:

sudo apt install pypy3 pypy3-devel libjpeg-dev zlib1g-dev wiringpi virtualenv
virtualenv --python=/usr/bin/pypy3 papertty_venv_pypy
. papertty_venv_pypy/bin/activate
pip3 install papertty

For fonts:
sudo apt install ttf-mscorefonts-installer
and to see what's provided:
ls /usr/share/fonts/truetype/msttcorefonts

And in my start.sh, I use:

. /home/pi/papertty_venv_pypy/bin/activate
papertty --driver EPD4in2 terminal --size 11 --autofit --font /usr/share/fonts/truetype/msttcorefonts/cour.ttf --portrait

Also, thanks everyone who has contributed to this tool. This is super cool stuff. :D

Partial refresh seems broken on rpi hat 2.13" v2

I've just bought a pi Zero W and a 2.13" waveshare hat, looking forward to make a little distraction free word processor. I've managed to set almost all up, but oddly, using the driver for v2 I can only understand what is shown on the console when I launch a command with --nopartial. Otherwise, the screen only renders noise, or perhaps only some pixels become active.

I could still manage to use the device as intentded, as I want it to be sort of a reference of what I'm writing, and I don't think I'll be editing anything, but the full flashing is a bit annoying and the screen is supposed to be capable of partial refreshing.

Also, it is very likely that I am doin something wrong.

ERROR: Failed building wheel for Pillow

ERROR: Failed building wheel for Pillow

plz help me to solve this....

`pi@raspberrypi:~/PaperTTY $ mkvirtualenv -p /usr/bin/python3 -r requirements.txt papertty
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/pi/.virtualenvs/papertty/bin/python3
Also creating executable in /home/pi/.virtualenvs/papertty/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting Pillow
Downloading https://files.pythonhosted.org/packages/5b/bb/cdc8086db1f15d0664dd22a62c69613cdc00f1dd430b5b19df1bea83f2a3/Pillow-6.2.1.tar.gz (37.7MB)
|████████████████████████████████| 37.7MB 3.5kB/s
Collecting RPi.GPIO
Downloading https://www.piwheels.org/simple/rpi-gpio/RPi.GPIO-0.7.0-cp35-cp35m-linux_armv6l.whl (67kB)
|████████████████████████████████| 71kB 162kB/s
Collecting spidev
Downloading https://www.piwheels.org/simple/spidev/spidev-3.4-cp35-cp35m-linux_armv6l.whl
Collecting click
Downloading https://www.piwheels.org/simple/click/Click-7.0-py2.py3-none-any.whl (81kB)
|████████████████████████████████| 81kB 128kB/s
Collecting vncdotool
Downloading https://www.piwheels.org/simple/vncdotool/vncdotool-0.13.0-py3-none-any.whl
Collecting Twisted
Downloading https://www.piwheels.org/simple/twisted/Twisted-19.10.0-cp35-cp35m-linux_armv6l.whl (3.1MB)
|████████████████████████████████| 3.1MB 72kB/s
Collecting Automat>=0.3.0
Downloading https://files.pythonhosted.org/packages/e5/11/756922e977bb296a79ccf38e8d45cafee446733157d59bcd751d3aee57f5/Automat-0.8.0-py2.py3-none-any.whl
Collecting constantly>=15.1
Downloading https://files.pythonhosted.org/packages/b9/65/48c1909d0c0aeae6c10213340ce682db01b48ea900a7d9fce7a7910ff318/constantly-15.1.0-py2.py3-none-any.whl
Collecting hyperlink>=17.1.1
Downloading https://files.pythonhosted.org/packages/7f/91/e916ca10a2de1cb7101a9b24da546fb90ee14629e23160086cf3361c4fb8/hyperlink-19.0.0-py2.py3-none-any.whl
Collecting zope.interface>=4.4.2
Downloading https://www.piwheels.org/simple/zope-interface/zope.interface-4.7.1-cp35-cp35m-linux_armv6l.whl (163kB)
|████████████████████████████████| 163kB 7.1kB/s
Collecting PyHamcrest>=1.9.0
Downloading https://www.piwheels.org/simple/pyhamcrest/PyHamcrest-1.9.0-py2.py3-none-any.whl (52kB)
|████████████████████████████████| 61kB 32kB/s
Collecting attrs>=17.4.0
Downloading https://www.piwheels.org/simple/attrs/attrs-19.3.0-py2.py3-none-any.whl
Collecting incremental>=16.10.1
Downloading https://files.pythonhosted.org/packages/f5/1d/c98a587dc06e107115cf4a58b49de20b19222c83d75335a192052af4c4b7/incremental-17.5.0-py2.py3-none-any.whl
Collecting six
Downloading https://www.piwheels.org/simple/six/six-1.13.0-py2.py3-none-any.whl
Collecting idna>=2.5
Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
|████████████████████████████████| 61kB 235kB/s
Requirement already satisfied: setuptools in /home/pi/.virtualenvs/papertty/lib/python3.5/site-packages (from zope.interface>=4.4.2->Twisted->vncdotool->-r requirements.txt (line 5)) (41.6.0)
Building wheels for collected packages: Pillow
Building wheel for Pillow (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/pi/.virtualenvs/papertty/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cz_wrs2v/Pillow/setup.py'"'"'; file='"'"'/tmp/pip-install-cz_wrs2v/Pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-c7l05ek4 --python-tag cp35
cwd: /tmp/pip-install-cz_wrs2v/Pillow/
Complete output (172 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv6l-3.5
creating build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageQt.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/TiffImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageDraw.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PcdImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ContainerIO.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/IptcImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/_tkinter_finder.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageOps.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PcxImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GbrImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/EpsImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GimpGradientFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/init.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/FpxImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/SunImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/MspImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageShow.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ExifTags.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageChops.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/features.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PdfImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageMode.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageGrab.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/TiffTags.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImagePath.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/_binary.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/XbmImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/FliImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageDraw2.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PixarImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/FtexImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImagePalette.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/WalImageFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageStat.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GdImageFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PyAccess.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/CurImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/DcxImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/SgiImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/JpegImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GifImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/_util.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/MpegImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/TarIO.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PaletteFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/BdfFontFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageFilter.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GimpPaletteFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/main.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/XpmImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PalmImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PcfFontFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/WmfImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/JpegPresets.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/MpoImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageMorph.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageEnhance.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PpmImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageColor.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageFont.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/_version.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/WebPImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PdfParser.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageWin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageTransform.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PSDraw.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageTk.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/DdsImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageMath.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/MicImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/IcoImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageSequence.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImtImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/Image.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageCms.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/TgaImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PngImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/FontFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PsdImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/BlpImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/BmpImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
running egg_info
writing top-level names to src/Pillow.egg-info/top_level.txt
writing src/Pillow.egg-info/PKG-INFO
writing dependency_links to src/Pillow.egg-info/dependency_links.txt
reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.c'
warning: no files found matching '
.h'
warning: no files found matching '.sh'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.codecov.yml'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'azure-pipelines.yml'
warning: no previously-included files matching '.git
' found anywhere in distribution
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '
.so' found anywhere in distribution
no previously-included directories found matching '.azure-pipelines'
no previously-included directories found matching '.travis'
writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
running build_ext

The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html

Traceback (most recent call last):
File "/tmp/pip-install-cz_wrs2v/Pillow/setup.py", line 888, in
zip_safe=not (debug_build() or PLATFORM_MINGW),
File "/home/pi/.virtualenvs/papertty/lib/python3.5/site-packages/setuptools/init.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/pi/.virtualenvs/papertty/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 192, in run
self.run_command('build')
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.5/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/tmp/pip-install-cz_wrs2v/Pillow/setup.py", line 687, in build_extensions
raise RequiredDependencyException(f)
main.RequiredDependencyException: jpeg

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-cz_wrs2v/Pillow/setup.py", line 903, in
raise RequiredDependencyException(msg)
main.RequiredDependencyException:

The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html


ERROR: Failed building wheel for Pillow
Running setup.py clean for Pillow
Failed to build Pillow
Installing collected packages: Pillow, RPi.GPIO, spidev, click, attrs, six, Automat, constantly, idna, hyperlink, zope.interface, PyHamcrest, incremental, Twisted, vncdotool
Running setup.py install for Pillow ... error
ERROR: Command errored out with exit status 1:
command: /home/pi/.virtualenvs/papertty/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cz_wrs2v/Pillow/setup.py'"'"'; file='"'"'/tmp/pip-install-cz_wrs2v/Pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-161nk5do/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/.virtualenvs/papertty/include/site/python3.5/Pillow
cwd: /tmp/pip-install-cz_wrs2v/Pillow/
Complete output (174 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-armv6l-3.5
creating build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageQt.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/TiffImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageDraw.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PcdImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ContainerIO.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/IptcImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/_tkinter_finder.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageOps.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PcxImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GbrImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/EpsImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GimpGradientFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/init.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/FpxImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/SunImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/MspImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageShow.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ExifTags.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageChops.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/features.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PdfImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageMode.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageGrab.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/TiffTags.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImagePath.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/_binary.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/XbmImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/FliImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageDraw2.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PixarImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/FtexImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImagePalette.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/WalImageFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageStat.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GdImageFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PyAccess.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/CurImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/DcxImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/SgiImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/JpegImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GifImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/_util.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/MpegImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/TarIO.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PaletteFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/BdfFontFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageFilter.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GimpPaletteFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/main.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/XpmImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PalmImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PcfFontFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/WmfImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/JpegPresets.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/MpoImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageMorph.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageEnhance.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PpmImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageColor.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageFont.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/_version.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/WebPImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PdfParser.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageWin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageTransform.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PSDraw.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageTk.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/DdsImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageMath.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/MicImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/IcoImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageSequence.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImtImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/Image.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/ImageCms.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/TgaImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PngImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/FontFile.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/PsdImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/BlpImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
copying src/PIL/BmpImagePlugin.py -> build/lib.linux-armv6l-3.5/PIL
running egg_info
writing src/Pillow.egg-info/PKG-INFO
writing top-level names to src/Pillow.egg-info/top_level.txt
writing dependency_links to src/Pillow.egg-info/dependency_links.txt
reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.c'
warning: no files found matching '
.h'
warning: no files found matching '.sh'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.codecov.yml'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'azure-pipelines.yml'
warning: no previously-included files matching '.git
' found anywhere in distribution
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '
.so' found anywhere in distribution
no previously-included directories found matching '.azure-pipelines'
no previously-included directories found matching '.travis'
writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
running build_ext

The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html

Traceback (most recent call last):
  File "/tmp/pip-install-cz_wrs2v/Pillow/setup.py", line 888, in <module>
    zip_safe=not (debug_build() or PLATFORM_MINGW),
  File "/home/pi/.virtualenvs/papertty/lib/python3.5/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/pi/.virtualenvs/papertty/lib/python3.5/site-packages/setuptools/command/install.py", line 61, in run
    return orig.install.run(self)
  File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run
    self.run_command('build')
  File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.5/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.5/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/tmp/pip-install-cz_wrs2v/Pillow/setup.py", line 687, in build_extensions
    raise RequiredDependencyException(f)
__main__.RequiredDependencyException: jpeg

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-cz_wrs2v/Pillow/setup.py", line 903, in <module>
    raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:

The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html


----------------------------------------

ERROR: Command errored out with exit status 1: /home/pi/.virtualenvs/papertty/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cz_wrs2v/Pillow/setup.py'"'"'; file='"'"'/tmp/pip-install-cz_wrs2v/Pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-161nk5do/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/.virtualenvs/papertty/include/site/python3.5/Pillow Check the logs for full command output.
(papertty) pi@raspberrypi:/PaperTTY $ ^C
(papertty) pi@raspberrypi:
/PaperTTY $ dir
`

4.2 inch display doesn't work

I have a Pi 3 B+ system where I've been successfully using a 2.9 inch display. I ordered a monochrome 4.2 inch display, which arrived today. I connected it up and changed it from epd2in9 to epd4in2 in start.sh so I would get console on it on boot but nothing happened (not even the scrub).

My start.sh's command line is:

${VENV} papertty.py --driver epd4in2 terminal --font /usr/share/fonts/truetype/msttcorefonts/Andale_Mono.ttf --size 12 --scrub --autofit

I investigated by stopping the service and then trying to run a scrub by hand with:

sudo ./papertty.py --driver epd4in2 scrub

and I get the following error:

~/PaperTTY $ sudo ./papertty.py --driver epd4in2 scrubTraceback (most recent call last):
  File "./papertty.py", line 443, in <module>
    cli()
  File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "./papertty.py", line 310, in scrub
    ptty.driver.scrub(fillsize=size)
  File "/home/pi/PaperTTY/drivers/drivers_base.py", line 53, in scrub
    self.fill(self.black, fillsize=fillsize)
  File "/home/pi/PaperTTY/drivers/drivers_base.py", line 60, in fill
    self.draw(x, 0, image)
  File "/home/pi/PaperTTY/drivers/drivers_full.py", line 66, in draw
    self.display_frame(self.get_frame_buffer(image))
  File "/home/pi/PaperTTY/drivers/drivers_full.py", line 76, in get_frame_buffer
    ({0}x{1}).'.format(self.width, self.height))
ValueError: Image must be same dimensions as display                 (400x300).

I don't think I am doing anything obviously wrong and this worked on the 2.9 on the same Raspberry Pi.

Feature(?) Draw images when using the terminal

Basic idea: With a regular TFT screen, you can be using the terminal, and then use fbi to view images on the TFT. If you quit, then it sends you back to the terminal.

I'm not sure if there's a way to do that with the existing codebase. I didn't find anything, and it appears that trying to write to the SPI/launch a second papertty process to draw an image just fails because the device is busy.

One imaginary approach is that the papertty process has some way of providing information, whether that's using inotify, or sending information via a port, or ???

I'm not sure exactly what process things currently use, but it would be really neat if that were a possibility.

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.