duplicati servizi, riorganizzati file
This commit is contained in:
@@ -1,16 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=SSH Tunnel - Letture Movimento Assi Materia-CL
|
|
||||||
Requires=network.target mosquitto.service docker.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
RestartSec=15s
|
|
||||||
Type=simple
|
|
||||||
User=root
|
|
||||||
Group=root
|
|
||||||
WorkingDirectory=/root/NasoScopio/NasoScope/
|
|
||||||
ExecStart=/usr/bin/autossh -Nf -M 0 -L 8080:192.168.0.1:8080 cnc@192.168.30.51
|
|
||||||
PIDFile=/run/sshtunnel.pid
|
|
||||||
Restart=always
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2",
|
"version": "0.3",
|
||||||
"logFile": "/var/log/nasoscopio.log",
|
"logFile": "/var/log/nasoscopio-grande.log",
|
||||||
"logFormat": "%(asctime)s|%(levelname)-7s|%(funcName)-10s|%(lineno)-3d: %(message)-50s",
|
"logFormat": "%(asctime)s|%(levelname)-7s|%(funcName)-10s|%(lineno)-3d: %(message)-50s",
|
||||||
"logTimeFormat": "%m-%d %H:%M:%S",
|
"logTimeFormat": "%m-%d %H:%M:%S",
|
||||||
"URL": "http://localhost:8080",
|
"URL": "http://localhost:8880",
|
||||||
"samplePeriod": 10,
|
"samplePeriod": 10,
|
||||||
"loopPeriod": 0.5,
|
"loopPeriod": 0.5,
|
||||||
"recordTime": 3600,
|
"recordTime": 3600,
|
||||||
"fileSaveTime": 360,
|
"fileSaveTime": 360,
|
||||||
"fileSaveDir": "/tmp/{}_CL3015HSD.{fType}",
|
"fileSaveDir": "/tmp/GRANDE_{}_CL3015HSD.{fType}",
|
||||||
"fileType": "csv",
|
"fileType": "csv",
|
||||||
"variables": [ {"deviceID":1,
|
"variables": [ {"deviceID":1,
|
||||||
"name": "AsseX",
|
"name": "AsseX",
|
||||||
@@ -51,13 +51,13 @@
|
|||||||
},
|
},
|
||||||
"mqttHost": "localhost",
|
"mqttHost": "localhost",
|
||||||
"mqttPort": 1883,
|
"mqttPort": 1883,
|
||||||
"mqttSend": "nasoscope/cnc2recorder",
|
"mqttSend": "nasoscope/grande/cnc2recorder",
|
||||||
"mqttReceive": "nasoscope/recorder2cnc",
|
"mqttReceive": "nasoscope/grande/recorder2cnc",
|
||||||
"sendMqtt": true,
|
"sendMqtt": false,
|
||||||
"mqttSendSamples": "nasoscope/samples",
|
"mqttSendSamples": "nasoscope/grande/samples",
|
||||||
"sendInflux": true,
|
"sendInflux": true,
|
||||||
"influxHost": "localhost",
|
"influxHost": "localhost",
|
||||||
"influxPort": 8086,
|
"influxPort": 8086,
|
||||||
"influxDB": "axes",
|
"influxDB": "axes_grande",
|
||||||
"influxRetention": "one_day"
|
"influxRetention": "one_day"
|
||||||
}
|
}
|
||||||
63
config-piccola.json
Normal file
63
config-piccola.json
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
{
|
||||||
|
"version": "0.3",
|
||||||
|
"logFile": "/var/log/nasoscopio-piccola.log",
|
||||||
|
"logFormat": "%(asctime)s|%(levelname)-7s|%(funcName)-10s|%(lineno)-3d: %(message)-50s",
|
||||||
|
"logTimeFormat": "%m-%d %H:%M:%S",
|
||||||
|
"URL": "http://localhost:8881",
|
||||||
|
"samplePeriod": 10,
|
||||||
|
"loopPeriod": 0.5,
|
||||||
|
"recordTime": 3600,
|
||||||
|
"fileSaveTime": 360,
|
||||||
|
"fileSaveDir": "/tmp/PICCOLA_{}_CL3015HSD.{fType}",
|
||||||
|
"fileType": "csv",
|
||||||
|
"variables": [ {"deviceID":1,
|
||||||
|
"name": "AsseX",
|
||||||
|
"codes": [1000,1002,1017,1021,1022,1038],
|
||||||
|
"descr": ["ActualFeed","FollowingError","MeasuredPosition","CalculatedAcceleration","Jerk","ServoPoint"]
|
||||||
|
},
|
||||||
|
{"deviceID":2,
|
||||||
|
"name": "AsseY",
|
||||||
|
"codes": [1000,1002,1017,1021,1022,1038],
|
||||||
|
"descr": ["ActualFeed","FollowingError","MeasuredPosition","CalculatedAcceleration","Jerk","ServoPoint"]
|
||||||
|
},
|
||||||
|
{"deviceID":3,
|
||||||
|
"name": "AsseZ",
|
||||||
|
"codes": [1000,1002,1017,1021,1022,1038],
|
||||||
|
"descr": ["ActualFeed","FollowingError","MeasuredPosition","CalculatedAcceleration","Jerk","ServoPoint"]
|
||||||
|
},
|
||||||
|
{"deviceID":4,
|
||||||
|
"name": "AsseC",
|
||||||
|
"codes": [1000,1002,1017,1021,1022,1038],
|
||||||
|
"descr": ["ActualFeed","FollowingError","MeasuredPosition","CalculatedAcceleration","Jerk","ServoPoint"]
|
||||||
|
},
|
||||||
|
{"deviceID":5,
|
||||||
|
"name": "AsseB",
|
||||||
|
"codes": [1000,1002,1017,1021,1022,1038],
|
||||||
|
"descr": ["ActualFeed","FollowingError","MeasuredPosition","CalculatedAcceleration","Jerk","ServoPoint"]
|
||||||
|
},
|
||||||
|
{"deviceID":6,
|
||||||
|
"name": "AsseXs",
|
||||||
|
"codes": [1000,1002,1017,1021,1022,1038],
|
||||||
|
"descr": ["ActualFeed","FollowingError","MeasuredPosition","CalculatedAcceleration","Jerk","ServoPoint"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"variableNames": {
|
||||||
|
"1000": "ActualFeed",
|
||||||
|
"1002": "FollowingError",
|
||||||
|
"1017": "MeasuredPosition",
|
||||||
|
"1021": "CalculatedAcceleration",
|
||||||
|
"1022": "Jerk",
|
||||||
|
"1038": "ServoPoint"
|
||||||
|
},
|
||||||
|
"mqttHost": "localhost",
|
||||||
|
"mqttPort": 1883,
|
||||||
|
"mqttSend": "nasoscope/piccola/cnc2recorder",
|
||||||
|
"mqttReceive": "nasoscope/piccola/recorder2cnc",
|
||||||
|
"sendMqtt": false,
|
||||||
|
"mqttSendSamples": "nasoscope/piccola/samples",
|
||||||
|
"sendInflux": true,
|
||||||
|
"influxHost": "localhost",
|
||||||
|
"influxPort": 8086,
|
||||||
|
"influxDB": "axes_piccola",
|
||||||
|
"influxRetention": "one_day"
|
||||||
|
}
|
||||||
@@ -246,9 +246,10 @@ if __name__ == '__main__':
|
|||||||
loopcount = 0
|
loopcount = 0
|
||||||
variableMap = list()
|
variableMap = list()
|
||||||
samples = dict()
|
samples = dict()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fp = open("config.json")
|
print(f'Config: {sys.argv[1]}')
|
||||||
|
fp = open(str(sys.argv[1]))
|
||||||
settings = json.load(fp)
|
settings = json.load(fp)
|
||||||
fp.close()
|
fp.close()
|
||||||
except:
|
except:
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Nasoscopio - Letture Movimento Assi Materia-CL
|
Description=Nasoscopio - Letture Movimento Assi Materia-CL4020
|
||||||
Requires=network.target mosquitto.service docker.service sshtunnel.service
|
Requires=network.target mosquitto.service docker.service sshtunnel-grande.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
RestartSec=15s
|
RestartSec=15s
|
||||||
Type=simple
|
Type=simple
|
||||||
User=root
|
User=briq
|
||||||
Group=root
|
Group=briq
|
||||||
WorkingDirectory=/root/NasoScopio/NasoScope/
|
WorkingDirectory=/root/NasoScopio/NasoScope/
|
||||||
ExecStart=/usr/bin/python3 nasomain.py
|
ExecStart=/usr/bin/python3 nasomain.py config-grande.json
|
||||||
PIDFile=/run/Nasoscopio.pid
|
PIDFile=/run/nasoscopio-grande.pid
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
16
nasoscopio-piccola.service
Normal file
16
nasoscopio-piccola.service
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Nasoscopio - Letture Movimento Assi Materia-CL3015
|
||||||
|
Requires=network.target mosquitto.service docker.service sshtunnel-piccola.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
RestartSec=15s
|
||||||
|
Type=simple
|
||||||
|
User=briq
|
||||||
|
Group=briq
|
||||||
|
WorkingDirectory=/home/briq/Nasoscopio/
|
||||||
|
ExecStart=/usr/bin/python3 nasomain.py config-piccola.json
|
||||||
|
PIDFile=/run/nasoscopio-piccola.pid
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
16
sshtunnel-grande.service
Normal file
16
sshtunnel-grande.service
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=SSH Tunnel - Letture Movimento Assi Materia-CL4020
|
||||||
|
Requires=network.target mosquitto.service docker.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
RestartSec=15s
|
||||||
|
Type=simple
|
||||||
|
User=briq
|
||||||
|
Group=briq
|
||||||
|
WorkingDirectory=/home/briq/NasoScopio/
|
||||||
|
ExecStart=/usr/bin/autossh -Nf -M 0 -L 8880:192.168.0.1:8080 cnc@192.168.30.50
|
||||||
|
PIDFile=/run/sshtunnel-grande.pid
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
16
sshtunnel-piccola.service
Normal file
16
sshtunnel-piccola.service
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=SSH Tunnel - Letture Movimento Assi Materia-CL3015
|
||||||
|
Requires=network.target mosquitto.service docker.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
RestartSec=15s
|
||||||
|
Type=simple
|
||||||
|
User=briq
|
||||||
|
Group=briq
|
||||||
|
WorkingDirectory=/home/briq/NasoScopio/
|
||||||
|
ExecStart=/usr/bin/autossh -Nf -M 0 -L 8881:192.168.0.1:8080 cnc@192.168.30.51
|
||||||
|
PIDFile=/run/sshtunnel-piccola.pid
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Reference in New Issue
Block a user