Commit 70afe8dc authored by Oleg Nikulin's avatar Oleg Nikulin

script fix

parent d8f5085e
......@@ -102,11 +102,14 @@ def poll(serial_port):
#температуры 16-битные со знаком (ну на всякий случай)
transmit_bytes = [
pc_command_codes.poll
pc_command_codes.poll,
int.to_bytes(temperatures[0], 2, 'big', signed=True)[0],
int.to_bytes(temperatures[0], 2, 'big', signed=True)[1],
int.to_bytes(temperatures[1], 2, 'big', signed=True)[0],
int.to_bytes(temperatures[1], 2, 'big', signed=True)[1],
int.to_bytes(temperatures[2], 2, 'big', signed=True)[0],
int.to_bytes(temperatures[2], 2, 'big', signed=True)[1]
]
transmit_bytes += int.to_bytes(temperatures[0], 2, 'big'),
transmit_bytes += int.to_bytes(temperatures[1], 2, 'big'),
transmit_bytes += int.to_bytes(temperatures[2], 2, 'big'),
response_length = 18
response = serial_exchange(serial_port, transmit_bytes, response_length, config['arduinoTimeoutSec'])
......@@ -198,7 +201,7 @@ if __name__ == "__main__":
initialize(serial_port)
else:
if not args.manual:
output = str(subprocess.Popen(['netcat', 'localhost', '7634'], stdout = subprocess.PIPE, stderr = subprocess.STDOUT).communicate()[0]) #получаем output от hddtemp
output = str(subprocess.Popen(['netcat', '-d', 'localhost', '7634'], stdout = subprocess.PIPE, stderr = subprocess.STDOUT).communicate()[0]) #получаем output от hddtemp
#b'|/dev/sda2|ST340014A|41|C|'
if output == "b''":
print('Hddtemp output is empty, make sure it is running. If not, launch it: #systemctl start hddtemp.service')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment