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
This commit is contained in:
Alexandre Bard 2019-07-10 15:44:40 +02:00
parent 661ed9e904
commit 2fd3b9559f
1 changed files with 6 additions and 1 deletions

View File

@ -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)