Thanks for your reply. Much appreciated. I followed your instructions and added some extra information.
root@domo:/dev# lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 005: ID 0658:0200 Sigma Designs, Inc.
------------------------
So again FYI the WTW unit changes the speed with below script.
----simple script-------
#!/bin/sh
/bin/echo -e '\x07\xF0\x00\x99\x01\x01\x48\x07\x0F' > /dev/ttyUSB0
--------
However I'm (almost) sure I already added the root user to the dialout group to get the appropriate rights using the /dev/ttyUSB0 device I executed the following command:
sudo usermod -a -G dialout root
I get some the results, see below:
---------------------------
root@domo:/home/domoticz/domoticz/scripts/wtwunitwhr930# ./ventserver.sh
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "./ventserver.sh", line 82, in GetVentilationData
self.supplyAirLevel = int(raw[14], 16)
IndexError: list index out of range
Exception in thread Thread-5:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "./ventserver.sh", line 96, in GetVentilationData
self.highTime = int(''.join(raw[24:27]), 16)
ValueError: invalid literal for int() with base 16: ''
-------------------------------
root@domo:/home/domoticz/domoticz/scripts/wtwunitwhr930# ./ventclient.sh
outsideyAirTemp = 22.5
Traceback (most recent call last):
File "./ventclient.sh", line 128, in <module>
r.json()
TypeError: 'dict' object is not callable
root@domo:/home/domoticz/domoticz/scripts/wtwunitwhr930# ./ventclient.sh
outsideyAirTemp = -20.0
Traceback (most recent call last):
File "./ventclient.sh", line 128, in <module>
r.json()
TypeError: 'dict' object is not callable
-----------------
Now I edit the ventserver.sh and remove # on line 49 print self.outsideAirTemp
The string is found on line 60 and not line 49.
----------------
When executing ./ventserver.sh I receive the following:
----------------
root@domo:/home/domoticz/domoticz/scripts/wtwunitwhr930# ./ventserver.sh
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "./ventserver.sh", line 67, in GetVentilationData
raw = self.SendSerialCommand('\x07\xF0\x00\x0F\x00\xBC\x07\x0F', ['07', '0f'])
File "./ventserver.sh", line 50, in SendSerialCommand
serialConnection = serial.Serial(port = self.port, baudrate = 9600, bytesize = serial.EIGHTBITS, parity = serial.PARITY_NONE, stopbits = serial.STOPBITS_ONE, timeout = self.timeout)
File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 260, in __init__
self.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 276, in open
raise SerialException("could not open port %s: %s" % (self._port, msg))
SerialException: could not open port /dev/ttyUSB0: [Errno 5] Input/output error: '/dev/ttyUSB0'
------------------
This keeps me busy..... many errors. What could be wrong?