|
|
#1 |
|
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Nov 2021
Device: Paperwhite 3 (7th gen)
|
I'm trying to follow this thread https://www.mobileread.com/forums/sh...d.php?t=236104 . For reference, here is their wait routine:
Code:
wait_for () {
# calculate the time we should return
ENDWAIT=$(( $(currentTime) + $1 ))
# disable/reset current alarm
echo 0 > /sys/class/rtc/rtc$RTC/wakealarm
# set new alarm
echo $ENDWAIT > /sys/class/rtc/rtc$RTC/wakealarm
# check whether we could set the alarm successfully
if [ $ENDWAIT -eq `cat /sys/class/rtc/rtc$RTC/wakealarm` ]; then
logger "Start waiting for timeout ($1 seconds)"
# wait for timeout to expire
while [ $(currentTime) -lt $ENDWAIT ]; do
REMAININGWAITTIME=$(( $ENDWAIT - $(currentTime) ))
if [ 0 -lt $REMAININGWAITTIME ]; then
# wait for device to suspend or to resume - this covers the sleep period during which the
# time counting does not work reliably
logger "Starting to wait for timeout to expire"
lipc-wait-event -s $REMAININGWAITTIME com.lab126.powerd wakeupFromSuspend,resuming || true
fi
done
logger "Finished waiting"
else
logger "Failure setting alarm on rtc$RTC, wanted $ENDWAIT, got `cat /sys/class/rtc/rtc$RTC/wakealarm`"
fi
# not sure whether this is required
lipc-set-prop com.lab126.powerd -i deferSuspend 1
}
Code:
cd "$(dirname "$0")"
source /mnt/us/extensions/onlinescreensaver/bin/utils.sh
source /mnt/us/extensions/onlinescreensaver/bin/config.sh
LOGFILE=/tmp/test.log
RTC=1
logger "Start Wait"
wait_for 300
logger "Wake"
logger "wpa_cli reassociate $(wpa_cli -i wlan0 reassociate)"
WLANFAIL=0
WLANCOUNTER=0
wait_wlan(){
return $(lipc-get-prop com.lab126.wifid cmState | grep CONNECTED | wc -l)
}
while wait_wlan; do
if [ ${WLANCOUNTER} -eq 10 ]; then
log_network
logger "wpa_cli disconnect: $(wpa_cli -i wlan0 disconnect)"
logger "wpa_cli reconnect: $(wpa_cli -i wlan0 reconnect)"
fi
if [ ${WLANCOUNTER} -eq 30 ]; then
log_network
logger "wifid disable $(lipc-set-prop com.lab126.wifid enable 0)"
logger "wifid enable $(lipc-set-prop com.lab126.wifid enable 1)"
fi
if [ ${WLANCOUNTER} -eq 50 ]; then
log_network
logger "wpa_cli reassociate $(wpa_cli -i wlan0 reassociate)"
fi
if [ ${WLANCOUNTER} -eq 60 ]; then
log_network
WLANFAIL=1
logger "WLAN failed"
break
fi
let WLANCOUNTER=WLANCOUNTER+1
logger "Waiting for WLAN ${WLANCOUNTER}"
sleep 1
done
Code:
NET ifconfig > wlan0 Link encap:Ethernet HWaddr FC:A6:67:85:7A:DD UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:27481 errors:3 dropped:4338 overruns:0 frame:3 TX packets:10808 errors:9 dropped:0 o verruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:7240800 (6.9 MiB) TX bytes:1435062 (1.3 MiB) NET wifid cmState > NA NET wifid signalStrength > NET wpa_cli status > Selected interface 'wlan0' bssid=ac:84:c6:2a:12:db ssid=REDACTED id=1 mode=station pairwise_cipher=CCMP group_cipher=TKIP key_mgmt=WPA2-PSK wpa_state=COMPLETED address=fc:a 6:67:85:7a:dd |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Kobo ClaraHD not waking from sleep | jasius | KOReader | 11 | 11-05-2021 01:14 PM |
| Aura HD Issues waking from sleep mode | omro | Kobo Reader | 8 | 04-30-2018 10:50 PM |
| Color prospective buyer question: NOOK Color reconnecting to wifi after waking from sleep? | readabit | Nook Color & Nook Tablet | 8 | 03-24-2012 07:15 PM |
| Problems waking Vox from sleep | cristovao | Kobo Tablets | 51 | 11-10-2011 12:20 PM |
| Troubleshooting Kindle 2 frequently freezes when waking from sleep | addictedtoblue | Amazon Kindle | 1 | 07-18-2010 05:26 PM |