update
This commit is contained in:
@@ -27,13 +27,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"connected": false,
|
"connected": false,
|
||||||
"port": "ttyAMA2",
|
"port": "ttyAMA3",
|
||||||
"name": "no2",
|
"name": "no2",
|
||||||
"coefficient" : 1
|
"coefficient" : 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"connected": false,
|
"connected": false,
|
||||||
"port": "ttyAMA1",
|
"port": "ttyAMA2",
|
||||||
"name": "o3",
|
"name": "o3",
|
||||||
"coefficient" : 1
|
"coefficient" : 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import sys
|
|||||||
parameter = sys.argv[1:] # Exclude the script name
|
parameter = sys.argv[1:] # Exclude the script name
|
||||||
#print("Parameters received:")
|
#print("Parameters received:")
|
||||||
port='/dev/'+parameter[0]
|
port='/dev/'+parameter[0]
|
||||||
|
coefficient = int(parameter[1])
|
||||||
coefficient = 4
|
#coefficient = 4
|
||||||
|
|
||||||
def read_cairsens(port, baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, databits=serial.EIGHTBITS, timeout=1):
|
def read_cairsens(port, baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, databits=serial.EIGHTBITS, timeout=1):
|
||||||
"""
|
"""
|
||||||
Lit les données de la sonde CAIRSENS via UART.
|
Lit les données de la sonde CAIRSENS via UART.
|
||||||
/usr/bin/python3 /var/www/nebuleair_pro_4g/envea/read_value.py ttyAMA4
|
/usr/bin/python3 /var/www/nebuleair_pro_4g/envea/read_value.py ttyAMA4 4
|
||||||
|
|
||||||
|
|
||||||
:param port: Le port série utilisé (ex: 'COM1' ou '/dev/ttyAMA0').
|
:param port: Le port série utilisé (ex: 'COM1' ou '/dev/ttyAMA0').
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ window.onload = function() {
|
|||||||
ENVEA_sensors.forEach((sensor, index) => {
|
ENVEA_sensors.forEach((sensor, index) => {
|
||||||
const port = sensor.port; // Port from the sensor object
|
const port = sensor.port; // Port from the sensor object
|
||||||
const name = sensor.name; // Port from the sensor object
|
const name = sensor.name; // Port from the sensor object
|
||||||
|
const coefficient = sensor.coefficient;
|
||||||
const cardHTML = `
|
const cardHTML = `
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@@ -300,7 +300,7 @@ window.onload = function() {
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">Sonde Envea ${name}</h5>
|
<h5 class="card-title">Sonde Envea ${name}</h5>
|
||||||
<p class="card-text">Capteur gas.</p>
|
<p class="card-text">Capteur gas.</p>
|
||||||
<button class="btn btn-primary" onclick="getENVEA_values('${port}','${name}')">Get Data</button>
|
<button class="btn btn-primary" onclick="getENVEA_values('${port}','${name}','${coefficient}')">Get Data</button>
|
||||||
<div id="loading_envea${name}" class="spinner-border spinner-border-sm" style="display: none;" role="status"></div>
|
<div id="loading_envea${name}" class="spinner-border spinner-border-sm" style="display: none;" role="status"></div>
|
||||||
<table class="table table-striped-columns">
|
<table class="table table-striped-columns">
|
||||||
<tbody id="data-table-body_envea${name}"></tbody>
|
<tbody id="data-table-body_envea${name}"></tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user