koreader / koreader

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
http://koreader.rocks/
GNU Affero General Public License v3.0
16.56k stars 1.26k forks source link

Does Koreader support Kobo Aura One? #3273

Closed tigran123 closed 7 years ago

tigran123 commented 7 years ago

I asked this in the issue #3021 but decided it is better to create a separate question-issue for this, to attract more replies. So, my question is: does Koreader work on the 7.8" Kobo Aura One --- the most recent Kobo device with the 8GB internal storage (non-upgradeable) and no external micro sd?

tigran123 commented 7 years ago

Ah, I discovered that the answer is already here:

https://github.com/koreader/koreader/wiki/Installation-on-Kobo-devices#newer-model

Sorry, I should have read the Wiki first. So, I suppose I can close the issue and go and buy this device, despite the fact that I hate their decision to make the internal storage non-upgradeable and not support external micro sd....

tigran123 commented 7 years ago

Just to let everyone know that I have bought Kobo Aura One just now and installed KSM08 + KA1 patch followed by Koreader and CoolReader and everything seems to be working fine.

Now I need to think of a way to access the books from within the device. That is going to be a bit tricky. But the screen quality is so amazing (finally I can read scientific books without enabling reflow or switching to landscape!) that it is worth solving this problem properly somehow.

KenMaltby commented 7 years ago

There are a number of ways to setup your own server, to have your documents available to your devices. The in thing nowadays seems to be using a "cloud" service, (not something I put much faith in). If you use calibre there are a few ways to have its library accessible via WiFi. Your own OPDS catalog could present your documents, as you would like them to appear, to KOReader's OPDS plugin.

tigran123 commented 7 years ago

Thank you, @KenMaltby

  1. Calibre I considered and rejected as it is not scalable.

  2. OPDS I will consider, but a very brief look at OPDS a few years ago didn't make me like it (it didn't seem to be more than just NFS but using some "modern terminology").

  3. What I am considering right now is the zsync transport. Since all my other Kobo devices have at least 256GB of storage I can use any of them to store the whole library and then "publish" the book I need to read and "subscribe" to it from the Aura One device. Well, this is in theory, but whether it actually works (and reliably!) I don't know. I am going to try it now.

tigran123 commented 7 years ago

