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