parent
40aca5599e
commit
b98dbc71a3
|
|
@ -12,14 +12,6 @@ SERIAL_DEV = '/dev/ttyACM0'
|
|||
WWAN_DEV = '/sys/class/net/wwan0'
|
||||
SIM_CONFIG = '/etc/sim.conf'
|
||||
APN_CONFIG = '/etc/apn.conf'
|
||||
GPIO_PATH = '/sys/class/gpio/'
|
||||
GPIO_SIM_SW = '44'
|
||||
APN_CONFIG = '/etc/apn.conf'
|
||||
|
||||
def write_to_file(file, value):
|
||||
f = open(file, 'w')
|
||||
f.write(value)
|
||||
f.close()
|
||||
|
||||
def execute_and_check(ser, cmd):
|
||||
tries = 0
|
||||
|
|
@ -40,9 +32,9 @@ def execute_and_check(ser, cmd):
|
|||
tries = 0
|
||||
|
||||
def switch_sim():
|
||||
write_to_file(GPIO_PATH + 'export', GPIO_SIM_SW)
|
||||
write_to_file(GPIO_PATH + 'gpio' + GPIO_SIM_SW + '/direction', 'out')
|
||||
write_to_file(GPIO_PATH + 'gpio' + GPIO_SIM_SW + '/value', '0')
|
||||
line = gpiod.find_line('SIM_SW')
|
||||
line.request(consumer='ublox-config', type=gpiod.LINE_REQ_DIR_OUT)
|
||||
line.set_value(0)
|
||||
|
||||
def sim_present(ser):
|
||||
cmd = b'AT+CCID?'
|
||||
|
|
|
|||
Loading…
Reference in New Issue