Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/sbin/route deprecated - infinite attemps to connect to wifi on newer linux distributions #10087

Closed
prahal opened this issue Feb 6, 2023 · 12 comments
Labels
Milestone

Comments

@prahal
Copy link

prahal commented Feb 6, 2023

  • KOReader version: 2023.01
  • Device: Debian bullseye/bookworm mix

Issue

I cannot connect to OPDS or Calibre wifi. I get the popup "Turn on Wifi". The PC is connected via ethernet but that should be fine.
But I do not have net-tools /sbin/route which is deprecated for quite a while. The call is from

local std_out = io.popen([[/sbin/route -n | awk '$4 == "UG" {print $2}' | tail -n 1]], "r")
. Installing net-tools on Debian allow me to access OPDS server and al.

So for now the koreader deb should depend on net-tools.
Then a fix should be sorted out to get the default gateway without net-tools /sbin/route (maybe as a fallback for newer devices).

Steps to reproduce

  1. Start koreader
  2. Go to Search > OPDS Catalogs > Select a configured OPDS Catalog
  3. A popup asking if we should turn on wifi is shown
  4. On the next attempt the popup is shown again
crash.log (if applicable)

crash.log is a file that is automatically created when KOReader crashes. It can normally be found in the KOReader directory:

 $ ip r
default via 192.168.10.1 dev enp1s0 proto dhcp src 192.168.10.175 metric 100 
192.168.10.0/24 dev enp1s0 proto kernel scope link src 192.168.10.175 metric 100 
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 94:c6:91:81:84:93 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.175/24 brd 192.168.10.255 scope global dynamic noprefixroute enp1s0
       valid_lft 63515sec preferred_lft 63515sec
    inet6 fc00:10::2dae:43de:f733:44f/64 scope global dynamic noprefixroute 
       valid_lft 86332sec preferred_lft 86332sec
    inet6 fe80::d940:9d38:3d7f:202b/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: bridge0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether da:53:8b:92:f3:3e brd ff:ff:ff:ff:ff:ff
