Hi All,
AlexH has a great post on using rsyslog & logrotate to capture KNX bus traffic, and I figure I can then use telegraf’s [[inputs.tail]] (after some massaging in a processor) to get this into Influx.
Unfortunately I can’t get the data into the decoded format like output by vbusmonitor1. A KNXD_OPTS="-t 1" is the closest I can get (and I’ve walked all 16 bits looking for better without any success!)
vbusmonitor:
Current best effort – with ‘noise’ I want to trim if possible:
2024-08-08T09:13:28.543862+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [26:B.tpuarts/log 106.225] Recv L_Data low from 1.1.1 to 1/0/3 hops: 06 T_Data_Group A_GroupValue_Write (small) 0D 2024-08-08T09:13:28.544080+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [12:server/Server 106.225] Send(017): 06 10 05 30 00 11 29 00 BC D0 11 01 08 03 01 00 8D 2024-08-08T09:13:28.544294+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [12:server/Server 106.225] Dropped(017): 06 10 05 30 00 11 29 00 BC D0 11 01 08 03 01 00 8D 2024-08-08T09:13:28.800763+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [28:B.tpuarts/log 106.484] Recv(009): BC 11 0C 08 02 E1 00 81 34 2024-08-08T09:13:28.801079+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [26:B.tpuarts/log 106.484] Known Addr 1/0/2: yes 2024-08-08T09:13:28.801383+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [25:B.tpuarts/LowF 106.484] SendAck 11 2024-08-08T09:13:28.801611+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [28:B.tpuarts/log 106.484] Send(001): 11 2024-08-08T09:13:28.801825+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [26:B.tpuarts/log 106.484] Recv L_Data low from 1.1.12 to 1/0/2 hops: 06 T_Data_Group A_GroupValue_Write (small) 01 2024-08-08T09:13:28.802104+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [12:server/Server 106.484] Send(017): 06 10 05 30 00 11 29 00 BC D0 11 0C 08 02 01 00 81 2024-08-08T09:13:28.802336+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [12:server/Server 106.485] Dropped(017): 06 10 05 30 00 11 29 00 BC D0 11 0C 08 02 01 00 81 2024-08-08T09:13:29.345515+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [28:B.tpuarts/log 107.029] Recv(009): BC 11 01 08 03 E1 00 8D 34 2024-08-08T09:13:29.345842+10:00 knxLogger4 knxd[2445]: knxLogger: Layer 0 [26:B.tpuarts/log 107.029] Known Addr 1/0/3: yesI’ve not had any luck with filtering.
I tried to enable the ‘montoring’ filter set to suppress SEND messages, without success:
KNXD_OPTS="-t 1 -e 1.1.240 -E 1.1.241:5 -n knxLogger -D -T -R -S -i -B monitor --arg=send=0 -b tpuarts:/dev/ttyKNX1"(Re-ordering -B and its arg gave the same result).
Aug 08 09:31:13 knxLogger4 knxd[2739]: knxLogger: E00000032: [23:B.tpuarts] filter 'monitor' not found.Am I missing something?
Alternatively, can anyone suggest a better way to get some decoded bus output into a file – or is there a better way of getting this to Influx?
Thanks,
Greig.
Thanks Matthias.
Without some more detailed documentation or worked examples I fear your suggestion's too advanced for my skill level. (I had a look at the .py script in the examples, but I don't think it's been touched since the original repo. It dies with `No module named 'EIBConnection'` and I have no idea what to import or install to get beyond that.)
I'm using Tijl's Pi HAT to read the bus directly rather than over the network from my knx router, but I'm pretty sure I should be able to somehow hook into knxd to sink my teeth into the bus' communications, but I'm a bit lost for the right way to do that, hence using the only data I could find, the logs.
- Greig.
Thanks Othmar, linknx sounds like it's going to give me what I'm after, which is essentially just a delimited breakdown of source/destination address, DPT and value – the same as what I see in the ETS Diagnostics panel.
Am I right inferring that even with linknx I'll still need to write to a log file and then tail the data to telegraf/influxDB?
\- Greig,
I think I’ve found what I’ve been looking for: a python knxd client.
https://github.com/mhthies/knxdclient
(venv) pi@knxLogger4:~ $ python3 test.py Telegram from 1.1.1 to GAD 1/0/1: True Telegram from 1.1.1 to GAD 1/0/1: False