Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-27-2024, 07:29 AM   #1
kobotouch2711
Member
kobotouch2711 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2024
Device: Kobo Touch
Kobo Touch Browser for permanent Display - Wifi issues

Dear all,

I would like to use my old Kobo touch as permanent display for a DIY weather station. In short, I would like to display a (local) HTML page in the built-in browser, which refreshes every minute.
I already activated "Force Wifi on" in Nickel Menu and/or Developer options. However, Wifi is lost randomly. As a consequence, the webpage is "stuck" and does not refresh anymore. Manual refresh is necessary.
I have a small bash script running (installed via telnet), which frequently turns on and off the wifi
Code:
#Interface name of your WiFi adapter
INTERFACE="wlan0"

# Endless loop
while true
do
    echo "Disabling WiFi..."
    ifconfig $INTERFACE down
    sleep 9

    echo "Enabling WiFi..."
    ifconfig $INTERFACE up
    sleep 60
done
However, the webpage sometimes gets "stuck" and does not refresh anymore. I assume, this is when Wifi is by coincidence down during refresh.


My question:
- does anyone have further clues, how to improve the Wifi connectivity?
- would an alternative browser maybe be an option? Are there any instructions?
kobotouch2711 is offline   Reply With Quote
Old 11-28-2024, 03:46 AM   #2
kobotouch2711
Member
kobotouch2711 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2024
Device: Kobo Touch
as this might be better off in the "Kobo Developer's Corner":
(how) am I able to move this thread?
kobotouch2711 is offline   Reply With Quote
Advert
Old 11-28-2024, 12:31 PM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,181
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Consider your request as asked and done.
DNSB is offline   Reply With Quote
Old 11-28-2024, 02:36 PM   #4
elinkser
Addict
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 239
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
Sounds like previous projects...just a quick browse down mobileread lane gives:



https://www.mobileread.com/forums/sh...d.php?t=359178


https://www.mobileread.com/forums/sh...d.php?t=357690


https://www.mobileread.com/forums/sh...d.php?t=352789


Someone suggested to just keep one rendered image in Screenshot folder, image persists while power off, then you update by replacing it when you power on?

Last edited by elinkser; 11-28-2024 at 02:47 PM.
elinkser is offline   Reply With Quote
Old 11-30-2024, 01:19 PM   #5
kobotouch2711
Member
kobotouch2711 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2024
Device: Kobo Touch
Thanks a lot for the feedback. As my solution works quite well - except for the Wifi issues, I would like to dig a bit deeper here.
The following would help me:
Does anyone have a clue, how to
- autostart the browser in fullscreen mode on reboot? (what is the console command?)
- automatically set the orientation to inverted_landscape on reboot?(what is the console command?)

Then I would simply reboot, when the issues occur. This usually helps.

Many thanks in advance.

Last edited by kobotouch2711; 11-30-2024 at 01:21 PM.
kobotouch2711 is offline   Reply With Quote
Advert
Old 12-01-2024, 09:15 AM   #6
elinkser
Addict
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 239
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
No problem!
I wasn't sure how relevant it was, but I recall the WiFi issue coming up in at least one of those cases:
https://www.mobileread.com/forums/sh...d.php?t=352896


It looks like NickelDBus has the browser function.
https://shermp.github.io/NickelDBus/ndb-ndbdbus.html

Maybe you or the author can add the screen orientation function by recompiling with the NickelTC and using the NickelMenu code as guide?

Then we would all benefit from the new feature!

* other possibilies:
use Kobo patch approach?
render web page in fbpdf instead of browser (I compiled a binary, but you need to convert web page to epub or image if you want the images - at that point probably simpler just to render to image,lol
https://github.com/aligrudi/fbpdf
https://www.mobileread.com/forums/sh...2&postcount=16

Last edited by elinkser; 12-01-2024 at 09:38 AM.
elinkser is offline   Reply With Quote
Old 12-02-2024, 05:15 AM   #7
kobotouch2711
Member
kobotouch2711 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2024
Device: Kobo Touch
Thanks a lot. Unfortunately, recompiling currently is too much for my skills

Could you assist me, how to automatically load this script.

I generated in /etc/init.d/startbrowser.sh (with chmod +x permissions).
However, this is not automatically loaded on reboot. Where do I have to register this script?

Code:
#!/bin/bash

. /etc/init.d/functions
   
start() {
	qndb -m bwmOpenBrowser &
}
   
stop() {
        echo "nothing executed at stop" &
}
   
case "$1" in 
    start)
       start
       ;;
    stop)
       stop
       ;;
    restart)
       stop
       start
       ;;
    status)
 
       ;;
    *)
       echo "Usage: $0 {start|stop|status|restart}"
esac
   
exit 0
Executing manually works.

