zanac / pyhpsu Goto Github PK
View Code? Open in Web Editor NEWPython Script to read and send commands to a Rotex HPSU
Python Script to read and send commands to a Rotex HPSU
Nella root non dovrebbe starci nulla penso
Any objects if I transcript so comments and other word into english?
Will do this by pull requests.....
Estrapolare dal codice e rendere configurabili:
Grazie !
while notTimeout:
i += 1
timeout = self.timeout
rcBUS = None
try:
rcBUS = self.bus.recv(timeout)
except Exception:
self.hpsu.printd('exception', 'Error recv')
if rcBUS:
if (msg_data[2] == 0xfa and msg_data[3] == rcBUS.data[3] and msg_data[4] == rcBUS.data[4]) or (msg_data[2] != 0xfa and msg_data[2] == rcBUS.data[2]):
rc = "%02X %02X %02X %02X %02X %02X %02X" % (rcBUS.data[0], rcBUS.data[1], rcBUS.data[2], rcBUS.data[3], rcBUS.data[4], rcBUS.data[5], rcBUS.data[6])
notTimeout = False
if notTimeout:
self.hpsu.printd('warning', 'msg not sync, retry: %s' % i)
**if i >= 15:**
self.hpsu.printd('error', 'msg not sync, timeout')
notTimeout = False
rc = "KO"
Where to buy a canbus cable tha fits to J13 on Daikin Altherma?
Estrarre dal codice e mettere in file di configurazione:
Grazie !
for c in hpsu.commands:
i = 0
while i <= 3:
rc = hpsu.sendCommand(c)
if rc != "KO":
i = 4
response = hpsu.parseCommand(cmd=c, response=rc, verbose=verbose)
resp = hpsu.umConversion(cmd=c, response=response, verbose=verbose)
arrResponse.append({"name":c["name"], "resp":resp, "timestamp":response["timestamp"]})
else:
i += 1
**time.sleep(2.0)**
hpsu.printd('warning', 'retry %s command %s' % (i, c["name"]))
**if i == 4:**
hpsu.printd('error', 'command %s failed' % (c["name"]))
In HPSU.py the logic on "commands" require them to be defined with all nibble uppercase (e.g. if command[6:8] != "FA").
the file etc/pyHPSU/commands_hpsu.csv has a last row with some lowercase nibble
t_flow_cooling;61 00 fa 03 dd 00 00;190;d;10;w
this should be
t_flow_cooling;61 00 FA 03 DD 00 00;190;d;10;w
Ciao zanac,
ho avuto problemi nell'uso di python 3 con ELM327 per via della diversa codifica delle stringhe.
ho apportato alcune modifiche (principalmente decode('utf-8')) che mi hanno reso funzionante il tuo script ma sarebbe preferibile se rilasciassi tu una versione compatibile.
Grazie,
fabio
Hi Zanac, can you simple example for logger to log all the parameter values.
Thank you in advance!
When I call pyHPSUd.py -d PYCAN I get:
root@rotex:~/zanac_pyHPSU# python3 pyHPSUd.py -d PYCAN
Traceback (most recent call last):
File "pyHPSUd.py", line 137, in
main.main2(sys.argv[1:])
File "pyHPSUd.py", line 85, in main2
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
File "/usr/lib/python3/dist-packages/pika/adapters/blocking_connection.py", line 339, in init
self._process_io_for_connection_setup()
File "/usr/lib/python3/dist-packages/pika/adapters/blocking_connection.py", line 374, in _process_io_for_connection_setup
self._open_error_result.is_ready)
File "/usr/lib/python3/dist-packages/pika/adapters/blocking_connection.py", line 395, in _flush_output
raise exceptions.ConnectionClosed()
pika.exceptions.ConnectionClosed
Is the daemon working anywhere?
I log non includono il messaggio che ha determinato l'errore per cui non si puo' fare analisi.
Aggiungere il messaggio che ha determinato l'errore nel log.
try:
msg = can.Message(arbitration_id=receiver_id, data=msg_data, extended_id=False, dlc=7)
self.bus.send(msg)
except Exception:
self.hpsu.printd('exception', 'Error sending msg')
while notTimeout:
i += 1
timeout = self.timeout
rcBUS = None
try:
rcBUS = self.bus.recv(timeout)
except Exception:
**self.hpsu.printd('exception', 'Error recv')**
if rcBUS:
if (msg_data[2] == 0xfa and msg_data[3] == rcBUS.data[3] and msg_data[4] == rcBUS.data[4]) or (msg_data[2] != 0xfa and msg_data[2] == rcBUS.data[2]):
rc = "%02X %02X %02X %02X %02X %02X %02X" % (rcBUS.data[0], rcBUS.data[1], rcBUS.data[2], rcBUS.data[3], rcBUS.data[4], rcBUS.data[5], rcBUS.data[6])
notTimeout = False
if notTimeout:
**self.hpsu.printd('warning', 'msg not sync, retry: %s' % i)**
if i >= 15:
**self.hpsu.printd('error', 'msg not sync, timeout')**
notTimeout = False
rc = "KO"
Hi!
Where do I obtain the connector that connects to J13 inside the Rotex control unit?
Thanks!
I'd like to try to connect the Rotex HPSU Compact to OpenHAB, but first want to see if I get CAN working.
EDIT: It seems the connector is already present in the HPSU and is plugged onto the controller board. Next question: How to deal with the terminating resistor of the CAN bus?
With my HPSU compact I got Rotex rocon-g1 gateway, to run it using Rotex Cloud. I don't like that much, so I tried to check what's inside and found Beagle Bone Black with CAN module.
I got root to the device and found there Debian
# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.8 (wheezy)
Release: 7.8
Codename: wheezy
# cat /etc/issue
Debian GNU/Linux 7 \n \l
BeagleBoard.org Debian Image 2015-03-01
ip link show can0
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 10
link/can
I installed can-utils and can dump can frames:
root@rocon-g1:~/pyHPSU# /root/can-utils/candump can0
can0 69D [7] C1 0F FA 01 99 00 00
can0 69D [7] 31 00 FA 01 48 00 00
can0 180 [7] D2 1D FA 01 48 00 00
can0 69D [7] 31 00 FA 00 0C 00 00
can0 180 [7] D2 1D FA 00 0C 00 2D
can0 69D [7] 31 00 FA 0A 0C 00 00
can0 180 [7] D2 1D FA 0A 0C 80 00
can0 69D [7] 31 00 FA 01 22 00 00
can0 180 [7] D2 1D FA 01 22 0D 00
can0 69D [7] 31 00 FA 01 23 00 00
can0 180 [7] D2 1D FA 01 23 01 00
can0 69D [7] 31 00 FA 01 24 00 00
can0 180 [7] D2 1D FA 01 24 12 00
can0 69D [7] 31 00 FA 01 25 00 00
can0 180 [7] D2 1D FA 01 25 0A 00
can0 69D [7] 31 00 FA 01 26 00 00
can0 180 [7] D2 1D FA 01 26 1C 00
can0 69D [7] 31 00 FA 01 12 00 00
can0 180 [7] D2 1D FA 01 12 03 00
I had to install python from sources to get working as python in packages is outdated. I'm not sure what driver use to get it working?
/usr/local/bin/python3 pyHPSU.py -l EN -c t_hc_set -c t_dhw_set -c t_ext -c t_outdoor_ot1 -c ta2 -o JSON -v 1
Traceback (most recent call last):
File "pyHPSU.py", line 148, in <module>
main(sys.argv[1:])
File "pyHPSU.py", line 88, in main
hpsu = HPSU(driver=driver, logger=logger, port=port, cmd=cmd, lg_code=lg_code)
File "/root/pyHPSU/HPSU/HPSU.py", line 58, in __init__
desc = row[2]
IndexError: list index out of range
/usr/local/bin/python3 pyHPSU.py -l EN -d EMU -c t_hc_set -c t_dhw_set -c t_ext -c t_outdoor_ot1 -c ta2 -o JSON -v 1
Traceback (most recent call last):
File "pyHPSU.py", line 148, in <module>
main(sys.argv[1:])
File "pyHPSU.py", line 88, in main
hpsu = HPSU(driver=driver, logger=logger, port=port, cmd=cmd, lg_code=lg_code)
File "/root/pyHPSU/HPSU/HPSU.py", line 58, in __init__
desc = row[2]
IndexError: list index out of range
Need your help to get pyHPSU working with can0 in this device.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.