View Single Post
Old 12-14-2022, 08:22 PM   #18
elinkser
Addict
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 242
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
***SECURITY REMINDER***
DO NOT ACTUALLY DO THE FOLLOWING ON A PHONE THAT YOU DO BANKING WITH!
E.G.IF YOU HAD TELNET SERVER RUNNING OR OTHER UNKNOWN VULNERABILITY ON YOUR KOBO, THE VNC GIVES AN INTRUDER ACCESS TO YOUR PHONE VIA YOUR KOBO.
USE A DUMMY PHONE OR TABLET TO PLAY WITH.


***

I neglected to mention that vnc is inherently insecure.
http://www.mit.edu/~avp/lqcd/ssh-vnc.html

So even if you try to never connect your Kobo to insecure networks, hosts, USB devices, etc., your host vnc server you are connecting to is still a security vulnerability. I would not use this host for anything critical. I would set a firewall and have the vnc server be read-only.



***END SECURITY REMINDER***


* UPDATE: droidVNC-NG has a sliding scale that sets the size of the window that will appear on your Kobo (you have to stop the server to adjust it).
Note that if you set the slider too far to the right, einkvnc won't display.
I set the slider 70% of the way over for my Clara.
The vnc client view on the Kobo is in portrait orientation, even if you rotate the Kobo display, so if your Android rotation is landscape, you have to slide the scale even more to the left and everything will be tiny!

Conveniently, droidVNC-NG (the android VNC server from f-droid) almost always seems to present me with the same server address each time I've run it.
*But check, because every once in a while it changes, and you will be spinning your wheels if you don't catch it.

So I can access it handily from the nickel menu:

menu_item :main :Einkvnc :cmd_spawn :quiet:exec /mnt/onboard/opt/einkvnc 192.168.43.1 5900 --password mypassword --contrast 2
chain_success :dbg_toast :Started einkvnc 192.168.43.1 5900
chain_failure :dbg_toast :Error


** Actually....that was only true while using a third device as the hotspot server. Now that I've been using the droidVNC-NG server device as the hotspot server too, the vnc server address seems to change EVERY time! Not so handy for the nickel menu. But since you are already networked with the Kobo, it is no biggie to run the einkvnc command in a ConnectBot telnet client app running on the droidVNC-NG server device.

***SECURITY REMINDER***
Telnet sessions are in cleartext INCLUDING LOGIN SESSIONS, so only use on a private network, if at all!
If you always have DEVMODE set to ON for whatever reasons , that means Telnet is on by default, unless you toggle it off , e.g. using NickelMenu.

You can install KOReader to get the more secure SSH option, and NiLuJe's kobostuff provides a package that includes an SSH binary.

You can start the KOReader SSH server via NickelMenu.


**********************************

***UPDATE*** See post #20, two posts down, to see how NickelDBus fixes our problem!

It's a pretty cool way to browse in eink on a Clara HD while controlling by inputting on my tablet.
HOWEVER...Consider the security implications of accessing a secure device (phone that you do banking/email on) from an insecure device i.e. ereader.

