Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 06-25-2017, 09:45 AM   #76
phoenix512
Enthusiast
phoenix512 began at the beginning.
 
phoenix512's Avatar
 
Posts: 45
Karma: 10
Join Date: Feb 2014
Device: kindle PW2
Quote:
Originally Posted by encol View Post
There is a README in the archive.
Read it.
Then:
1) extract the archive on your kindle
2) install KTerm
3) open it from KUAL
4) cd <folder_where_you_extracted_the_archive>
5) ./luajit vncviewer.lua <ip_of_your_vnc_server>:<port_of_your_server>
Thank you very much. you solved the problem for me. I launched the vncviewer in kterm. It can successfully connect with TightVNC server. However, It seems that I have a scaling problem. Not all the screen fits into kindle. In fact, part of the bottom and right part of the screen is cropped. I tried to change client_width and height in the file config.lua but nothing changed. Also, I set the screen resolution in server configuration.
What can I do for this?
phoenix512 is offline   Reply With Quote
Old 06-25-2017, 04:38 PM   #77
encol
Evangelist
encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
try to add -rotateFB 90 parameter
encol is offline   Reply With Quote
Old 06-26-2017, 05:06 AM   #78
phoenix512
Enthusiast
phoenix512 began at the beginning.
 
phoenix512's Avatar
 
Posts: 45
Karma: 10
Join Date: Feb 2014
Device: kindle PW2
Quote:
Originally Posted by encol View Post
try to add -rotateFB 90 parameter
Thanks for your help but adding this option just rotates the screen to portrait. The screen connects in landscape as default. My monitor is 1920*1080.
I tried to use:
./luajit vncviewer.lua -scale 2(and 0.5) 192.168.1.5:5900
but it didn't change anything
phoenix512 is offline   Reply With Quote
Old 02-22-2018, 02:55 AM   #79
a00tkh
Junior Member
a00tkh began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2018
Device: Kindle paperwhite gen1, Sony DPT-S1, reMarkable Tablet
Question

Quote:
Originally Posted by encol View Post
There is a README in the archive.
Read it.
Then:
1) extract the archive on your kindle
2) install KTerm
3) open it from KUAL
4) cd <folder_where_you_extracted_the_archive>
5) ./luajit vncviewer.lua <ip_of_your_vnc_server>:<port_of_your_server>
I follow your instruction to connect my raspberry pi to kindle paperwhite.
However, KTerm return:
ConnectToTcpAddr: connect
Unable to connect to VNC server

I try to connect raspberry pi to my window 10 laptop via RealVNC and it's Okay with no error message shown.

It seems like I do something wrong with my kindle setup, can anyone help me?
a00tkh is offline   Reply With Quote
Old 05-14-2018, 08:29 PM   #80
Faceman2k18
Junior Member
Faceman2k18 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2018
Device: Kindle PW3 JB
Can you ping the PIs address?

are you using a direct USB connection or Wifi? a direct USB connection to the PI requires some extra set up on the PI side to work propery.
Faceman2k18 is offline   Reply With Quote
Old 04-29-2024, 03:27 PM   #81
scribe_user
Member
scribe_user doesn't litterscribe_user doesn't litterscribe_user doesn't litter
 
Posts: 17
Karma: 220
Join Date: Feb 2024
Device: scribe
Just sharing a working version tested on 5.16.2.0.1 for others. I am able to use my Android mobile screen(Apps like Eink Bro Browser(created for android e-ink readers),chrome are looking good on kindle screen).
Changes in the attachment:

1. Recent bug fix from Github(key-event) bleeding, fixes an issue where VNC touch events were getting propagated to kindle gui
2. couple of fixes from older responses in this thread, missing constants
3. recent fixes for newer versions of PW, to refresh the screen in an infinite loop
4. Working touch control

Usage:
1. Adjusting the screen resolution of android phone(will be acting as VNC server) to match the Kindle resolution
Log into Android shell using adb connect & use the below command:
wm size 1836x2448 :Kindle Scribe Resolution(need to be adjusted as per kindle model)
wm size reset :Should be executed, when mobile phone should be reset to it's original resolution
There are some applications available in play store, to adjust mobile screen resolution with out using adb tools on laptop.

2. I am starting VNC server on my mobile with application https://github.com/bk138/droidVNC-NG

3. Now I have a VNC server, which is providing the content in the resolution of kindle. Replace the IP address and Port from your VNC server(android) in the file: kvncviewer.sh
./luajit vncviewer.lua 192.168.23.12:5900
4. If any password is set in the VNC server, provide the same in the file:vncviewer.lua. Replace nil with "<yourpassword>" (including the quotes)
5. Lauch the vnc viewer from KUAL

How to exit from vnc viewer:

Option 1: Force Restarting the kindle(easiest option). Even when the VNC server is stopped on mobile, it is recommended to restart the kindle immediately, after using it as VNC viewer
Option 2: If you can do SSH into kindle, find out the parent PID of the kvncviewer.sh process from htop and kill the same using pkill -P $parent_pid

Screenshot:

Click image for larger version

Name:	Kindle.jpg
Views:	276
Size:	594.1 KB
ID:	207917

Viewer:
kvncviewer.zip

I would like to thank all the developers(creators) for their contributions and making our devices more productive.

Disclaimer: I am not responsible for any damage to the kindles. I just colated the files from different sources and wanted to share a working version(giving back to community). Setting up vnc viewer requires USB Networking(Wifi mode) working for this use case. If you want to use this application, be ready to be patient(time it takes to get it work for Newbie, is high) and doing your research.
scribe_user is offline   Reply With Quote
Old 03-19-2025, 10:12 AM   #82
juegos
Connoisseur
juegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheese
 
Posts: 70
Karma: 1000
Join Date: May 2017
Device: none
Quote:
Originally Posted by scribe_user View Post
Just sharing a working version tested on 5.16.2.0.1 for others. I am able to use my Android mobile screen(Apps like Eink Bro Browser(created for android e-ink readers),chrome are looking good on kindle screen).
Changes in the attachment:

1. Recent bug fix from Github(key-event) bleeding, fixes an issue where VNC touch events were getting propagated to kindle gui
2. couple of fixes from older responses in this thread, missing constants
3. recent fixes for newer versions of PW, to refresh the screen in an infinite loop
4. Working touch control

Usage:
1. Adjusting the screen resolution of android phone(will be acting as VNC server) to match the Kindle resolution
Log into Android shell using adb connect & use the below command:
wm size 1836x2448 :Kindle Scribe Resolution(need to be adjusted as per kindle model)
wm size reset :Should be executed, when mobile phone should be reset to it's original resolution
There are some applications available in play store, to adjust mobile screen resolution with out using adb tools on laptop.

2. I am starting VNC server on my mobile with application https://github.com/bk138/droidVNC-NG

3. Now I have a VNC server, which is providing the content in the resolution of kindle. Replace the IP address and Port from your VNC server(android) in the file: kvncviewer.sh
./luajit vncviewer.lua 192.168.23.12:5900
4. If any password is set in the VNC server, provide the same in the file:vncviewer.lua. Replace nil with "<yourpassword>" (including the quotes)
5. Lauch the vnc viewer from KUAL

How to exit from vnc viewer:

Option 1: Force Restarting the kindle(easiest option). Even when the VNC server is stopped on mobile, it is recommended to restart the kindle immediately, after using it as VNC viewer
Option 2: If you can do SSH into kindle, find out the parent PID of the kvncviewer.sh process from htop and kill the same using pkill -P $parent_pid

Screenshot:

Attachment 207917

Viewer:
Attachment 207915

I would like to thank all the developers(creators) for their contributions and making our devices more productive.

Disclaimer: I am not responsible for any damage to the kindles. I just colated the files from different sources and wanted to share a working version(giving back to community). Setting up vnc viewer requires USB Networking(Wifi mode) working for this use case. If you want to use this application, be ready to be patient(time it takes to get it work for Newbie, is high) and doing your research.
Thank you! Any solution for 5.17 (Kindle Scribe)? I uploaded the zip file to Kindle, then ssh into it, but trying to execute it gives:

[root@kindle kvncviewer4]# ldd ./luajit
$ not a dynamic executable

perhaps it needs armhf executables and so on?

Last edited by juegos; 03-19-2025 at 10:14 AM.
juegos is offline   Reply With Quote
Old 03-20-2025, 04:49 AM   #83
kbarni
Enthusiast
kbarni doesn't litterkbarni doesn't litter
 
kbarni's Avatar
 
Posts: 43
Karma: 106
Join Date: Feb 2025
Device: Kindle PW5
Check KOReader, it has a luajit built for armhf.

There you can also get libz.so and libjpeg.so.

That said, you will probably need to rebuild it to get libvncclient.so for armhf.

But by following the build instructions on the github, you can build it for your Kindle. That's why open-source exists!

Last edited by kbarni; 03-20-2025 at 05:22 AM.
kbarni is offline   Reply With Quote
Old 03-20-2025, 08:50 AM   #84
juegos
Connoisseur
juegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheese
 
Posts: 70
Karma: 1000
Join Date: May 2017
Device: none
Thanks for the suggestions! I've been trying but I get stuck unfortunately (I am on Fedora, if that matters), if anyone with more knowledge than me on this would have any tips, thanks a lot:

cd /Users/admin/Dropbox/proj/z_kindle/
git clone https://github.com/hwhw/kindlevncviewer.git
cd kindlevncviewer
git clone https://github.com/koreader/koxtoolchain.git
cd koxtoolchain
./gen-tc.sh kindlehf
source refs/x-compile.sh kindlehf env
cd ..
git submodule update --init --recursive
make ARCH=arm-kindlehf-linux-gnueabihf



which then gives me:

(base) admin@fedora:~/Dropbox/proj/z_kindle/kindlevncviewer$ make ARCH=arm-kindlehf-linux-gnueabihf
fatal: No names found, cannot describe anything.
fatal: No names found, cannot describe anything.
sed -i -e "s/CC= gcc/CC= gcc -D_GNU_SOURCE=1/" luajit-2.0/src/Makefile
make -C luajit-2.0 HOST_CC="gcc -m32" CROSS=arm-kindlehf-linux-gnueabihf-
make[1]: Entering directory '/n/Dropbox/proj/z_kindle/kindlevncviewer/luajit-2.0'
==== Building LuaJIT 2.1.0-alpha ====
make -C src
make[2]: Entering directory '/n/Dropbox/proj/z_kindle/kindlevncviewer/luajit-2.0/src'
HOSTCC host/minilua.o
gcc: error: unrecognized command-line option ‘-mfpu=neon’
gcc: error: unrecognized command-line option ‘-mfloat-abi=hard’
gcc: error: unrecognized command-line option ‘-mthumb’
make[2]: *** [Makefile:661: host/minilua.o] Error 1
make[2]: Leaving directory '/n/Dropbox/proj/z_kindle/kindlevncviewer/luajit-2.0/src'
make[1]: *** [Makefile:106: default] Error 2
make[1]: Leaving directory '/n/Dropbox/proj/z_kindle/kindlevncviewer/luajit-2.0'
make: *** [Makefile:46: luajit-2.0/src/luajit] Error 2

EDIT: removed luajit from Makefile - will get that 1 from KOReader - see if it works then.

Last edited by juegos; 03-20-2025 at 09:28 AM.
juegos is offline   Reply With Quote
Old 03-20-2025, 10:02 AM   #85
kbarni
Enthusiast
kbarni doesn't litterkbarni doesn't litter
 
kbarni's Avatar
 
Posts: 43
Karma: 106
Join Date: Feb 2025
Device: Kindle PW5
Go step by step. Cross-compiling for another architecture is not so simple...

First, before going for vncviewer, set up your toolchain: https://kindlemodding.org/kindle-dev...equisites.html

Test your setup with the example project from the kindlemodding site.

For cloning use the recursive flag:
git clone --recursive https://github.com/hwhw/kindlevncviewer.git

for building you might need to set the prefix for the toolchain. A bit difficult to say how to do it without trying.
kbarni is offline   Reply With Quote
Old 03-20-2025, 03:27 PM   #86
osse
Junior Member
osse began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Dec 2019
Device: boox note pro
Quote:
Originally Posted by juegos View Post
EDIT: removed luajit from Makefile - will get that 1 from KOReader - see if it works then.
It compiles without, after building I copied KOReader luajit and it runs however there are few extra steps:

1. Add Scribe fb to be recognized by the script.
Before else, https://github.com/hwhw/kindlevncvie...linux.lua#L175

Code:
                        elseif fb.finfo.smem_len == 9285120 then
                                -- We're a Scribe 2022
                                print('we are scribe')
                                fb.wait_for_full_updates = true
                                fb.einkWaitForCompleteFunc = kindle_pearl_mxc_wait_for_update_complete
2. Remove missing? CONSTANT. ¯\_(ツ)_/¯
Code:
./luajit: ./ffi/framebuffer_linux.lua:89: missing declaration for symbol 'MXCFB_WAIT_FOR_UPDATE_SUBMISSION'
so I modified to return null here:
https://github.com/hwhw/kindlevncvie..._linux.lua#L87

And got to connect, move window around for 2-3 seconds:
https://imgur.com/yhAUrw2

and then it crashed with another
missing CONSTANT:
Code:
./luajit: ./ffi/framebuffer_linux.lua:45: missing declaration for symbol 'MXCFB_WAIT_FOR_UPDATE_COMPLETE_PEARL'
stack traceback:
        [C]: in function '__index'
        ./ffi/framebuffer_linux.lua:45: in function 'einkWaitForCompleteFunc'
        ./ffi/framebuffer_linux.lua:372: in function 'refresh'
        vncviewer.lua:94: in function 'cb'
        ./ffi/eventloop.lua:188: in function 'loop'
        ./ffi/input_kindle.lua:42: in function 'waitForEvent'
        vncviewer.lua:315: in main chunk
        [C]: at 0x00013ea9
I wonder if it wouldn't be easier to re-use KOReader screen management lua's as they've been updated frequently.
osse is offline   Reply With Quote
Old 03-20-2025, 06:45 PM   #87
juegos
Connoisseur
juegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheese
 