Last edited by kobotouch2711; 12-02-2024 at 05:17 AM. Reason: formatting
kobotouch2711 is offline   Reply With Quote
Old 12-02-2024, 12:01 PM   #8
elinkser
Addict
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 239
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
The WiFi issues, I think the other projects just added a delay.
Another one:
https://www.mobileread.com/forums/sh...d.php?t=322162

Same would apply to NickelDBus scripts I imagine.
E.g. instead of invoking it directly, call another script (e.g."/usr/local/bin/myscript.sh &") that does a "sleep 100" or something before it invokes the NickelDBus command.


I saw an example done using udev.
https://www.mobileread.com/forums/sh...1&postcount=29

https://www.tutorialspoint.com/how-t...-on-udev-event

Last edited by elinkser; 12-02-2024 at 12:04 PM.
elinkser is offline   Reply With Quote
Old 12-02-2024, 02:30 PM   #9
kobotouch2711
Member
kobotouch2711 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2024
Device: Kobo Touch
Thanks for your efforts. I cannot image, where to put a delay with my problem. Once the browser is loaded, javascript refreshes the page every 20s on its own. However, after a few hours, Wifi connection is dropped (and obviously lost permanently) and the webpage "freezes".

Concerning autostart on boot with udev. My approach was the following, but it fails
"/etc/udev/rules.d/99-mmcblk0p3-autostart.rules ":
Code:
KERNEL=="mmcblk0p3", ACTION=="add", RUN+="/etc/init.d/startbrowser.sh start"
Is there really no other way? What does the crontab-return: "applet not found" mean by the way? Any way to use cron?
kobotouch2711 is offline   Reply With Quote
Old 12-02-2024, 04:29 PM   #10
elinkser
Addict
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 239
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
# cat /etc/udev/rules.d/99-mmc.rules
Code:
KERNEL=="loop0", RUN+="/bin/sh /etc/init.d/startbrowser.sh &"
# cat /etc/init.d/startbrowser.sh
Code:
/bin/touch /mnt/onboard/.adds/hi0
sleep 20
/bin/touch /mnt/onboard/.adds/hi20
# reboot

# cd /mnt/onboard/.adds/

# ls hi*
hi0

# ls hi*
hi0

# ls hi*
hi0 hi20
elinkser is offline   Reply With Quote
Old 12-03-2024, 03:19 AM   #11
kobotouch2711
Member
kobotouch2711 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2024
Device: Kobo Touch
Quote:
Originally Posted by elinkser View Post
# cat /etc/udev/rules.d/99-mmc.rules
Code:
KERNEL=="loop0", RUN+="/bin/sh /etc/init.d/startbrowser.sh &"
# cat /etc/init.d/startbrowser.sh
Code:
/bin/touch /mnt/onboard/.adds/hi0
sleep 20
/bin/touch /mnt/onboard/.adds/hi20
# reboot

# cd /mnt/onboard/.adds/

# ls hi*
hi0

# ls hi*
hi0