You may try setting ForceWifiOn=true (if you haven't done so already) in your config file [DeveloperSettings] (in KOReader, navigate to .kobo/Kobo/Kobo eReader.conf, Open With Text editor) or else the dropouts may cause frustration.


I have found that none of my Android devices need to be internet-connected to set up as a hotspot so the Kobo can network with my tablet or keyboard-equipped Blackberry Priv with no internet!
*Note:The open source droidVNC-NG vnc server requires minimum Android 7 so the Priv is a no-go, being locked at 6, although it can run ConnectBot, and closed source vnc server Alpha Vnc Lite.

Unfortunately einkvnc does only fill about 3/4 of the Kobo Clara HD display.

It would be great if I could change some parameter to make it fill the whole display. I tried building with changed resolution/dpi but no luck!


***ADDITIONAL DEBUGGING***

We see the ClaraHD display size from "eink-vnc-main/client/src/device.rs":
"nova" => Device {
model: Model::ClaraHD,
proto: TouchProto::MultiB,
dims: (1072, 1448),
dpi: 300,
},


We can get logging info using the "RUST_LOG=info" setting when invoking einkvnc:
http://rust-lang-nursery.github.io/log/env_logger/


So if we try invoking the einkvnc vnc client(from a remote Telnet terminal) at three different scaling settings of the droidVNC-NG vncserver running on the android tablet, we get the following results:

Spoiler:

(droidVNC-NG vnc server scaling @ 70%)
# RUST_LOG=info ./einkvnc 192.168.43.185 5900 --password mypw --contrast 2
[2023-04-09T18:11:33Z INFO einkvnc] connecting to 192.168.43.185:5900
[2023-04-09T18:11:34Z INFO einkvnc] connected to "Nexus 7", 864x1344 framebuffer
[2023-04-09T18:11:34Z INFO einkvnc] received PixelFormat { bits_per_pixel: 32, depth: 32, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 0, green_shift: 8, blue_shift: 16 }
[2023-04-09T18:11:35Z INFO einkvnc] enforced PixelFormat { bits_per_pixel: 8, depth: 16, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 16, green_shift: 8, blue_shift: 0 }
Framebuffer rotation: 1 -> 1.
[2023-04-09T18:11:35Z INFO einkvnc] Missed frame, excess Δt: 54ms
[2023-04-09T18:11:36Z INFO einkvnc] Missed frame, excess Δt: 70ms
...

(droidVNC-NG vnc server scaling @ 80%)
# RUST_LOG=info ./einkvnc 192.168.43.185 5900 --password mypw --contrast 2
[2023-04-09T18:19:00Z INFO einkvnc] connecting to 192.168.43.185:5900
[2023-04-09T18:19:01Z INFO einkvnc] connected to "Nexus 7", 1152x1536 framebuffer
[2023-04-09T18:19:01Z INFO einkvnc] received PixelFormat { bits_per_pixel: 32, depth: 32, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 0, green_shift: 8, blue_shift: 16 }
[2023-04-09T18:19:02Z INFO einkvnc] enforced PixelFormat { bits_per_pixel: 8, depth: 16, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 16, green_shift: 8, blue_shift: 0 }
Framebuffer rotation: 1 -> 1.
[2023-04-09T18:19:03Z INFO einkvnc] Missed frame, excess Δt: 184ms
[2023-04-09T18:19:11Z INFO einkvnc] Missed frame, excess Δt: 175ms
...

(droidVNC-NG vnc server scaling @ 90%)
# RUST_LOG=info ./einkvnc 192.168.43.185 5900 --password mypw --contrast 2
[2023-04-09T18:26:44Z INFO einkvnc] connecting to 192.168.43.185:5900
[2023-04-09T18:26:45Z INFO einkvnc] connected to "Nexus 7", 1152x1728 framebuffer
[2023-04-09T18:26:45Z INFO einkvnc] received PixelFormat { bits_per_pixel: 32, depth: 32, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 0, green_shift: 8, blue_shift: 16 }
[2023-04-09T18:26:47Z INFO einkvnc] enforced PixelFormat { bits_per_pixel: 8, depth: 16, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 16, green_shift: 8, blue_shift: 0 }
Framebuffer rotation: 1 -> 1.
Bus error


Now try the "RUST_LOG=debug" setting for a little more detailed info at the 70% and 75% server scaling settings:

(droidVNC-NG vnc server scaling @ 70%)
# RUST_LOG=debug ./einkvnc 192.168.43.5 5900 --password mypw --contrast 2
[2023-04-10T21:03:42Z INFO einkvnc] connecting to 192.168.43.5:5900
[2023-04-10T21:03:42Z DEBUG einkvnc::vnc::client] <- Version::Rfb38
[2023-04-10T21:03:42Z DEBUG einkvnc::vnc::client] -> Version::Rfb38
[2023-04-10T21:03:42Z DEBUG einkvnc::vnc::client] <- SecurityTypes([VncAuthentication, Unknown(16)])
[2023-04-10T21:03:42Z DEBUG einkvnc] available authentication methods: [Password]
[2023-04-10T21:03:42Z DEBUG einkvnc::vnc::client] -> SecurityType::VncAuthentication
[2023-04-10T21:03:42Z DEBUG einkvnc::vnc::client] -> ClientInit { shared: true }
[2023-04-10T21:03:42Z DEBUG einkvnc::vnc::client] <- ServerInit { framebuffer_width: 864, framebuffer_height: 1344, pixel_format: PixelFormat { bits_per_pixel: 32, depth: 32, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 0, green_shift: 8, blue_shift: 16 }, name: "Nexus 7" }
[2023-04-10T21:03:42Z INFO einkvnc] connected to "Nexus 7", 864x1344 framebuffer
[2023-04-10T21:03:42Z INFO einkvnc] received PixelFormat { bits_per_pixel: 32, depth: 32, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 0, green_shift: 8, blue_shift: 16 }
[2023-04-10T21:03:42Z DEBUG einkvnc::vnc::client] 0
[2023-04-10T21:03:42Z DEBUG einkvnc::vnc::client] 01
[2023-04-10T21:03:42Z DEBUG einkvnc::vnc::client] 02
[2023-04-10T21:03:42Z DEBUG einkvnc::vnc::client] <- FramebufferUpdate { count: 1 }
[2023-04-10T21:03:42Z DEBUG einkvnc::vnc::client] <- Rectangle { x_position: 0, y_position: 0, width: 864, height: 1344, encoding: Raw }
[2023-04-10T21:03:43Z DEBUG einkvnc::vnc::client] <- ...pixels
[2023-04-10T21:03:43Z DEBUG einkvnc::vnc::client] 1
[2023-04-10T21:03:43Z DEBUG einkvnc::vnc::client] -> SetPixelFormat(PixelFormat { bits_per_pixel: 8, depth: 16, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 16, green_shift: 8, blue_shift: 0 })
[2023-04-10T21:03:43Z DEBUG einkvnc::vnc::client] 2
[2023-04-10T21:03:43Z DEBUG einkvnc::vnc::client] 3
[2023-04-10T21:03:43Z INFO einkvnc] enforced PixelFormat { bits_per_pixel: 8, depth: 16, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 16, green_shift: 8, blue_shift: 0 }
[2023-04-10T21:03:43Z DEBUG einkvnc::vnc::client] -> SetEncodings([CopyRect, Zrle])
Framebuffer rotation: 1 -> 1.
[2023-04-10T21:03:43Z DEBUG einkvnc] End of frame!
[2023-04-10T21:03:44Z DEBUG einkvnc::vnc::client] <- FramebufferUpdate { count: 1 }
[2023-04-10T21:03:44Z DEBUG einkvnc::vnc::client] <- Rectangle { x_position: 0, y_position: 0, width: 864, height: 1344, encoding: Zrle }
[2023-04-10T21:03:44Z DEBUG einkvnc::vnc::client] <- ...compressed pixels
[2023-04-10T21:03:44Z DEBUG einkvnc] Put pixels
[2023-04-10T21:03:44Z DEBUG einkvnc] network Δt: 0
[2023-04-10T21:03:44Z DEBUG einkvnc] postproc Δt: 0
[2023-04-10T21:03:44Z DEBUG einkvnc] draw Δt: 0
[2023-04-10T21:03:44Z DEBUG einkvnc] rects Δt: 0
...
[2023-04-10T21:07:28Z DEBUG einkvnc] Put pixels
[2023-04-10T21:07:28Z DEBUG einkvnc] network Δt: 1000
[2023-04-10T21:07:28Z DEBUG einkvnc] postproc Δt: 1001
[2023-04-10T21:07:28Z DEBUG einkvnc] draw Δt: 1001
[2023-04-10T21:07:28Z DEBUG einkvnc] rects Δt: 1001
[2023-04-10T21:07:28Z DEBUG einkvnc] End of frame!
[2023-04-10T21:07:28Z DEBUG einkvnc] Updating dirty rect Rectangle { min: Point { x: 0, y: 0 }, max: Point { x: 864, y: 1344 } }
...


(droidVNC-NG vnc server scaling @ 75%)
# RUST_LOG=debug ./einkvnc 192.168.43.5 5900 --password mypw --contrast 2
[2023-04-10T21:11:06Z INFO einkvnc] connecting to 192.168.43.5:5900
[2023-04-10T21:11:06Z DEBUG einkvnc::vnc::client] <- Version::Rfb38
[2023-04-10T21:11:06Z DEBUG einkvnc::vnc::client] -> Version::Rfb38
[2023-04-10T21:11:06Z DEBUG einkvnc::vnc::client] <- SecurityTypes([VncAuthentication, Unknown(16)])
[2023-04-10T21:11:06Z DEBUG einkvnc] available authentication methods: [Password]
[2023-04-10T21:11:06Z DEBUG einkvnc::vnc::client] -> SecurityType::VncAuthentication
[2023-04-10T21:11:06Z DEBUG einkvnc::vnc::client] -> ClientInit { shared: true }
[2023-04-10T21:11:06Z DEBUG einkvnc::vnc::client] <- ServerInit { framebuffer_width: 1152, framebuffer_height: 1440, pixel_format: PixelFormat { bits_per_pixel: 32, depth: 32, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 0, green_shift: 8, blue_shift: 16 }, name: "Nexus 7" }
[2023-04-10T21:11:06Z INFO einkvnc] connected to "Nexus 7", 1152x1440 framebuffer
[2023-04-10T21:11:06Z INFO einkvnc] received PixelFormat { bits_per_pixel: 32, depth: 32, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 0, green_shift: 8, blue_shift: 16 }
[2023-04-10T21:11:06Z DEBUG einkvnc::vnc::client] 0
[2023-04-10T21:11:06Z DEBUG einkvnc::vnc::client] 01
[2023-04-10T21:11:06Z DEBUG einkvnc::vnc::client] 02
[2023-04-10T21:11:06Z DEBUG einkvnc::vnc::client] <- FramebufferUpdate { count: 1 }
[2023-04-10T21:11:06Z DEBUG einkvnc::vnc::client] <- Rectangle { x_position: 0, y_position: 0, width: 1152, height: 1440, encoding: Raw }
[2023-04-10T21:11:08Z DEBUG einkvnc::vnc::client] <- ...pixels
[2023-04-10T21:11:08Z DEBUG einkvnc::vnc::client] 1
[2023-04-10T21:11:08Z DEBUG einkvnc::vnc::client] -> SetPixelFormat(PixelFormat { bits_per_pixel: 8, depth: 16, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 16, green_shift: 8, blue_shift: 0 })
[2023-04-10T21:11:08Z DEBUG einkvnc::vnc::client] 2
[2023-04-10T21:11:08Z DEBUG einkvnc::vnc::client] 3
[2023-04-10T21:11:08Z INFO einkvnc] enforced PixelFormat { bits_per_pixel: 8, depth: 16, big_endian: false, true_colour: true, red_max: 255, green_max: 255, blue_max: 255, red_shift: 16, green_shift: 8, blue_shift: 0 }
[2023-04-10T21:11:08Z DEBUG einkvnc::vnc::client] -> SetEncodings([CopyRect, Zrle])
Framebuffer rotation: 1 -> 1.
[2023-04-10T21:11:08Z DEBUG einkvnc] End of frame!
[2023-04-10T21:11:08Z DEBUG einkvnc::vnc::client] <- FramebufferUpdate { count: 1 }
[2023-04-10T21:11:08Z DEBUG einkvnc::vnc::client] <- Rectangle { x_position: 0, y_position: 0, width: 1152, height: 1440, encoding: Zrle }
[2023-04-10T21:11:08Z DEBUG einkvnc::vnc::client] <- ...compressed pixels
[2023-04-10T21:11:08Z DEBUG einkvnc] Put pixels
[2023-04-10T21:11:08Z DEBUG einkvnc] network Δt: 0
[2023-04-10T21:11:08Z DEBUG einkvnc] postproc Δt: 0
[2023-04-10T21:11:08Z DEBUG einkvnc] draw Δt: 0
[2023-04-10T21:11:08Z DEBUG einkvnc] rects Δt: 0
...
[2023-04-10T21:31:09Z DEBUG einkvnc] Put pixels
[2023-04-10T21:31:09Z DEBUG einkvnc] network Δt: 1365
[2023-04-10T21:31:09Z DEBUG einkvnc] postproc Δt: 1365
[2023-04-10T21:31:09Z DEBUG einkvnc] draw Δt: 1365
[2023-04-10T21:31:09Z DEBUG einkvnc] rects Δt: 1365
[2023-04-10T21:31:09Z DEBUG einkvnc] End of frame!
[2023-04-10T21:31:09Z DEBUG einkvnc] Updating dirty rect Rectangle { min: Point { x: 0, y: 0 }, max: Point { x: 1152, y: 1440 } }
[2023-04-10T21:31:09Z INFO einkvnc] Missed frame, excess Δt: 1341ms
...







Although the einkvnc client debug messages indicate drawing to the screen at the 75% scaling, the display does not actually get updated. Note that the droidVNC-NG "75%" scaling sets the x-dimension to 1152, which is beyond the 1072 x-dimension of the Clara, unlike the 864 x-dimension of the droidVNC-NG "70%" scaling.


Of the four server scaling settings tested, only the 70% setting yields a framebuffer size (864x1344) that is within the limits of the ClaraHD display size (1072x1448).


I found by adjusting the android tablet's resolution in Display settings (or DPI/minimum width in Developer settings) I could make things bigger on the screen (less items fit on the screen, consequently more scrolling is required).

However, the vnc client window on the Clara continued to be the same size - still about three quarters of the display.


***

*EDIT:Looks like full screen vnc with touch input and landscape rotation is also available via chroot. Extra Clara HD config steps on post #46.

Last edited by elinkser; 11-02-2024 at 08:56 AM. Reason: debug with logging,vnc insecure,wording
elinkser is offline   Reply With Quote