This commit is contained in:
Your Name
2025-03-28 13:40:18 +01:00
parent 2d2f728bbc
commit e68b83496a
9 changed files with 62 additions and 143 deletions

View File

@@ -1,4 +1,10 @@
'''
____ _ ____ _
/ ___| / \ | _ \ / \
\___ \ / _ \ | |_) | / _ \
___) / ___ \| _ < / ___ \
|____/_/ \_\_| \_\/_/ \_\
Script to connect SARA-R410 to APN
AT+CGDCONT=1,"IP","data.mono"
@@ -16,22 +22,8 @@ apn_address = parameter[1] # ex: data.mono
timeout = float(parameter[2]) # ex:2
#get baudrate
def load_config(config_file):
try:
with open(config_file, 'r') as file:
config_data = json.load(file)
return config_data
except Exception as e:
print(f"Error loading config file: {e}")
return {}
baudrate = 9600
# Define the config file path
config_file = '/var/www/moduleair_pro_4g/config.json'
# Load the configuration data
config = load_config(config_file)
# Access the shared variables
baudrate = config.get('SaraR4_baudrate', 115200)
ser = serial.Serial(
port=port, #USB0 or ttyS0