Hmmm, there is no "zsync" in the menu, but there is an option "cloud storage" with "FTP" as a suboption. (Dropbox is of no use, as I need at least 200GB storage and dropbox doesn't provide that for free).

Ah yes, zsync appears in the menu if I open the document. Let's see if it actually works...

Frenzie commented 7 years ago

It looks like the zsync option only seems to exists in the reader view.

screenshot_2017-09-29_17-32-44

KenMaltby commented 7 years ago

I think that is because you would be "Publishing" the current book, so the option appears in the reader menu.

tigran123 commented 7 years ago

Yes, on the first attempt it didn't work (Publish on one device seemed to succeed and Subscribe on the other device prompted me for the directory, but nothing was downloaded into that directory).

But I'll configure things properly now (setup static IP with router etc) and will re-test it in a more reliable way, i.e. while logged in to Aura One to see what's going on.

Also, another viable option is FTP, if it works.

Frenzie commented 7 years ago

Incidentally, here's something I conversed about with @KenMaltby a few weeks ago.

It could definitely be useful to do something with rsync, although I personally only use Unison and Dropbox/Syncthing (but not on my ereader, I mostly use wires for that).

I'm inclined to think something like http://www.pebra.net/blog/2015/08/23/syncthing/ might be easier.

  • Download syncthing for the platform (easy, at least on our Kobos)
  • Extract (easy, we already include tar)
  • Change the config for the web GUI
  • Display a little message to the user about where to point the browser

I haven't looked into it beyond writing down this concept, but I've experimented a little with Syncthing as a Dropbox alternative and I think it works rather well.

tigran123 commented 7 years ago

Ok, zsync is confirmed to not work at all. Now, trying FTP and hitting a strange problem: it keeps asking me if I want to turn on Wi-Fi, but I don't want it because I have already turned it on and connected to it. But if I click on "Turn on" then it says "Scanning" and then "Connected to network UmiTek76" (that is the name of my hotpoint AP running on UMI mobile with Android 7). And then what? Then nothing happens, it just returns me to the list of two elements "Add new cloud storage" and "UMI Library".

So, how do I actually access the cloud storage? I checked and the FTP server is running fine.

tigran123 commented 7 years ago

I have a nasty suspicion that this is similar to the problem I was having with Kindle Keyboard 3 which rejected hotpoint AP as it couldn't "connect to Internet" as it had that idiotic notion of "if I can't talk to amazon.com then it's not a valid Wi-Fi" :)

I could try it without hotpoint using WiFi on the router, but the whole point was being able to access the library on the mobile from the Aura One device, so even if it works via the router it is not a solution.

tigran123 commented 7 years ago

Some interesting bugs here: the "Wi-Fi connection" in the menu is unticked even though I am connected to the AP (and ifconfig confirms this executed via the handy "Terminal emulator" plugin from within Koreader).

So, looks like Koreader thinks I am not connected to WiFi even though I actually am (probably the code was tested only via router's AP, not hotpoint AP).

KenMaltby commented 7 years ago

When the WiFi scans for access, it lists the active discoverable networks. You can then select the one you want to use. Once you are "connected" you leave that and again try to do the function you wanted in the first place. It should then work, or at least get farther.

tigran123 commented 7 years ago

@KenMaltby Yes, I understand that of course. But, as I said above --- it does not do that.

I'll retry everything using WiFi via the router (though this is not a solution).

tigran123 commented 7 years ago

YES! My guess was absolutely correct! :)

It works via the router but fails via hotpoint AP. And I suspect it fails for some very trivial reason, i.e. some scripts grepping for WiFi connection do not recognise the case of hotpoint AP as "proper WiFi" even though on system level I am connected just fine (both the AP server side shows it and the ifconfig command on Kobo device also shows the IP assigned correctly).

KenMaltby commented 7 years ago

Well you might try turning the WiFi on through the Network menu, before trying the FTP approach again. If there is a problem turning on the WiFi that way, the problem might be a little more isolated. There is also a "Network info" option that should be active when a network is connected.

tigran123 commented 7 years ago

@KenMaltby Yes, I was referring to that Network menu when I mentioned that "WiFi connection" is unticked in one of the previous messages.

So, when connected to WiFi on the router everything in Network menu is nice and correct. But when connected to the hotpoint AP, then the fundamental things are correct (i.e. scanning for APs shows that I am actually connected to the correct AP) but some trivial things like the tick next to WiFi and, more importantly, the "Cloud storage" subsystem which erroneously respects this tick, do not work.

So, we need to fix this and then the problem of storage is solved. The mobile has almost 300GB of storage, so that should be enough for me for a while :)

tigran123 commented 7 years ago

I'll try to figure out what is it that decides to place the tick next to "WiFi connection" and why it doesn't like hotpoint AP.

Frenzie commented 7 years ago

@tigran123

3160

tigran123 commented 7 years ago

@Frenzie Ah, interesting! So, we just need to disable the totally unnecessary "check for internet connectivity" thing.

tigran123 commented 7 years ago

But it is not a simple matter of returning true in frontend/ui/network/manager.lua:NetworkMgr:isOnline() function... So, I'll need to read that whole module to understand how it works.

For my purposes it should suffice to hack isOnline() function to check for WiFi. Yes, this would break Wiki/dropbox support (they would hang), but as I consider Wiki and dropbox "features" totally unnecessary, it should be okay. I'll try this approach.

tigran123 commented 7 years ago

Here is my version of frontend/ui/network/manager.lua:NetworkMgr:isOnline() function that makes FTP work via hotpoint AP, i.e. accesses the books stored on the mobile via FTP server running on Android:

function NetworkMgr:isOnline()
    -- local socket = require("socket")
    -- return socket.dns.toip("www.example.com") ~= nil
    local ret = os.execute("ifconfig | grep eth0")
    if ret == 0 then
        return true
    else
        return false
    end
end

Hmm, but it breaks the normal case of access via the router :) I'll see why.

tigran123 commented 7 years ago

Ok, a much better fix is this:

function CloudStorage:openCloudServer(url)
    local tbl
    local NetworkMgr = require("ui/network/manager")
    -- if not NetworkMgr:isOnline() then
    --    NetworkMgr:promptWifiOn()
    --    return
    -- end
    if self.type == "dropbox" then
...

i.e. just do NOT check for this "internet connectivity" when using cloud storage. This works (tested) both with hotspot AP and for going via router.

But of course WiFi has to be prepared outside Koreader which is natural, as it should be the responsibility of the operating system's "environment" (in this case KSM) and not the user application such as Koreader. I am happy with this quick hack, but I agree with @Frenzie that the proper way is of course to differentiate between the case where the internet is really needed and those where WiFi would suffice.

