New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work on non-interactive shell #32
Comments
Yeah, it's expecting to read from stdin when stdin is not a tty. You'll have to pass an empty string if you want a clear over a non-interactive shell. |
(I'm away for a week, so this is an AFAIR answer for now ;)). |
And just like that, you bring the idea to life :D |
Here's the code (I added c to clear the screen)
|
I'll take a closer look at it when I get back next week, because it
probably shouldn't hang with no input, at the very least ;)
…On Mon, Feb 25, 2019, 06:51 parkerlreed ***@***.***> wrote:
Here's the code (I addec c to clear the screen)
from tkinter import *
import paramiko
hostname = '192.168.86.125'
password = 'password'
username = 'root'
root = Tk()
def key(event):
stdin, stdout, stderr = ssh.exec_command("echo '' | fbink -c")
def onLeftDrag(event):
stdin, stdout, stderr = ssh.exec_command("echo '' | fbink -g file=/mnt/us/circle.png,x=" + str(event.x) + ",y=" + str(event.y) + " -x 0 -y 0")
frame = Frame(root, width=600, height=800)
ssh = paramiko.SSHClient()
ssh.load_system_host_keys()
ssh.connect(hostname, username=username, password=password)
stdin, stdout, stderr = ssh.exec_command("echo '' | fbink -c")
frame.focus_set()
frame.bind('<B1-Motion>', onLeftDrag)
frame.bind('<c>', key)
frame.pack()
root.mainloop()
ssh.close()
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#32 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAG1Zh5tgyJa2jaaYl3A0IvJu1qXp7x9ks5vQ3nrgaJpZM4bOEcA>
.
|
Note that you could also go with the Python bindings for this sort of stuff
;).
I'd even recommend using A2 updates for stuff like that to make it slightly
more reactive, but you currently can't with the image drawing API, I need
to tweak that to make it possible ;).
…On Mon, Feb 25, 2019, 12:11 NiLuJe ***@***.***> wrote:
I'll take a closer look at it when I get back next week, because it
probably shouldn't hang with no input, at the very least ;)
On Mon, Feb 25, 2019, 06:51 parkerlreed ***@***.***> wrote:
> Here's the code (I addec c to clear the screen)
>
> from tkinter import *
> import paramiko
>
> hostname = '192.168.86.125'
> password = 'password'
> username = 'root'
>
> root = Tk()
>
> def key(event):
> stdin, stdout, stderr = ssh.exec_command("echo '' | fbink -c")
>
> def onLeftDrag(event):
> stdin, stdout, stderr = ssh.exec_command("echo '' | fbink -g file=/mnt/us/circle.png,x=" + str(event.x) + ",y=" + str(event.y) + " -x 0 -y 0")
>
> frame = Frame(root, width=600, height=800)
> ssh = paramiko.SSHClient()
> ssh.load_system_host_keys()
> ssh.connect(hostname, username=username, password=password)
> stdin, stdout, stderr = ssh.exec_command("echo '' | fbink -c")
>
> frame.focus_set()
> frame.bind('<B1-Motion>', onLeftDrag)
> frame.bind('<c>', key)
> frame.pack()
>
> root.mainloop()
>
> ssh.close()
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#32 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAG1Zh5tgyJa2jaaYl3A0IvJu1qXp7x9ks5vQ3nrgaJpZM4bOEcA>
> .
>
|
Besides fixing #32, this also prevents piping stuff like tail -f to fbink, which I'm not a fan of, so I may be tweaking this...
Less side-effects. This only prohibits "follow" use-cases over non-interactive SSH sessions instead of everywhere.
Okay, the stdin / non-interactive SSH session issue should (mostly) be fixed. And I just added support for specifying a waveform mode when printing an image ;). That'll make it into 1.12.0, which I'll be releasing later tonight. Thanks! |
Fantastic, thanks for the confirmation ;). |
Mostly works but has some weird artifacting towards the top of the image |
I don't remember if there's a Otherwise, it's done via ioctl, cf. rota.c in utils ;). |
It may be weirder on the K4, because it's using a legacy einkfb shim, while actually being mxcfb under the hood... |
i.e., instead of/in addition to the standard Linux fb ioctl, there's the einkfb one here, which apparently matches what you did via procfs. I've never played with rotation on Kindle, as it's always been sane (i.e., origin at (0, 0) on the top-left) in my usual use cases ;). I can just say that the K4 may be quirkier than other Kindles in that respect, because of the einkfb-on-top-of-mxcfb thing (as it's essentially a Kindle Touch masquerading as a Kindle 3). |
I wouldn't even know how to mess rotation up, as I don't think the framework touches it, since I'm fairly sure I print stuff with the framework down during MRPI sessions... |
It fails to clear the screen and hangs at the end (leaving the connection open)
Works fine when in interactive. Kindle 4 non-touch
The text was updated successfully, but these errors were encountered: