Result is sometimes 'nill' and sometimes "Busy". I know that this should work because I've checked a communication with ETM-1 via some program which was prepared according with this documentation.
According to the documentation to read armed partitions I must send:
Since you are calling receive() without any arguments it will try to receive all data before socket is closed which is probably not the behavior you want. Try specifying the number of bytes that the reply should contain and it should work.
25.10.2016, 07:43 (This post was last modified: 25.10.2016, 07:50 by buuuudzik.)
(25.10.2016, 06:18)admin Wrote: Since you are calling receive() without any arguments it will try to receive all data before socket is closed which is probably not the behavior you want. Try specifying the number of bytes that the reply should contain and it should work.
Good tip, because now I have response but this response is shorter than the query(look at the screenshot). I've tried also '*a' and '*l' arguments but they gave 'nill'. Response should have 15 bytes.
And also unfortunately I've tried use lmcore.strtohex() but it gives me empty string. I've tried also the str2hex() from Erwin example but it gives me the same. I don't know also why the last 2 variables are not logged and there is no error describing this situation?
I've checked another way and it works perfect
And maybe there is another way to receive some data because sometimes I will not know what is the data length? Maybe not in this script but in the future.
Correction: default receive pattern is '*l' - a single line, not the whole result. Receive() will return partial result as a third return value when an error occurs (that's why you are getting an empty string). So you can use '*a' pattern to receive everything until timeout occurs. This is not the most efficient way, but it will work
Code:
12345678910111213
data, err, partial = client:receive('*a')
-- errorifnotdatathendata = partialend-- do something with data that's availableifdatathenparsedata(data)
endclient:close()
As for hex logging, new firmware will have loghex() function to make this easier.
I have a script for a read the states of inputs. But I have a little problem in my resident script. I cannot use grp.write() or grp.update() because I have this error:
Code:
1
Line0: attempttocallfield'rshift' (anilvalue)
I've tried send the same in the other script and there was ok.
Interesting to connect to Satels First via ethm card and commands. I havet done this in my home with knx v1 interface from them. That works perfect inn case u need another solution
(26.10.2016, 20:40)PassivPluss Wrote: Interesting to connect to Satels First via ethm card and commands. I havet done this in my home with knx v1 interface from them. That works perfect inn case u need another solution
I have a project with Integra 256plus so 64group addresses from KNX v1 or v2 is not enough.
But I know some important tip from one Satel integrator that KNX module is much reliable than ethm when you have in your project communication via telephone link with monitoring station(when integra sends some data to the monitoring station all connections via ethm are terminated but KNX still works).
So at this moment ethm is a full option(you can integrate whole installation without loosing any additional inputs/outputs) but you must have good script because sometimes ethm is "Busy!".
KNX module v2 is reliable but you loose inputs/outputs, it has only 64 variables.