Frenzie commented 7 years ago

@tigran123 Could it be as simple as pinging the default gateway? Something like: ping $(ip route | awk '/default/ { print $3 }')

Then you'd have ping gateway to check working wifi and ping MS server for internet connectivity.

tigran123 commented 7 years ago

@Frenzie with usbnet enabled there would be a default gateway which would also return an icmp reply. So, using a hardcoded interface name eth0 is better.

UPDATE: No, I was wrong. USBNET only adds a net-specific route entry, not a default one. So, yes, you are correct --- pinging a default gateway would do what you want. But simply executing "ifconfig eth0" and checking return status is faster than sending an ICMP echo request and waiting for a reply. Also, don't forget -c1 option if you really want to go with ping, so as to send only a single packet, not an infinite number of them :)

Frenzie commented 7 years ago

You mean like this?

ping $(ip route | grep eth0 | awk '/default/ { print $3 }')
tigran123 commented 7 years ago

Well, I meant simply ifconfig eth0 but that would only check that the interface eth0 has been provided by the kernel, but this does NOT mean that WiFi has been already configured. This could be ascertained by the ip address which would be printed next to "inet addr:" field in ifconfig's output.

But if you really want to check that the interface is really working, then, yes you can send a ping packet (aka "icmp echo request") and wait for a reply.

Frenzie commented 7 years ago

Kinda useless addition, but as I was brushing my teeth I realized the other way around is more efficient (less useless grep output for awk to sift through).

ip route | grep '^default' | awk '/eth0/ {print $3}'

But if you really want to check that the interface is really working, then, yes you can send a ping packet (aka "icmp echo request") and wait for a reply.

Well yes, naturally that's the idea. :-) I agree with @Hzj-jie https://github.com/koreader/koreader/pull/3150#issuecomment-326189982

Frenzie commented 7 years ago

Do you want to send a PR to fix this up? My thought is to simply add another function.

NetworkMgr:isConnected() -- wifi only

NetworkMgr:isOnline() -- internet connectivity

Of course there'll need to be a few other changes but as a starting point. Incremental improvements. ;-)

tigran123 commented 7 years ago

I'll think about it, I am still "tidying up" my new Aura One, making sure I can create a sufficiently pleasant environment for justifying the switch from Kobo Aura H2O which was my main device for almost three years! :)

Frenzie commented 7 years ago

Is the screen any better in practice or basically just bigger? (Which is better but you know what I mean.)

tigran123 commented 7 years ago

The screen is slightly better, i.e. 300dpi vs 265dpi resolution.

Btw, I remember it was upon your recommendation that I switched from Kobo Aura HD to Kobo Aura H2O, because you mentioned that H2O's background is whiter, i.e. the contrast is higher. And you were absolutely right! So, if, on some "subjective scale" we say that H2O is about 5 points better than HD, then Aura One is about 2 points better than H2O. But this only takes into account the quality (i.e. resolution and contrast). But the size is also very important, especially for reading scientific books with formulas etc.

KenMaltby commented 7 years ago

Just to muddy the water, it would be good to be able to have "WiFi only" ignore the availability to access the internet, and even isolate itself from it. That would allow a more secure "home" server.

tigran123 commented 7 years ago

Here is the picture showing Aura H2O and Aura One side by side:

Aura H2O vs Aura One

The right side of Aura One's screen seems "misty" on the picture, but that is just a problem with the picture, not the screen :)

tigran123 commented 7 years ago

I am showing this picture to prevent disappointment, i.e. now that I look at them side by side I feel that Aura H2O's screen is a little bit whiter. So, even though Aura One's resolution is higher, the contrast is not necessarily higher. Maybe even slightly lower. But definitely better than Aura HD.

Anyway, I don't regret buying Aura One --- it is certainly useful for reading scientific books. More useful than Kindle DXG because of DXG's very low resolution and quite heavy weight.

Frenzie commented 7 years ago

Thanks for the picture! Is it capacitive touch rather than infrared? (Which would add an extra layer that slightly reduces contrast.)

tigran123 commented 7 years ago

Kobo Aura HD is also infrared, but its contrast is lower than H2O. But Aura One has a completely flat front surface (i.e. same level as the screen), so I can't see where they would put infrared sensors, so it must be capacitive touch.

Frenzie commented 7 years ago

There's the base contrast, but the same display technology + extra capacitive layer = less contrast. ;-)