Commit Graph

12 Commits (37a01100b7a4733ae26871c4d929114aff8ea143)

Author SHA1 Message Date
NiLuJe 37a01100b7
Various Wi-Fi QoL improvements (#6424)
* Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback).
* Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental.
* Consistently use "Wi-Fi" everywhere.
* On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery.
(i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again).
* Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic).
* restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it).
* We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed.
* Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state.
* Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing.
* Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix #6421 
Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results).
* For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
4 years ago
NiLuJe e2a0929c51
Better KOA2 support (#4037)
* Better KOA2 support
    * Fix FL
    * Add physical pageturn keys
    * Add accelerometer support
* Possibly better NaturalLight handling on the Clara
* Fix WiFi module name used in some(?) Mk7 Kobos
* A bunch of kodev fixes
6 years ago
NiLuJe 18db509325 Assorted bag of fixes (#4014)
* Link to the WiKi, it's a bit more explainy ;).

* More WiFi trickery for some HW revs

* Fix Rev2 detection under KSM

That's to future-proof it, the other end of this hasn't made it into
current KSM build yet.

* Resync nickel.sh w/ current rcS

We don't have CPU, but we have PLATFORM, which is based on CPU, so,
that'll do :).

* Go back to using rmmod instead of modprobe -r

Functionally identical on current FW, will potentially avoid getting
outsmarted by modprobe if Kobo ever deigns shipping an actually usable
Linux system one day...

* Don't crash if screensavers directory doesn't exist

c.f., https://www.mobileread.com/forums/showpost.php?p=3706979&postcount=2919
6 years ago
NiLuJe e3b7524d9c Another round of Kobo Fixes (#3939)
* Trim unneeded stuff from startup script

I was somehow convinced I'd already done that...
While we're there, explain why we need to siphon those specific vars

* Fix a stray eth0

-> $INTERFACE

* Be very very sure we have INTERFACE set in our env

re #3936

* Make getFirmwareVersion less fragile on Kobo

Not that we actually use it right now, but, still. :D

* Use the same syntax as the PRODUCT check

* Actually implement getProductId

Instead of a stray c/p ^^

* Properly identify the Rev2/Mark7 variants of existing devices

Namely, the H2O² and Aura SE
Not that the H2O²r2 support is still broken, this just allows us to
implement it cleanyl without breaking handling of the original H2O²

re #3925

* Tweak sleeps a bit around Kobo WiFi modules...

See if that jog things up (re #3936)

* Try harder not to suspend with WiFi on on Kobos

Because otherwise, things go boom. (re #3936)
6 years ago
mezzarobba a3e16b3920 [fix] make wifi control work with my Kobo Touch N905 (#3920) 6 years ago
NiLuJe bdb82d09c1 [chore] A round of Kobo specific script cleanup (#3876)
* Flag those scripts as executable in git

Somewhat irrelevant because we'll end up living on a FAT32 drive, but,
still.

* Cleanup Kobo startup script

Support KFMon >= 0.9.5

Don't siphon PRODUCT from nickel, it's exported by rcS, so fmon/KFMon
already inherit it.
Siphon NICKEL_HOME, on the off-chance nickel fails to figure that one
out for itself on restart.
Siphon LANG (This may be a terrible idea, rcS sets LANG to en_US.UTF-8,
while we set LC_ALL to en_US.UTF-8, but I don't know if nickel itself
ever updates LANG, since I have mine set to en_US also ;)).
My secret hope if that everything's working as it should and this ensures
we default to Nickel's locale on fresh installs?

Remove the extra sync on startup, both @Baskerville's fmon and KFMon are
smart enough not to do anything overly stupid, and recent FW versions
have a slightly more resilient DB anyway (rollback journal -> WAL).
This effectively shaves over a second off our startup time.

* Slimmed down the nickel restart script.

Based on current rcS
Scrapped a bucketload of irrelevant & legacy crap, since we're never
bootstrapping nickel, only restarting it.

* Update Kobo install instrcutions.

Point to KSM09, @Baskerville's fmon, and KFMon.
Deprecate legacy fmon, and as such, stop shipping a useless KoboRoot
tarball.
6 years ago
Frans de Jonge e8c01274f4 Travis: enforce shellscript coding style
* enormous coding style update

* update luajit-launcher

All changes are formatting only except for:

* new more correct pushd/popd style
	* keeps useful indentation
	* prevents execution of commands when pushd failed (cf. https://github.com/koalaman/shellcheck/wiki/SC2164 and https://github.com/koalaman/shellcheck/issues/863)

```
pushd some_dir && {
    command1
    command2
} || exit
popd
```
7 years ago
Frans de Jonge e5bcdee85e Add ShellCheck and shfmt shell code quality analysis (#2712)
* Add ShellCheck and shfmt shell code quality analysis

* kobo/koreader.sh: remove useless $PREFIX

* kobo/koreader.sh: fix rotation issue caused by #2731

* Travis: speed up (caching Luarocks should shave a minute off install process)
7 years ago
Qingping Hou 6b50a2783b kobo(fix): load wifi module by ENV
Aura One uses 8189fs instead of dhd module
7 years ago
poire-z 65881738b5 disable-wifi.sh: decreased sleep duration 7 years ago
poire-z 08a92de179 Fix: avoid system hang when disabling wifi (#2394) 8 years ago
Hzj_jie da2c57f93a Automatically connect WIFI after Kobo has been resumed (#2215)
* Add bash scripts to control WIFI / IP, so we can share them with frontend/device/kobo/device.lua.

* add test cases
8 years ago