$ nm-online 
Connexion...............   30s [online]
$ LC_ALL=en_US.UTF-8 nmcli g
STATE      CONNECTIVITY  WIFI-HW  WIFI     WWAN-HW  WWAN    
connected  full          missing  enabled  missing  enabled 
$ LC_ALL=en_US.UTF-8 nmcli n
enabled
$ LC_ALL=en_US.UTF-8 nmcli d
DEVICE             TYPE      STATE                                  CONNECTION          
enp1s0             ethernet  connected                              Connexion filaire 2 
bridge0            bridge    connecting (getting IP configuration)  Connexion pont 1    
34:2E:B6:8B:5E:E4  bt        disconnected                           --                  
88:03:E9:6D:0D:34  bt        disconnected                           --                  
lo                 loopback  unmanaged      
koreader verbose output without net-tools and selecting an OPDS catalog
koreader  -v
---------------------------------------------
                launching...
  _  _____  ____                _
 | |/ / _ \|  _ \ ___  __ _  __| | ___ _ __
 | ' / | | | |_) / _ \/ _` |/ _` |/ _ \ '__|
 | . \ |_| |  _ <  __/ (_| | (_| |  __/ |
 |_|\_\___/|_| \_\___|\__,_|\__,_|\___|_|

 It's a scroll... It's a codex... It's KOReader!

 [*] Current time: 02/06/23-18:51:26
 [*] Version: v2023.01

ffi.load: libs/libutf8proc.so.2
ffi.load: blitbuffer
ffi.load: SDL2
ffi.load: SDL2
Starting SDL in /usr/lib/koreader/
ffi.load: libs/liblodepng.so
02/06/23-18:51:27 INFO  initializing for device Linux 
02/06/23-18:51:27 INFO  framebuffer resolution: {
  h = 800,
  w = 600
} --[[table: 0x7fc68cf2a8a0]] 
ffi.load: libs/libmupdf.so
ffi.load: libs/libwrap-mupdf.so
ffi.load: libs/libfreetype.so.6
ffi.load: libs/libharfbuzz.so.0
ffi.load: libs/libzstd.so.1
02/06/23-18:51:27 INFO  Loading plugins from directory: plugins 
ffi.load: sqlite3
02/06/23-18:51:28 INFO  Loading plugins from directory: /home/prahal/.config/koreader/plugins/ 
02/06/23-18:51:28 DEBUG triggering refresh {
  mode = "ui",
  region = "600x800+0+0"
} --[[table: 0x7fc67410b3d8]] 
02/06/23-18:51:30 DEBUG triggering refresh {
  mode = "flashui",
  region = "600x603+0+0"
} --[[table: 0x7fc667af1e90]] 
02/06/23-18:51:31 DEBUG triggering refresh {
  mode = "fast",
  region = "72x40+222+7"
} --[[table: 0x7fc667af9f98]] 
02/06/23-18:51:31 DEBUG triggering refresh {
  mode = "ui",
  region = "600x606+0+0"
} --[[table: 0x7fc6763a81f0]] 
02/06/23-18:51:32 DEBUG triggering refresh {
  mode = "fast",
  region = "590x44+5+508"
} --[[table: 0x7fc6763b3a68]] 
02/06/23-18:51:32 DEBUG triggering refresh {
  mode = "flashui",
  region = "600x800+0+0"
} --[[table: 0x7fc674029778]] 
02/06/23-18:51:34 DEBUG triggering refresh {
  mode = "fast",
  region = "600x50+0+48"
} --[[table: 0x7fc68cabba20]] 
sh: 1: /sbin/route: not found
02/06/23-18:51:34 DEBUG triggering refresh {
  mode = "ui",
  region = "600x50+0+48"
} --[[table: 0x7fc6751d2428]] 
02/06/23-18:51:34 DEBUG triggering refresh {
  mode = "ui",
  region = "474x114+63+343"
} --[[table: 0x7fc6762ad718]] 
02/06/23-18:51:36 DEBUG triggering refresh {
  mode = "fast",
  region = "224x40+300+408"
} --[[table: 0x7fc6762b2200]] 
02/06/23-18:51:36 DEBUG triggering refresh {
  mode = "ui",
  region = "464x75+68+373"
} --[[table: 0x7fc6762b6e20]] 
02/06/23-18:51:36 DEBUG triggering refresh {
  mode = "ui",
  region = "474x114+63+343"
} --[[table: 0x7fc6762bc598]] 
koreader verbose output with net-tools installed (same setup)
koreader -v
---------------------------------------------
                launching...
  _  _____  ____                _
 | |/ / _ \|  _ \ ___  __ _  __| | ___ _ __
 | ' / | | | |_) / _ \/ _` |/ _` |/ _ \ '__|
 | . \ |_| |  _ <  __/ (_| | (_| |  __/ |
 |_|\_\___/|_| \_\___|\__,_|\__,_|\___|_|

 It's a scroll... It's a codex... It's KOReader!

 [*] Current time: 02/06/23-18:58:24
 [*] Version: v2023.01

ffi.load: libs/libutf8proc.so.2
ffi.load: blitbuffer
ffi.load: SDL2
ffi.load: SDL2
Starting SDL in /usr/lib/koreader/
ffi.load: libs/liblodepng.so
02/06/23-18:58:25 INFO  initializing for device Linux 
02/06/23-18:58:25 INFO  framebuffer resolution: {
  h = 800,
  w = 600
} --[[table: 0x7fbd02118010]] 
ffi.load: libs/libmupdf.so
ffi.load: libs/libwrap-mupdf.so
ffi.load: libs/libfreetype.so.6
ffi.load: libs/libharfbuzz.so.0
ffi.load: libs/libzstd.so.1
02/06/23-18:58:25 INFO  Loading plugins from directory: plugins 
ffi.load: sqlite3
02/06/23-18:58:26 INFO  Loading plugins from directory: /home/prahal/.config/koreader/plugins/ 
02/06/23-18:58:26 DEBUG triggering refresh {
  mode = "ui",
  region = "600x800+0+0"
} --[[table: 0x7fbcd9d1df08]] 
02/06/23-18:58:27 DEBUG triggering refresh {
  mode = "flashui",
  region = "600x606+0+0"
} --[[table: 0x7fbcd947ae18]] 
02/06/23-18:58:29 DEBUG triggering refresh {
  mode = "fast",
  region = "590x44+5+508"
} --[[table: 0x7fbcd9486c18]] 
02/06/23-18:58:29 DEBUG triggering refresh {
  mode = "flashui",
  region = "600x800+0+0"
} --[[table: 0x7fbd0213a150]] 
02/06/23-18:58:31 DEBUG triggering refresh {
  mode = "fast",
  region = "600x50+0+48"
} --[[table: 0x7fbcda8cae88]] 
PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=0.368 ms

--- 192.168.10.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.368/0.368/0.368/0.000 ms
02/06/23-18:58:31 DEBUG triggering refresh {
  mode = "ui",
  region = "600x800+0+0"
} --[[table: 0x7fbcd998b408]] 
02/06/23-19:01:37 DEBUG triggering refresh {
  mode = "ui",
  region = "600x800+0+0"
} --[[table: 0x7fbcda9e6dc0]] 
02/06/23-19:01:38 DEBUG triggering refresh {
  mode = "flashui",
  region = "600x606+0+0"
} --[[table: 0x7fbcf6099418]] 

@NiLuJe
Copy link
Member

NiLuJe commented Feb 6, 2023

Possibly re: #8739

@Frenzie Frenzie added the Desktop label Feb 6, 2023
@Frenzie
Copy link
Member

Frenzie commented Feb 6, 2023

@NiLuJe Not quite, this is only the emulator should be doing this.

@NiLuJe
Copy link
Member

NiLuJe commented Feb 6, 2023

(Sidebar: care should be taken to check that any implementation behaves with busybox's implementation of said tools).

@prahal
Copy link
Author

prahal commented Feb 6, 2023

@NiLuJe indeed this MR removed the iproute2 support and switched to net-tools without taking into consideration that net-tools package is not installed on current distributions as it is deprecated. Still, I agree that having net-tools support for ancient devices is good.

@prahal
Copy link
Author

prahal commented Feb 6, 2023

Understood. @NiLuJe no the MR you showed is about the opposite: a code section that relies on iproute2 and that will require support for net-tools too (in frontend/device/generic/device.lua). My issue is about net-tools only code that do not support iproute2 (in frontend/ui/network/manager.lua).

@yparitcher
Copy link
Member

being addressed in #10062

@prahal
Copy link
Author

prahal commented Feb 7, 2023

@yparitcher indeed your MR will also fix my issue. Though you might want to merge mine first if yours is not merged in the current release (as yours does extensive changes and might require more time for review and approval).

yparitcher added a commit to yparitcher/koreader that referenced this issue Feb 7, 2023
cervantes kindle kobo remarkable: use sysfs carrier file to determine connection state

cleanup hasWifiManager checks

gateway check: use ip if available

Fixes: koreader#10087
Closes: koreader#10092
yparitcher added a commit to yparitcher/koreader that referenced this issue Feb 8, 2023
cervantes kindle kobo remarkable: use sysfs carrier file to determine connection state

cleanup hasWifiManager checks

gateway check: use ip if available

Fixes: koreader#10087
Closes: koreader#10092
@Frenzie Frenzie added this to the 2023.02 milestone Feb 8, 2023
@zephyros-dev
Copy link

I'm also having the same issue using WSL2 on Windows, with koreader installed from the .deb release

@Frenzie
Copy link
Member

Frenzie commented Jul 14, 2023

The same issue as what exactly? /sbin/route no longer occurs in the code since February.

@zephyros-dev
Copy link

I mean the same behavior of infinite attempts to connect to wifi when using the OPDS page, not the /sbin/route issue specifically. Maybe I should make a new issue since the cause is probably different?

@Frenzie
Copy link
Member

Frenzie commented Jul 14, 2023

Yes, that would be best since it's completely unrelated. Please include the output from ip.

@NiLuJe
Copy link
Member

NiLuJe commented Jul 14, 2023

You'll want to use a nightly, as I'm pretty sure I broke plain SDL (i.e., !Emu) networking between #10605 (which is in 2023.06.1) and #10669 (which isn't in a tagged release yet) ;).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants