update
This commit is contained in:
@@ -25,23 +25,8 @@ url = parameter[1] # ex: data.mobileair.fr
|
|||||||
|
|
||||||
profile_id = 3
|
profile_id = 3
|
||||||
|
|
||||||
#get baudrate
|
baudrate = 115200
|
||||||
def load_config(config_file):
|
send_uSpot = False
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_pro_4g/config.json'
|
|
||||||
# Load the configuration data
|
|
||||||
config = load_config(config_file)
|
|
||||||
# Access the shared variables
|
|
||||||
baudrate = config.get('SaraR4_baudrate', 115200)
|
|
||||||
send_uSpot = config.get('send_uSpot', False)
|
|
||||||
|
|
||||||
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2, wait_for_line=None):
|
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2, wait_for_line=None):
|
||||||
response = bytearray()
|
response = bytearray()
|
||||||
|
|||||||
@@ -26,23 +26,8 @@ url = parameter[1] # ex: data.mobileair.fr
|
|||||||
|
|
||||||
profile_id = 3
|
profile_id = 3
|
||||||
|
|
||||||
#get baudrate
|
baudrate = 115200
|
||||||
def load_config(config_file):
|
send_uSpot = False
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_pro_4g/config.json'
|
|
||||||
# Load the configuration data
|
|
||||||
config = load_config(config_file)
|
|
||||||
# Access the shared variables
|
|
||||||
baudrate = config.get('SaraR4_baudrate', 115200)
|
|
||||||
send_uSpot = config.get('send_uSpot', False)
|
|
||||||
|
|
||||||
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2):
|
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2):
|
||||||
response = bytearray()
|
response = bytearray()
|
||||||
|
|||||||
@@ -28,23 +28,8 @@ url = parameter[1] # ex: data.mobileair.fr
|
|||||||
endpoint = parameter[2]
|
endpoint = parameter[2]
|
||||||
profile_id = 2
|
profile_id = 2
|
||||||
|
|
||||||
#get baudrate
|
baudrate = 115200
|
||||||
def load_config(config_file):
|
send_uSpot = False
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_pro_4g/config.json'
|
|
||||||
# Load the configuration data
|
|
||||||
config = load_config(config_file)
|
|
||||||
# Access the shared variables
|
|
||||||
baudrate = config.get('SaraR4_baudrate', 115200)
|
|
||||||
send_uSpot = config.get('send_uSpot', False)
|
|
||||||
|
|
||||||
def color_text(text, color):
|
def color_text(text, color):
|
||||||
colors = {
|
colors = {
|
||||||
|
|||||||
@@ -31,23 +31,8 @@ endpoint = parameter[2]
|
|||||||
|
|
||||||
profile_id = 3
|
profile_id = 3
|
||||||
|
|
||||||
#get baudrate
|
baudrate = 115200
|
||||||
def load_config(config_file):
|
send_uSpot = False
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_pro_4g/config.json'
|
|
||||||
# Load the configuration data
|
|
||||||
config = load_config(config_file)
|
|
||||||
# Access the shared variables
|
|
||||||
baudrate = config.get('SaraR4_baudrate', 115200)
|
|
||||||
send_uSpot = config.get('send_uSpot', False)
|
|
||||||
|
|
||||||
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2):
|
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2):
|
||||||
response = bytearray()
|
response = bytearray()
|
||||||
|
|||||||
@@ -21,23 +21,8 @@ port='/dev/'+parameter[0] # ex: ttyAMA2
|
|||||||
url = parameter[1] # ex: data.mobileair.fr
|
url = parameter[1] # ex: data.mobileair.fr
|
||||||
|
|
||||||
|
|
||||||
#get baudrate
|
baudrate = 115200
|
||||||
def load_config(config_file):
|
send_uSpot = False
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_pro_4g/config.json'
|
|
||||||
# Load the configuration data
|
|
||||||
config = load_config(config_file)
|
|
||||||
# Access the shared variables
|
|
||||||
baudrate = config.get('SaraR4_baudrate', 115200)
|
|
||||||
send_uSpot = config.get('send_uSpot', False)
|
|
||||||
|
|
||||||
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2):
|
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2):
|
||||||
response = bytearray()
|
response = bytearray()
|
||||||
|
|||||||
@@ -23,24 +23,8 @@ parameter = sys.argv[1:] # Exclude the script name
|
|||||||
port='/dev/'+parameter[0] # ex: ttyAMA2
|
port='/dev/'+parameter[0] # ex: ttyAMA2
|
||||||
url = parameter[1] # ex: data.mobileair.fr
|
url = parameter[1] # ex: data.mobileair.fr
|
||||||
|
|
||||||
|
baudrate = 115200
|
||||||
#get baudrate
|
send_uSpot = False
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_pro_4g/config.json'
|
|
||||||
# Load the configuration data
|
|
||||||
config = load_config(config_file)
|
|
||||||
# Access the shared variables
|
|
||||||
baudrate = config.get('SaraR4_baudrate', 115200)
|
|
||||||
send_uSpot = config.get('send_uSpot', False)
|
|
||||||
|
|
||||||
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2):
|
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2):
|
||||||
response = bytearray()
|
response = bytearray()
|
||||||
|
|||||||
@@ -14,19 +14,7 @@ parameter = sys.argv[1:] # Exclude the script name
|
|||||||
port = '/dev/' + parameter[0] # e.g., ttyAMA2
|
port = '/dev/' + parameter[0] # e.g., ttyAMA2
|
||||||
timeout = float(parameter[1]) # e.g., 2 seconds
|
timeout = float(parameter[1]) # e.g., 2 seconds
|
||||||
|
|
||||||
def load_config(config_file):
|
baudrate = 115200
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_pro_4g/config.json'
|
|
||||||
config = load_config(config_file)
|
|
||||||
baudrate = config.get('SaraR4_baudrate', 115200)
|
|
||||||
|
|
||||||
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2):
|
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2):
|
||||||
response = bytearray()
|
response = bytearray()
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ timeout = float(parameter[2]) # ex:2
|
|||||||
# Access the shared variables
|
# Access the shared variables
|
||||||
baudrate = 115200
|
baudrate = 115200
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
ser = serial.Serial(
|
ser = serial.Serial(
|
||||||
|
|||||||
@@ -22,23 +22,7 @@ parameter = sys.argv[1:] # Exclude the script name
|
|||||||
port='/dev/'+parameter[0] # ex: ttyAMA2
|
port='/dev/'+parameter[0] # ex: ttyAMA2
|
||||||
url = parameter[1] # ex: data.mobileair.fr
|
url = parameter[1] # ex: data.mobileair.fr
|
||||||
|
|
||||||
|
baudrate = 115200
|
||||||
#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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_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(
|
ser = serial.Serial(
|
||||||
port=port, #USB0 or ttyS0
|
port=port, #USB0 or ttyS0
|
||||||
|
|||||||
@@ -26,15 +26,7 @@ networkID = parameter[1] # ex: 20801
|
|||||||
timeout = float(parameter[2]) # ex:2
|
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 {}
|
|
||||||
|
|
||||||
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2, wait_for_lines=None, debug=True):
|
def read_complete_response(serial_connection, timeout=2, end_of_response_timeout=2, wait_for_lines=None, debug=True):
|
||||||
'''
|
'''
|
||||||
@@ -81,12 +73,7 @@ def read_complete_response(serial_connection, timeout=2, end_of_response_timeout
|
|||||||
return response.decode('utf-8', errors='replace') # Return the full response if no target line is found
|
return response.decode('utf-8', errors='replace') # Return the full response if no target line is found
|
||||||
|
|
||||||
|
|
||||||
# Define the config file path
|
baudrate = 115200
|
||||||
config_file = '/var/www/nebuleair_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(
|
ser = serial.Serial(
|
||||||
port=port, #USB0 or ttyS0
|
port=port, #USB0 or ttyS0
|
||||||
|
|||||||
@@ -11,22 +11,7 @@ parameter = sys.argv[1:] # Exclude the script name
|
|||||||
port='/dev/'+parameter[0] # ex: ttyAMA2
|
port='/dev/'+parameter[0] # ex: ttyAMA2
|
||||||
message = parameter[1] # ex: Hello
|
message = parameter[1] # ex: Hello
|
||||||
|
|
||||||
#get baudrate
|
baudrate = 115200
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_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(
|
ser = serial.Serial(
|
||||||
port=port, #USB0 or ttyS0
|
port=port, #USB0 or ttyS0
|
||||||
|
|||||||
@@ -18,24 +18,7 @@ import sys
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
baudrate = 115200
|
||||||
|
|
||||||
#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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_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(
|
ser = serial.Serial(
|
||||||
port='/dev/ttyAMA2',
|
port='/dev/ttyAMA2',
|
||||||
|
|||||||
@@ -17,23 +17,7 @@ import json
|
|||||||
# SARA R4 UHTTPC profile IDs
|
# SARA R4 UHTTPC profile IDs
|
||||||
aircarto_profile_id = 0
|
aircarto_profile_id = 0
|
||||||
|
|
||||||
|
baudrate = 115200
|
||||||
#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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_pro_4g/config.json'
|
|
||||||
# Load the configuration data
|
|
||||||
config = load_config(config_file)
|
|
||||||
# Access the shared variables
|
|
||||||
baudrate = config.get('SaraR4_baudrate', 115200)
|
|
||||||
|
|
||||||
ser_sara = serial.Serial(
|
ser_sara = serial.Serial(
|
||||||
port='/dev/ttyAMA2',
|
port='/dev/ttyAMA2',
|
||||||
|
|||||||
@@ -11,22 +11,7 @@ parameter = sys.argv[1:] # Exclude the script name
|
|||||||
port='/dev/'+parameter[0] # ex: ttyAMA2
|
port='/dev/'+parameter[0] # ex: ttyAMA2
|
||||||
message = parameter[1] # ex: Hello
|
message = parameter[1] # ex: Hello
|
||||||
|
|
||||||
#get baudrate
|
baudrate = 115200
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_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(
|
ser = serial.Serial(
|
||||||
port=port, #USB0 or ttyS0
|
port=port, #USB0 or ttyS0
|
||||||
|
|||||||
@@ -12,22 +12,7 @@ port='/dev/'+parameter[0] # ex: ttyAMA2
|
|||||||
endpoint = parameter[1] # ex: /pro_4G/notif_message.php
|
endpoint = parameter[1] # ex: /pro_4G/notif_message.php
|
||||||
profile_id = parameter[2]
|
profile_id = parameter[2]
|
||||||
|
|
||||||
#get baudrate
|
baudrate = 115200
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_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(
|
ser = serial.Serial(
|
||||||
port=port, #USB0 or ttyS0
|
port=port, #USB0 or ttyS0
|
||||||
|
|||||||
@@ -21,23 +21,7 @@ port='/dev/'+parameter[0] # ex: ttyAMA2
|
|||||||
apn_address = parameter[1] # ex: data.mono
|
apn_address = parameter[1] # ex: data.mono
|
||||||
timeout = float(parameter[2]) # ex:2
|
timeout = float(parameter[2]) # ex:2
|
||||||
|
|
||||||
|
baudrate = 115200
|
||||||
#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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_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(
|
ser = serial.Serial(
|
||||||
port=port, #USB0 or ttyS0
|
port=port, #USB0 or ttyS0
|
||||||
|
|||||||
@@ -27,22 +27,7 @@ url = parameter[1] # ex: data.mobileair.fr
|
|||||||
profile_id = parameter[2] #ex: 0
|
profile_id = parameter[2] #ex: 0
|
||||||
|
|
||||||
|
|
||||||
#get baudrate
|
baudrate = 115200
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_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(
|
ser = serial.Serial(
|
||||||
port=port, #USB0 or ttyS0
|
port=port, #USB0 or ttyS0
|
||||||
|
|||||||
@@ -40,22 +40,7 @@ def read_complete_response(serial_connection, timeout=2, end_of_response_timeout
|
|||||||
|
|
||||||
return response.decode('utf-8', errors='replace')
|
return response.decode('utf-8', errors='replace')
|
||||||
|
|
||||||
#get baudrate
|
baudrate = 115200
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_pro_4g/config.json'
|
|
||||||
# Load the configuration data
|
|
||||||
config = load_config(config_file)
|
|
||||||
# Access the shared variables
|
|
||||||
baudrate = config.get('SaraR4_baudrate', 115200)
|
|
||||||
|
|
||||||
ser_sara = serial.Serial(
|
ser_sara = serial.Serial(
|
||||||
port=port, #USB0 or ttyS0
|
port=port, #USB0 or ttyS0
|
||||||
|
|||||||
@@ -12,21 +12,7 @@ port='/dev/'+parameter[0] # ex: ttyAMA2
|
|||||||
message = parameter[1] # ex: Hello
|
message = parameter[1] # ex: Hello
|
||||||
|
|
||||||
#get baudrate
|
#get baudrate
|
||||||
def load_config(config_file):
|
baudrate = 115200
|
||||||
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 {}
|
|
||||||
|
|
||||||
# Define the config file path
|
|
||||||
config_file = '/var/www/nebuleair_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(
|
ser = serial.Serial(
|
||||||
port=port, #USB0 or ttyS0
|
port=port, #USB0 or ttyS0
|
||||||
|
|||||||
Reference in New Issue
Block a user