# ls hi*
hi0 hi20
Nope, unfortunately not working. No hi*-files in .adds.
FYI: My mount looks like the following:
Code:
[root@kobo .adds]# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext4 (rw,noatime,nodiratime,barrier=1,data=ordered)
none on /proc type proc (rw,relatime)
none on /tmp type tmpfs (rw,relatime)
none on /dev type tmpfs (rw,relatime)
none on /var/lib type tmpfs (rw,relatime,size=16k)
none on /var/log type tmpfs (rw,relatime,size=16k)
none on /var/run type tmpfs (rw,relatime,size=128k)
none on /sys type sysfs (rw,relatime)
/dev/mmcblk0p3 on /mnt/onboard type vfat (rw,noatime,nodiratime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
kobotouch2711 is offline   Reply With Quote
Old 12-03-2024, 05:37 AM   #12
kobotouch2711
Member
kobotouch2711 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2024
Device: Kobo Touch
Sorry for starting "a new topic" within this thread, but i realized a very odd behaviour.

I currently run the following script on my kobo
Code:
#your Wi-Fi network details
LOG_FILE="/my2job.log"
log_message() {
     local MESSAGE="$@"
      echo "$(date +"%Y-%m-%d %H:%M:%S") : $MESSAGE" >> "$LOG_FILE"
 }

INTERFACE="wlan0"

# The IP address to ping
HOST="192.168.0.1"

# Function to reconnect to Wi-Fi
reconnect_wifi() {
    log_message "Host is not reachable. Reconnecting to WiFi"
    echo "Host $HOST is not reachable. Reconnecting to Wi-Fi..."
/usr/bin/qndb -m wfmSetAirplaneMode toggle; 
    log_message "Airplane toggle (WIFI to off). Now sleep for 10s"
    echo "Airplane toggle (WIFI to off). Now sleep for 10s"
sleep 10 ; 
/usr/bin/qndb -m wfmSetAirplaneMode toggle ; 
    log_message "Airplane toggle (WIFI to on). Now sleep for 10s"
    echo "Airplane toggle (WIFI to on). Now sleep for 10s"
sleep 10; 
/usr/bin/qndb -m wfmConnectWirelessSilently;
    log_message "1st attempt to connect wirelessly."
    echo "1st attempt to connect wirelessly."
sleep 20; 
/usr/bin/qndb -m wfmConnectWirelessSilently;
    log_message "2nd attempt to connect wirelessly."
    echo "2nd attempt to connect wirelessly."
sleep 20; 
/usr/bin/qndb -m wfmConnectWirelessSilently;
    log_message "3rd attempt to connect wirelessly."
    echo "3rd attempt to connect wirelessly."

    log_message "Wifi hopefully reconnected. Starting browser and sleep for 5s"
    echo "Wifi hopefully reconnected. Starting browser and sleep for 5s"
/usr/bin/qndb -m bwmOpenBrowser;
sleep 5;
}

while true; do
    # Ping the host
    ping -c 1 $HOST > /dev/null 2>&1
    # Check the ping result
    if [ $? -ne 0 ]; then
        reconnect_wifi
    else
        echo "Host $HOST is reachable."
    fi

    # Wait for 10 seconds before the next ping
    sleep 10
done
And the funny thing now happens in the logfile:
Code:
2024-12-03 10:48:29 : Host is not reachable. Reconnecting to WiFi
2024-12-03 10:48:29 : Airplane toggle (WIFI to off). Now sleep for 10s
2024-12-03 11:26:00 : Airplane toggle (WIFI to on). Now sleep for 10s
2024-12-03 11:26:59 : 1st attempt to connect wirelessly.
2024-12-03 11:27:19 : 2nd attempt to connect wirelessly.
2024-12-03 11:27:39 : 3rd attempt to connect wirelessly.
2024-12-03 11:27:39 : Wifi hopefully reconnected. Starting browser and sleep for 10s
The webpage was frozen at 10:48 obviously. At 11:26 I manually hit the Home Button on the device and on the Wifi Icon, which forced Kobo to "wake up" again and reconnected to the Wifi and open the browser.

Now the most interesting question: Does anyone have a clue, why Kobo keeps sleeping "forever" after the first Airplane toggle until I hit the home button?

If i fixed this, there is hopefully no need to restart device and autostart the browser on startup as in the previous post.
By the way: I assume heavily, that this is the same "freeze" as in the script from my first post.

Last edited by kobotouch2711; 12-03-2024 at 05:40 AM.
kobotouch2711 is offline   Reply With Quote
Old 12-03-2024, 05:46 AM   #13
kobotouch2711
Member
kobotouch2711 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2024
Device: Kobo Touch
Quote:
Originally Posted by kobotouch2711 View Post

Now the most interesting question: Does anyone have a clue, why Kobo keeps sleeping "forever" after the first Airplane toggle until I hit the home button?

I could reproduce and must refine:

Now the most interesting question: Does anyone have a clue, why Kobo keeps sleeping "forever" after the first Airplane toggle until I open the WIFI menu "by hand"? (only opening, not selecting any network on my own)
kobotouch2711 is offline   Reply With Quote
Old 12-03-2024, 12:18 PM   #14
elinkser
Addict
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 239
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
Sounds like you will have to poke around a bit.

A fun experiment would be to send virtual touch events to your device to simulate the effect of the buttons.
elinkser is offline   Reply With Quote
Old 12-03-2024, 03:27 PM   #15
kobotouch2711
Member
kobotouch2711 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2024
Device: Kobo Touch
Quote:
Originally Posted by elinkser View Post
Sounds like you will have to poke around a bit.

A fun experiment would be to send virtual touch events to your device to simulate the effect of the buttons.
How could I send these virtual events? Usually, the freezes occur, when Wifi is dead, so Telnet is not possible. Moreover, what would be such commands to implement e.g. in the script.


And feedback in the udev issue?
kobotouch2711 is offline   Reply With Quote
Reply

Tags
browser, kobo-touch, wifi


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting battery, Wifi, and display issues PaulB223 Amazon Kindle 0 08-17-2022 10:41 AM
Diagnosing Kobo touch issues [non-responsive to touch] emacsomancer Kobo Reader 4 02-21-2021 10:12 AM
Kobo wifi PNG display AMB-ereader Kobo Developer's Corner 10 03-21-2016 07:56 PM
Kobo touch WIFI permanent aktivieren koboman Andere Lesegeräte 0 09-08-2012 05:51 AM
Touch - Cover display issues resolved at last Hoods7070 Kobo Reader 0 05-20-2012 06:26 AM


All times are GMT -4. The time now is 04:30 PM.


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