gjdwebserver-overlay/net-misc/eg25-manager/files/18-fix.patch

102 lines
5.3 KiB
Diff
Raw Normal View History

2021-07-01 11:02:55 +02:00
diff --git a/data/pine64,pinephone-1.0.toml b/data/pine64,pinephone-1.0.toml
index e127f1a..5269fc2 100644
--- a/data/pine64,pinephone-1.0.toml
+++ b/data/pine64,pinephone-1.0.toml
@@ -39,8 +39,8 @@ configure = [
{ cmd = "QCFG", subcmd = "risignaltype", expect = "\"physical\"" },
{ cmd = "QCFG", subcmd = "ims", expect = "1" },
{ cmd = "QCFG", subcmd = "urc/ri/ring", expect = "\"pulse\",2000,1000,5000,\"off\",1" },
- { cmd = "QCFG", subcmd = "urc/ri/smsincoming", expect = "\"pulse\",2000" },
- { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1" },
+ { cmd = "QCFG", subcmd = "urc/ri/smsincoming", expect = "\"pulse\",2000,1" },
+ { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1,1" },
{ cmd = "QCFG", subcmd = "urc/delay", expect = "1" },
{ cmd = "QURCCFG", subcmd = "urcport", expect = "\"all\"" },
{ cmd = "QSCLK", value = "1" },
@@ -62,6 +62,15 @@ configure = [
{ cmd = "QGPSCFG", subcmd = "galileonmeatype", expect = "0" },
{ cmd = "QGPSCFG", subcmd = "beidounmeatype", expect = "0" },
{ cmd = "QGPSCFG", subcmd = "autogps", expect = "0" },
+# Reset modem-power configurations to what we expect
+ { cmd = "QCFG", subcmd = "urc/cache", expect = "0" },
+ { cmd = "QCFG", subcmd = "fast/poweroff", expect = "1" },
+ { cmd = "QCFG", subcmd = "apready", expect = "0,0,500" },
+ { cmd = "QCFG", subcmd = "sleepind/level", expect = "0" },
+ { cmd = "QCFG", subcmd = "wakeupin/level", expect = "0,0" },
+ { cmd = "QCFG", subcmd = "ApRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "ModemRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "urc/ri/pin", expect = "uart_ri" },
]
suspend = [
]
diff --git a/data/pine64,pinephone-1.1.toml b/data/pine64,pinephone-1.1.toml
index e127f1a..c2ee8bd 100644
--- a/data/pine64,pinephone-1.1.toml
+++ b/data/pine64,pinephone-1.1.toml
@@ -39,11 +39,20 @@ configure = [
{ cmd = "QCFG", subcmd = "risignaltype", expect = "\"physical\"" },
{ cmd = "QCFG", subcmd = "ims", expect = "1" },
{ cmd = "QCFG", subcmd = "urc/ri/ring", expect = "\"pulse\",2000,1000,5000,\"off\",1" },
- { cmd = "QCFG", subcmd = "urc/ri/smsincoming", expect = "\"pulse\",2000" },
- { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1" },
+ { cmd = "QCFG", subcmd = "urc/ri/smsincoming", expect = "\"pulse\",2000,1" },
+ { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1,1" },
{ cmd = "QCFG", subcmd = "urc/delay", expect = "1" },
{ cmd = "QURCCFG", subcmd = "urcport", expect = "\"all\"" },
{ cmd = "QSCLK", value = "1" },
+# Reset modem-power configurations to what we expect
+ { cmd = "QCFG", subcmd = "urc/cache", expect = "0" },
+ { cmd = "QCFG", subcmd = "fast/poweroff", expect = "1" },
+ { cmd = "QCFG", subcmd = "apready", expect = "0,0,500" },
+ { cmd = "QCFG", subcmd = "sleepind/level", expect = "0" },
+ { cmd = "QCFG", subcmd = "wakeupin/level", expect = "0,0" },
+ { cmd = "QCFG", subcmd = "ApRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "ModemRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "urc/ri/pin", expect = "uart_ri" },
# GNSS configuration:
# * Enable A-GPS data upload support (XTRA)
# * Disable On-Demand-Positioning (ODP) mode
diff --git a/data/pine64,pinephone-1.2.toml b/data/pine64,pinephone-1.2.toml
index e16f4f5..a45c7ec 100644
--- a/data/pine64,pinephone-1.2.toml
+++ b/data/pine64,pinephone-1.2.toml
@@ -36,8 +36,20 @@ configure = [
{ cmd = "QCFG", subcmd = "risignaltype", expect = "\"physical\"" },
{ cmd = "QCFG", subcmd = "ims", expect = "1" },
{ cmd = "QCFG", subcmd = "apready", expect = "1,0,500" },
+ { cmd = "QCFG", subcmd = "urc/ri/ring", expect = "\"pulse\",120,1000,5000,\"off\",1" },
+ { cmd = "QCFG", subcmd = "urc/ri/smsincoming", expect = "\"pulse\",120,1" },
+ { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1,1" },
+ { cmd = "QCFG", subcmd = "urc/delay", expect = "0" },
{ cmd = "QURCCFG", subcmd = "urcport", expect = "\"all\"" },
{ cmd = "QSCLK", value = "1" },
+# Reset modem-power configurations to what we expect
+ { cmd = "QCFG", subcmd = "urc/cache", expect = "0" },
+ { cmd = "QCFG", subcmd = "fast/poweroff", expect = "1" },
+ { cmd = "QCFG", subcmd = "sleepind/level", expect = "0" },
+ { cmd = "QCFG", subcmd = "wakeupin/level", expect = "0,0" },
+ { cmd = "QCFG", subcmd = "ApRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "ModemRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "urc/ri/pin", expect = "uart_ri" },
# GNSS configuration:
# * Enable A-GPS data upload support (XTRA)
# * Disable On-Demand-Positioning (ODP) mode
diff --git a/src/at.c b/src/at.c
index f694507..7c5f092 100644
--- a/src/at.c
+++ b/src/at.c
@@ -222,7 +222,12 @@ static gboolean modem_response(gint fd,
else if (strstr(response, "QGPSURC: \"xtradataexpire\""))
gnss_upload_assistance_data(manager);
/* AT command failed, retry */
- else if (strstr(response, "ERROR"))
+ /*
+ * QCFG="fast/poweroff" configuration is only available in
+ * newer firmware versions
+ */
+ else if (strstr(response, "ERROR") && !strstr(response, "fast/poweroff"))
+
retry_at_command(manager);
/*
* Successfull AT responses contain 'OK', except for AT+QFUPL which also