View Full Version : PC and iliad together: ssh? dropbear?
daudi 01-09-2008, 04:04 PM If I understand things correctly I can install dropbear on the iliad and then ssh into it from my PC and run commands on the iliad.
Does this mean that, in principle, I should be able to remotely open a PDF with ipdf? Taking this further, is it reasonably straight-forward to run a script on my PC session that sends the command using ssh to the iliad session to open the pdf?
The iliad has no bibliography manager and even if it did I suspect it would be too slow to work with. I therefore want to be able to use my PC for managing my bibliography but be able to read articles on the iliad. I am hoping that by networking the two I can search using my bibliography manager and if I want to read an article be able to quickly open it on the iliad without having to navigate to the right folder and then use the search function to open the right PDF.
Does it make sense to even think along these lines or do I have things mixed up?
Thanks for any pointers.
-Thomas- 01-09-2008, 04:36 PM I think that's possible
To open a PDF file from a ssh session simply type DISPLAY=:0 ipdf /path/to/your.pdf
To start that line directly from the PC, you can issue this command (at least in Linux, don't know if it works in Windows):
ssh -l root (iliads IP) "DISPLAY=:0 ipdf /path/to/your.pdf"
daudi 01-10-2008, 12:59 AM To start that line directly from the PC, you can issue this command (at least in Linux, don't know if it works in Windows):
ssh -l root (iliads IP) "DISPLAY=:0 ipdf /path/to/your.pdf"
Great! Thanks Thomas (I should have said that I am using linux).
daudi 01-11-2008, 04:25 PM OK, I'm almost there with this. I can now open pdfs on my iliad from my bibliography manager on my PC. The only thing I need to sort out now is exiting from ipdf. If I call ipdf with the path to the pdf it opens okay, but when I try to exit on the iliad, e.g. by pressing one of the buttons, I am left with the PDF on screen. I think it has exited to the contentlister because the number of pages shown at the bottom corresponds correctly to the number of pages for each button, but it does not show the contentlister.
I am not familiar with how the contentlister works. I remember seeing in start.sh(?) something like
contentlister -sync
which looks like it might do "something" but I am reluctant to start prodding it to see what works just in case I make a mess of things.
Anyone got any pointers?
-Thomas- 01-12-2008, 12:20 PM Does the number of pdf pages show up correctly? And does ipdf respond to the flip bar?
Maybe the contentlister registers exclusively for receiving key events or something similar?
daudi 01-12-2008, 12:48 PM I open the PDF from my PC biblio manager. The correct number of pages for the PDF are displayed at the bottom of the screen.
When I log in I see this:
dave@upanga:~$ ssh root@192.168.11.3
root@192.168.11.3's password:
root@ereader:~# ps ax | grep ipdf
1287 root 540 S sh -c DISPLAY=:0 ipdf /mnt/usb/iliad/library/articles/albala02.pdf/albala02.pdf
1288 root 10972 S ipdf /mnt/usb/iliad/library/articles/albala02.pdf/albala02.pdf
1289 root 10972 S ipdf /mnt/usb/iliad/library/articles/albala02.pdf/albala02.pdf
1290 root 10972 S ipdf /mnt/usb/iliad/library/articles/albala02.pdf/albala02.pdf
1300 root 448 S grep ipdf
root@ereader:~#
Then after I press the Docs button (for example, the number of pages changes to the number of pages that the contenlister would show for Docs (and likewise for Notes, etc) but the PDF is still displayed. The flipbar changes between pages 1 and 2 of the Docs folder, and does not affect image of the PDF displayed.
root@ereader:~# ps ax | grep ipdf
shows the same as above. If I then start to kills things:
root@ereader:~# kill 1287
root@ereader:~# ps ax | grep ipdf
1288 root 10972 S ipdf /mnt/usb/iliad/library/articles/albala02.pdf/albala02.pdf
1289 root 10972 S ipdf /mnt/usb/iliad/library/articles/albala02.pdf/albala02.pdf
1290 root 10972 S ipdf /mnt/usb/iliad/library/articles/albala02.pdf/albala02.pdf
1306 root 448 S grep ipdf
This still leaves the image of the PDF on the screen.
root@ereader:~# kill 1288
root@ereader:~# ps ax | grep ipdf
1308 root 448 S grep ipdf
root@ereader:~#
Now it has gone.
daudi 01-12-2008, 05:27 PM Maybe the contentlister registers exclusively for receiving key events or something similar?
Aha. Yes, I remember now reading something about how the key events were special. I am beginning to think that using ipdf remotely might be a lost cause. Shame, it felt like I was getting so close. My reason for wanting to do this was to make it easy and quick to open specific PDFs based on searches of my bibliography. I am now thinking about alternative approaches.
-Thomas- 01-12-2008, 07:16 PM I just got a new approach to solve your problem - what about a symlink in your documents base directory? An entry in the content lister which takes you to your wanted document.
As soon as you open a new bibliography entry on your PC, a script replaces the existing symlink via SSH to point to the new PDF. This way you can open it in the content lister with 1-2 clicks and get around those key event issues.
Basically, it's something like ssh -l root (iliad's ip) "rm /mnt/free/documents/0_actual; ln -s /path/to/your/new.pdf/ /mnt/free/documents/0_actual"
(didn't try this code, but I hope you know what I mean)
daudi 01-13-2008, 03:00 AM Thanks again Thomas. Great minds think alike (and fools never differ)!
I came to broadly the same solution but using a manifest.xml with a <symlink>/path/to/pdf</symlink> line in it, using samba instead of ssh. Part of the reason for using this approach is that real symlinks won't work with USB (unless I reformat with ext2). I have a little issue to sort out with it (the samba version) but that is probably for another thread (some sort of write problem).
-Thomas- 01-13-2008, 07:54 AM You're right, the internal storage is formatted as FAT, so symlinks won't work there too. But the manifest file is a good solution (is there any manifest.xml documentation out there?)
daudi 01-13-2008, 08:47 AM There's some in the (rather old) doc on how to make content for the iliad (on the irex website) but it does not mention the symlinks and there might be other things that can be done that we don't know about.
And my samba write problem turned out to be to do with USB being slow. Adding sleep 1 at the right place sorted it out.
|