From 2fd3b9559fd09e81217ec49f7e34b0839d802a1f Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Wed, 10 Jul 2019 15:44:40 +0200 Subject: [PATCH] ublox-gsm-config: Initialize sim switch line This line needs to be enable to connect the physical SIM first. Because it is only possible to detect if a physical SIM is present or not. The eSIM will always be shown as present, even if not configured. BugzID: 57829 --- .../ublox-gsm-config/files/ublox-gsm-config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes-connectivity/ublox-gsm-config/files/ublox-gsm-config.py b/recipes-connectivity/ublox-gsm-config/files/ublox-gsm-config.py index 899cb54..d0c049b 100755 --- a/recipes-connectivity/ublox-gsm-config/files/ublox-gsm-config.py +++ b/recipes-connectivity/ublox-gsm-config/files/ublox-gsm-config.py @@ -31,6 +31,11 @@ def execute_and_check(ser, cmd): sys.exit(-1) tries = 0 +def init_sim_sw(): + line = gpiod.find_line('SIM_SW') + line.request(consumer='ublox-config', type=gpiod.LINE_REQ_DIR_OUT) + line.set_value(1) + def switch_sim(): line = gpiod.find_line('SIM_SW') line.request(consumer='ublox-config', type=gpiod.LINE_REQ_DIR_OUT) @@ -153,7 +158,7 @@ def help(): def main(): line = gpiod.find_line('GSM_SUP_EN') line.request(consumer='ublox-config', type=gpiod.LINE_REQ_DIR_OUT) - + init_sim_sw() if len(sys.argv) == 2: if sys.argv[1] == 'stop': return poweroff(line)