diff --git a/.gitignore b/.gitignore index ae3972e..cd79c0f 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -logs/app.log -logs/loop.log +logs/*.log deviceID.txt loop/loop.log loop/data.json @@ -7,4 +6,8 @@ config.json .ssh/ matrix/input.txt matrix/input_NPM.txt -matrix/input_MHZ16.txt \ No newline at end of file +matrix/input_MHZ16.txt +wifi_list.csv +*.lock +sqlite/*.db +tests/ \ No newline at end of file diff --git a/MH-Z19/get_data.py b/MH-Z19/get_data.py index e8209ff..ae724ea 100755 --- a/MH-Z19/get_data.py +++ b/MH-Z19/get_data.py @@ -1,4 +1,10 @@ ''' + ____ ___ ____ + / ___/ _ \___ \ + | | | | | |__) | + | |__| |_| / __/ + \____\___/_____| + Script to get CO2 values need parameter: CO2_port /usr/bin/python3 /var/www/moduleair_pro_4g/MH-Z19/get_data.py ttyAMA4 diff --git a/MH-Z19/write_data.py b/MH-Z19/write_data.py index 8b53573..141fecc 100755 --- a/MH-Z19/write_data.py +++ b/MH-Z19/write_data.py @@ -1,4 +1,10 @@ ''' + ____ ___ ____ + / ___/ _ \___ \ + | | | | | |__) | + | |__| |_| / __/ + \____\___/_____| + Script to get CO2 values and write it to text file need parameter: CO2_port /usr/bin/python3 /var/www/moduleair_pro_4g/MH-Z19/write_data.py ttyAMA4 diff --git a/NPM/firmware_version.py b/NPM/firmware_version.py index d8166b9..da90d77 100755 --- a/NPM/firmware_version.py +++ b/NPM/firmware_version.py @@ -1,7 +1,7 @@ ''' Script to get NPM firmware version need parameter: port -/usr/bin/python3 /var/www/nebuleair_pro_4g/NPM/firmware_version.py ttyAMA5 +/usr/bin/python3 /var/www/moduleair_pro_4g/NPM/firmware_version.py ttyAMA5 ''' import serial diff --git a/NPM/get_data.py b/NPM/get_data.py index a694cf1..73142d5 100755 --- a/NPM/get_data.py +++ b/NPM/get_data.py @@ -7,7 +7,7 @@ Script to get NPM values need parameter: port -/usr/bin/python3 /var/www/nebuleair_pro_4g/NPM/get_data.py ttyAMA5 +/usr/bin/python3 /var/www/moduleair_pro_4g/NPM/get_data.py ttyAMA5 ''' import serial diff --git a/NPM/get_data_modbus.py b/NPM/get_data_modbus.py index c82ef59..186eb58 100755 --- a/NPM/get_data_modbus.py +++ b/NPM/get_data_modbus.py @@ -7,7 +7,7 @@ Script to get NPM data via Modbus need parameter: port -/usr/bin/python3 /var/www/nebuleair_pro_4g/NPM/get_data_modbus.py +/usr/bin/python3 /var/www/moduleair_pro_4g/NPM/get_data_modbus.py Modbus RTU [Slave Address][Function Code][Starting Address][Quantity of Registers][CRC] diff --git a/NPM/get_data_modbus_v2.py b/NPM/get_data_modbus_v2.py index c60e6e7..1bc96c7 100755 --- a/NPM/get_data_modbus_v2.py +++ b/NPM/get_data_modbus_v2.py @@ -7,7 +7,7 @@ Script to get NPM data via Modbus need parameter: port -/usr/bin/python3 /var/www/nebuleair_pro_4g/NPM/get_data_modbus_v2.py +/usr/bin/python3 /var/www/moduleair_pro_4g/NPM/get_data_modbus_v2.py Modbus RTU [Slave Address][Function Code][Starting Address][Quantity of Registers][CRC] diff --git a/NPM/get_data_modbus_v3.py b/NPM/get_data_modbus_v3.py index 4e26897..965e653 100755 --- a/NPM/get_data_modbus_v3.py +++ b/NPM/get_data_modbus_v3.py @@ -9,7 +9,7 @@ Script to get NPM data via Modbus Improved version with data stream lenght check -/usr/bin/python3 /var/www/nebuleair_pro_4g/NPM/get_data_modbus_v3.py +/usr/bin/python3 /var/www/moduleair_pro_4g/NPM/get_data_modbus_v3.py Modbus RTU [Slave Address][Function Code][Starting Address][Quantity of Registers][CRC] diff --git a/NPM/get_data_temp_hum.py b/NPM/get_data_temp_hum.py index 5abe1c9..8e668ad 100755 --- a/NPM/get_data_temp_hum.py +++ b/NPM/get_data_temp_hum.py @@ -7,7 +7,7 @@ Script to get NPM values: ONLY temp and hum need parameter: port -/usr/bin/python3 /var/www/nebuleair_pro_4g/NPM/get_data_temp_hum.py ttyAMA5 +/usr/bin/python3 /var/www/moduleair_pro_4g/NPM/get_data_temp_hum.py ttyAMA5 ''' import serial diff --git a/NPM/get_data_v2.py b/NPM/get_data_v2.py index b145eea..6f09a60 100755 --- a/NPM/get_data_v2.py +++ b/NPM/get_data_v2.py @@ -9,7 +9,7 @@ Script to get NPM values (PM1, PM2.5 and PM10) PM and the sensor temp/hum And store them inside sqlite database Uses RTC module for timing (from SQLite db) -/usr/bin/python3 /var/www/nebuleair_pro_4g/NPM/get_data_v2.py +/usr/bin/python3 /var/www/moduleair_pro_4g/NPM/get_data_v2.py ''' import serial diff --git a/SARA/check_running.py b/SARA/check_running.py index b41a83c..bc606f2 100755 --- a/SARA/check_running.py +++ b/SARA/check_running.py @@ -1,6 +1,6 @@ ''' Check if the main loop is running -/usr/bin/python3 /var/www/nebuleair_pro_4g/tests/check_running.py +/usr/bin/python3 /var/www/moduleair_pro_4g/tests/check_running.py ''' import psutil import json @@ -12,7 +12,7 @@ def is_script_running(script_name): return True # Script is running return False # Script is not running -script_to_check = "/var/www/nebuleair_pro_4g/loop/SARA_send_data_v2.py" +script_to_check = "/var/www/moduleair_pro_4g/loop/SARA_send_data_v2.py" # Determine script status is_running = is_script_running(script_to_check) diff --git a/SARA/sara.py b/SARA/sara.py index d124e07..410446b 100755 --- a/SARA/sara.py +++ b/SARA/sara.py @@ -1,13 +1,13 @@ ''' Script to see if the SARA-R410 is running ex: -python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+CCID? 2 +python3 /var/www/moduleair_pro_4g/SARA/sara.py ttyAMA2 AT+CCID? 2 ex 2 (turn on blue light): -python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+UGPIOC=16,2 2 +python3 /var/www/moduleair_pro_4g/SARA/sara.py ttyAMA2 AT+UGPIOC=16,2 2 ex 3 (reconnect network) -python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+COPS=1,2,20801 20 +python3 /var/www/moduleair_pro_4g/SARA/sara.py ttyAMA2 AT+COPS=1,2,20801 20 ex 4 (get HTTP Profiles) -python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+UHTTP? 2 +python3 /var/www/moduleair_pro_4g/SARA/sara.py ttyAMA2 AT+UHTTP? 2 ''' @@ -33,7 +33,7 @@ def load_config(config_file): return {} # Define the config file path -config_file = '/var/www/nebuleair_pro_4g/config.json' +config_file = '/var/www/moduleair_pro_4g/config.json' # Load the configuration data config = load_config(config_file) # Access the shared variables diff --git a/SARA/sara_connectNetwork.py b/SARA/sara_connectNetwork.py index 430f885..343ca7b 100755 --- a/SARA/sara_connectNetwork.py +++ b/SARA/sara_connectNetwork.py @@ -1,6 +1,6 @@ ''' Script to connect SARA-R410 to network SARA-R410 -python3 /var/www/nebuleair_pro_4g/SARA/sara_connectNetwork.py ttyAMA2 20801 10 +python3 /var/www/moduleair_pro_4g/SARA/sara_connectNetwork.py ttyAMA2 20801 10 AT+COPS=1,2,20801 mode->1 pour manual @@ -30,7 +30,7 @@ def load_config(config_file): return {} # Define the config file path -config_file = '/var/www/nebuleair_pro_4g/config.json' +config_file = '/var/www/moduleair_pro_4g/config.json' # Load the configuration data config = load_config(config_file) # Access the shared variables diff --git a/SARA/sara_eraseMessage.py b/SARA/sara_eraseMessage.py index c205c50..3f273aa 100755 --- a/SARA/sara_eraseMessage.py +++ b/SARA/sara_eraseMessage.py @@ -22,7 +22,7 @@ def load_config(config_file): return {} # Define the config file path -config_file = '/var/www/nebuleair_pro_4g/config.json' +config_file = '/var/www/moduleair_pro_4g/config.json' # Load the configuration data config = load_config(config_file) # Access the shared variables diff --git a/SARA/sara_readMessage.py b/SARA/sara_readMessage.py index 33739fe..dc18b84 100755 --- a/SARA/sara_readMessage.py +++ b/SARA/sara_readMessage.py @@ -22,7 +22,7 @@ def load_config(config_file): return {} # Define the config file path -config_file = '/var/www/nebuleair_pro_4g/config.json' +config_file = '/var/www/moduleair_pro_4g/config.json' # Load the configuration data config = load_config(config_file) # Access the shared variables diff --git a/SARA/sara_sendMessage.py b/SARA/sara_sendMessage.py index f5e3e95..5599bb6 100755 --- a/SARA/sara_sendMessage.py +++ b/SARA/sara_sendMessage.py @@ -23,7 +23,7 @@ def load_config(config_file): return {} # Define the config file path -config_file = '/var/www/nebuleair_pro_4g/config.json' +config_file = '/var/www/moduleair_pro_4g/config.json' # Load the configuration data config = load_config(config_file) # Access the shared variables diff --git a/SARA/sara_setAPN.py b/SARA/sara_setAPN.py index 330e6fd..c2a4260 100755 --- a/SARA/sara_setAPN.py +++ b/SARA/sara_setAPN.py @@ -2,7 +2,7 @@ Script to connect SARA-R410 to APN AT+CGDCONT=1,"IP","data.mono" -/usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara_setAPN.py ttyAMA2 data.mono 2 +/usr/bin/python3 /var/www/moduleair_pro_4g/SARA/sara_setAPN.py ttyAMA2 data.mono 2 ''' import serial @@ -27,7 +27,7 @@ def load_config(config_file): return {} # Define the config file path -config_file = '/var/www/nebuleair_pro_4g/config.json' +config_file = '/var/www/moduleair_pro_4g/config.json' # Load the configuration data config = load_config(config_file) # Access the shared variables diff --git a/SARA/sara_setURL.py b/SARA/sara_setURL.py index aae85df..42d5d97 100755 --- a/SARA/sara_setURL.py +++ b/SARA/sara_setURL.py @@ -1,11 +1,11 @@ ''' Script to set the URL for a HTTP request Ex: -/usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara_setURL.py ttyAMA2 data.nebuleair.fr 0 +/usr/bin/python3 /var/www/moduleair_pro_4g/SARA/sara_setURL.py ttyAMA2 data.moduleair.fr 0 To do: need to add profile id as parameter First profile id: - AT+UHTTP=0,1,"data.nebuleair.fr" + AT+UHTTP=0,1,"data.moduleair.fr" Second profile id: AT+UHTTP=1,1,"api-prod.uspot.probesys.net" ''' @@ -33,7 +33,7 @@ def load_config(config_file): return {} # Define the config file path -config_file = '/var/www/nebuleair_pro_4g/config.json' +config_file = '/var/www/moduleair_pro_4g/config.json' # Load the configuration data config = load_config(config_file) # Access the shared variables diff --git a/SARA/sara_setURL_uSpot_noSSL.py b/SARA/sara_setURL_uSpot_noSSL.py index 4c37f42..188dcf1 100755 --- a/SARA/sara_setURL_uSpot_noSSL.py +++ b/SARA/sara_setURL_uSpot_noSSL.py @@ -1,11 +1,11 @@ ''' Script to set the URL for a HTTP request Ex: -/usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara_setURL_uSpot_noSSL.py ttyAMA2 api-prod.uspot.probesys.net +/usr/bin/python3 /var/www/moduleair_pro_4g/SARA/sara_setURL_uSpot_noSSL.py ttyAMA2 api-prod.uspot.probesys.net To do: need to add profile id as parameter First profile id: - AT+UHTTP=0,1,"data.nebuleair.fr" + AT+UHTTP=0,1,"data.moduleair.fr" Second profile id: AT+UHTTP=1,1,"api-prod.uspot.probesys.net" ''' @@ -51,7 +51,7 @@ def load_config(config_file): return {} # Define the config file path -config_file = '/var/www/nebuleair_pro_4g/config.json' +config_file = '/var/www/moduleair_pro_4g/config.json' # Load the configuration data config = load_config(config_file) # Access the shared variables diff --git a/SARA/sara_writeMessage.py b/SARA/sara_writeMessage.py index 72188af..afda5fc 100755 --- a/SARA/sara_writeMessage.py +++ b/SARA/sara_writeMessage.py @@ -22,7 +22,7 @@ def load_config(config_file): return {} # Define the config file path -config_file = '/var/www/nebuleair_pro_4g/config.json' +config_file = '/var/www/moduleair_pro_4g/config.json' # Load the configuration data config = load_config(config_file) # Access the shared variables diff --git a/config.json.dist b/config.json.dist index 26a4c31..7a1cd14 100755 --- a/config.json.dist +++ b/config.json.dist @@ -1,8 +1,14 @@ { - "loop_log": true, - "boot_log": true, + "modem_config_mode": false, + "NPM/get_data_modbus_v3.py":true, + "loop/SARA_send_data_v2.py": true, + "RTC/save_to_db.py": true, + "BME280/get_data_v2.py": true, + "envea/read_value_v2.py": true, + "sqlite/flush_old_data.py": true, "deviceID": "XXXXX", "SaraR4_baudrate": 115200, + "NPM_solo_port": "/dev/ttyAMA3", "NextPM_ports": ["ttyAMA3"], "CO2_serial": true, "sensirion_SFA30": false, diff --git a/html/admin.html b/html/admin.html index 8f5ef6b..aa6c47c 100755 --- a/html/admin.html +++ b/html/admin.html @@ -3,7 +3,7 @@
-