Posts: 70
Karma: 1000
Join Date: May 2017
Device: none
Quote:
Originally Posted by osse View Post
It compiles without, after building I copied KOReader luajit and it runs however there are few extra steps:

1. Add Scribe fb to be recognized by the script.
Before else, https://github.com/hwhw/kindlevncvie...linux.lua#L175

Code:
                        elseif fb.finfo.smem_len == 9285120 then
                                -- We're a Scribe 2022
                                print('we are scribe')
                                fb.wait_for_full_updates = true
                                fb.einkWaitForCompleteFunc = kindle_pearl_mxc_wait_for_update_complete
2. Remove missing? CONSTANT. ¯\_(ツ)_/¯
Code:
./luajit: ./ffi/framebuffer_linux.lua:89: missing declaration for symbol 'MXCFB_WAIT_FOR_UPDATE_SUBMISSION'
so I modified to return null here:
https://github.com/hwhw/kindlevncvie..._linux.lua#L87

And got to connect, move window around for 2-3 seconds:
https://imgur.com/yhAUrw2

and then it crashed with another
missing CONSTANT:
Code:
./luajit: ./ffi/framebuffer_linux.lua:45: missing declaration for symbol 'MXCFB_WAIT_FOR_UPDATE_COMPLETE_PEARL'
stack traceback:
        [C]: in function '__index'
        ./ffi/framebuffer_linux.lua:45: in function 'einkWaitForCompleteFunc'
        ./ffi/framebuffer_linux.lua:372: in function 'refresh'
        vncviewer.lua:94: in function 'cb'
        ./ffi/eventloop.lua:188: in function 'loop'
        ./ffi/input_kindle.lua:42: in function 'waitForEvent'
        vncviewer.lua:315: in main chunk
        [C]: at 0x00013ea9
I wonder if it wouldn't be easier to re-use KOReader screen management lua's as they've been updated frequently.
Very interesting thanks! Another option may be do install alpine linux (from the other thread) and vnc through there - that may be more stable? Although mine (Kindle Scribe) froze after a few seconds, but I did see my Macbook screen on the Kindle. Perhaps due to low memory but not sure.
juegos is offline   Reply With Quote
Old 03-21-2025, 02:30 AM   #88
osse
Junior Member
osse began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Dec 2019
Device: boox note pro
Quote:
Originally Posted by juegos View Post
Very interesting thanks! Another option may be do install alpine linux (from the other thread) and vnc through there - that may be more stable? Although mine (Kindle Scribe) froze after a few seconds, but I did see my Macbook screen on the Kindle. Perhaps due to low memory but not sure.
Without the logs hard to tell.. but I got some good news.

After modifying the return value for other missing constant to null I got kvnc to work without any other issues. There's no need for usleep loop hack to be ran in parallel either. Simply starting the script is enough for refresh to work fine.

I've tested on Scribe by 'extending' macos screen onto it. The responsiveness on wifi was ok for typing experience, especially given there were 3 hosts at play here. (Kindle kvn client connects to Linux Xvfb running xvnc server with uxplay as X application. Macos extends screen via airplay to uxplay.)
osse is offline   Reply With Quote
Old 03-21-2025, 03:49 AM   #89
juegos
Connoisseur
juegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheese
 
Posts: 70
Karma: 1000
Join Date: May 2017
Device: none
Quote:
Originally Posted by osse View Post
Without the logs hard to tell.. but I got some good news.

After modifying the return value for other missing constant to null I got kvnc to work without any other issues. There's no need for usleep loop hack to be ran in parallel either. Simply starting the script is enough for refresh to work fine.

I've tested on Scribe by 'extending' macos screen onto it. The responsiveness on wifi was ok for typing experience, especially given there were 3 hosts at play here. (Kindle kvn client connects to Linux Xvfb running xvnc server with uxplay as X application. Macos extends screen via airplay to uxplay.)
Oh wow that sounds amazing! Are you able to share the code that works with the other constant changed? Would love to give this a try to alleviate some eye issues.
juegos is offline   Reply With Quote
Old 03-21-2025, 05:41 AM   #90
osse
Junior Member
osse began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Dec 2019
Device: boox note pro
Quote:
Originally Posted by juegos View Post
Oh wow that sounds amazing! Are you able to share the code that works with the other constant changed? Would love to give this a try to alleviate some eye issues.
Sure, the entry I removed is https://github.com/hwhw/kindlevncvie..._linux.lua#L45 so this line is just

Code:
return
I can prep a zip of my build too.
osse is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KindleVNCviewer hack: full screen display? bbhuston Amazon Kindle 0 04-28-2012 11:19 PM


All times are GMT -4. The time now is 01:55 PM.


MobileRead.com is a privately owned, operated and funded community.