Skip to content

Commit

Permalink
[Cervantes]: wifi fix & misc improvements. (#4341)
Browse files Browse the repository at this point in the history
* remove unused setting 'internal_storage_mount_point

use filemanagerutil.getDefaultDir() instead
https://github.com/koreader/koreader/blob/master/frontend/apps/filemanager/filemanagerutil.lua#L15

* more info about device frontlight/naturalLight capabilities

* make stock reader fonts available in KOReader

* remove restore-wifi-async leftovers

* wireless: fix wpa_supplicant configuration:

make it compatible w/ debian wheezy binaries
don't try to run enable-wifi.sh more than once
  • Loading branch information
pazos authored and Frenzie committed Nov 16, 2018
1 parent 32ccada commit 6a84413
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 33 deletions.
14 changes: 7 additions & 7 deletions frontend/device/cervantes/device.lua
Expand Up @@ -30,39 +30,40 @@ local Cervantes = Generic:new{
touch_switch_xy = true,
touch_mirrored_x = true,
touch_probe_ev_epoch_time = true,
hasNaturalLight = no,
hasOTAUpdates = yes,
hasKeys = yes,
internal_storage_mount_point = "/mnt/public/",

-- all devices, except the original Cervantes Touch, have frontlight
hasFrontlight = yes,

-- currently only Cervantes 4 has coloured frontlight
hasNaturalLight = no,
}
-- Cervantes Touch
local CervantesTouch = Cervantes:new{
model = "CervantesTouch",
display_dpi = 167,
hasFrontlight = no,
}
-- Cervantes TouchLight / Fnac Touch Plus
local CervantesTouchLight = Cervantes:new{
model = "CervantesTouchLight",
display_dpi = 167,
hasFrontlight = yes,
}
-- Cervantes 2013 / Fnac Touch Light
local Cervantes2013 = Cervantes:new{
model = "Cervantes2013",
display_dpi = 212,
hasFrontlight = yes,
}
-- Cervantes 3 / Fnac Touch Light 2
local Cervantes3 = Cervantes:new{
model = "Cervantes3",
display_dpi = 300,
hasFrontlight = yes,
}
-- Cervantes 4
local Cervantes4 = Cervantes:new{
model = "Cervantes4",
display_dpi = 300,
hasFrontlight = yes,
hasNaturalLight = yes,
frontlight_settings = {
frontlight_white = "/sys/class/backlight/lm3630a_ledb",
Expand Down Expand Up @@ -169,7 +170,6 @@ function Cervantes:initNetworkManager(NetworkMgr)
os.execute("./release-ip.sh")
end
function NetworkMgr:restoreWifiAsync()
os.execute("./restore-wifi-async.sh")
end
function NetworkMgr:isWifiOn()
return 1 == isConnected()
Expand Down
9 changes: 3 additions & 6 deletions platform/cervantes/disable-wifi.sh
@@ -1,9 +1,6 @@
#!/bin/sh

# disable wifi and remove all modules
killall udhcpc default-script wpa_supplicant 2>/dev/null
ifconfig eth0 down

if lsmod | grep -q 8189fs; then
modprobe -r 8189fs
fi
killall udhcpc wpa_supplicant 2>/dev/null
ifconfig eth0 down 2>/dev/null
modprobe -r 8189fs 2>/dev/null
18 changes: 8 additions & 10 deletions platform/cervantes/enable-wifi.sh
@@ -1,13 +1,12 @@
#!/bin/sh
WPA_SUPPLICANT_CONF="/mnt/private/koreader/wpa_supplicant.conf"
CTRL_INTERFACE="/var/run/wpa_supplicant"

# create a new configuration if neccesary.
if [ ! -f "$WPA_SUPPLICANT_CONF" ]; then
echo "ctrl_interface=${CTRL_INTERFACE}" >"$WPA_SUPPLICANT_CONF"
echo "update_config=1" >>"$WPA_SUPPLICANT_CONF"
sync
fi
# Debian Wheezy ships an old wpa_supplicant binary (1.0.3). Please refer to
# https://manpages.debian.org/wheezy/wpasupplicant/wpa_supplicant.8.en.html
# to see which command line options are available.

# Do not run this script twice (ie: when no wireless is available or wireless
# association to ap failed.
./disable-wifi.sh

if ! lsmod | grep -q 8189fs; then
modprobe 8189fs
Expand All @@ -17,5 +16,4 @@ fi
ifconfig eth0 up
sleep 1

pidof wpa_supplicant >/dev/null \
|| wpa_supplicant -i eth0 -s -O "$CTRL_INTERFACE" -c "$WPA_SUPPLICANT_CONF" -B -D wext 2>/dev/null
wpa_supplicant -i eth0 -C /var/run/wpa_supplicant -B -D wext 2>/dev/null
3 changes: 3 additions & 0 deletions platform/cervantes/koreader.sh
Expand Up @@ -61,6 +61,9 @@ export TESSDATA_PREFIX="data"
# export dict directory
export STARDICT_DATA_DIR="data/dict"

# export external font directory
export EXT_FONT_DIR="/usr/lib/fonts"

# we keep at most 500k worth of crash log
if [ -e crash.log ]; then
tail -c 500000 crash.log >crash.log.new
Expand Down
10 changes: 0 additions & 10 deletions platform/cervantes/restore-wifi-async.sh

This file was deleted.

0 comments on commit 6a84413

Please sign in to comment.