Hi,
I’m trying to use the new SNMP Binding for the DAEnetIP2 v2 Relay Board.
I followed the docu: SNMP Binding and polling with the GET command and sending with the SET comand works so far. Only receiving TRAP commands don’t work.
I’m using:
- Raspberry Pi 3+
- Openhabian with Openhab 2.5.5-1 (Release Build)
- new SNMP Binding
- DAEnetIP2 v2 Relay Board
The Relay Board uses SNMP v1 and is configured as:
- Agent Port: 161
- Read-only Community: public
- Read-write Community: public
- Trap Receiver IP Address: 192.168.1.211 (Openhab IP)
- Trap Receiver Port: tried with 162 and 8162
- Trap Community: public
For checking the correct behaviour I installed snmptrapd
With: sudo snmptrapd -f -Lo -c /etc/snmp/snmptrapd.conf
I received the TRAP which looks ok (configured relay board at port 162):
2020-05-24 13:47:33 192.168.1.216(via UDP: [192.168.1.216]:65534->[192.168.1.211]:162) TRAP, SNMP v1, community public iso.3.6.1.4.1.42505.9 Enterprise Specific Trap (0) Uptime: 0:02:21.81 iso.3.6.1.4.1.42505.9.2.3.1 = INTEGER: 51
Unfortunately I don’t get a responce in Openhab.
I also activated the debug Logging via: log:set debug org.openhab.binding.snmp
But in the openhab 2 Log Viewer I don’t receive anything. (GET and SET still working)
My config are (for OH relay board port configured at 8162) :
snmp.cfg
# Configuration for the SNMP Binding
#
# Port used for receiving traps.
# This setting defaults to 0 (disabled / not receiving traps)
port=8162
SNMP.things
Thing snmp:target:DAEnetIP2v2 [ hostname="192.168.1.216", protocol="v1", refresh="20", community="public" ] {
Channels:
Type switch : port5pin1 [ oid=".1.3.6.1.4.1.42505.9.2.2.1.0", mode="READ_WRITE", datatype="INT32", onvalue="1", offvalue="0" ]
Type switch : port5pin2 [ oid=".1.3.6.1.4.1.42505.9.2.2.2.0", mode="READ_WRITE", datatype="INT32", onvalue="1", offvalue="0" ]
Type switch : port5pin3 [ oid=".1.3.6.1.4.1.42505.9.2.2.3.0", mode="READ_WRITE", datatype="INT32", onvalue="1", offvalue="0" ]
Type switch : port5pin4 [ oid=".1.3.6.1.4.1.42505.9.2.2.4.0", mode="READ_WRITE", datatype="INT32", onvalue="1", offvalue="0" ]
Type switch : port5pin5 [ oid=".1.3.6.1.4.1.42505.9.2.2.5.0", mode="READ_WRITE", datatype="INT32", onvalue="1", offvalue="0" ]
Type switch : port5pin6 [ oid=".1.3.6.1.4.1.42505.9.2.2.6.0", mode="READ_WRITE", datatype="INT32", onvalue="1", offvalue="0" ]
Type switch : port5pin7 [ oid=".1.3.6.1.4.1.42505.9.2.2.7.0", mode="READ_WRITE", datatype="INT32", onvalue="1", offvalue="0" ]
Type switch : port5pin8 [ oid=".1.3.6.1.4.1.42505.9.2.2.8.0", mode="READ_WRITE", datatype="INT32", onvalue="1", offvalue="0" ]
Type number : ADC1lowT [ oid=".1.3.6.1.4.1.42505.9.2.3.1", mode="TRAP" , datatype="INT32" ]
}
SNMP.items
// *********** Ausgaenge des DAEnetIP2v2 Relay Borad ****************
Switch Port5Pin1 "Port5.1 [%d]" { channel="snmp:target:DAEnetIP2v2:port5pin1" }
Switch Port5Pin2 "Port5.2 [%d]" { channel="snmp:target:DAEnetIP2v2:port5pin2" }
Switch Port5Pin3 "Port5.3 [%d]" { channel="snmp:target:DAEnetIP2v2:port5pin3" }
Switch Port5Pin4 "Port5.4 [%d]" { channel="snmp:target:DAEnetIP2v2:port5pin4" }
Switch Port5Pin5 "Port5.5 [%d]" { channel="snmp:target:DAEnetIP2v2:port5pin5" }
Switch Port5Pin6 "Port5.6 [%d]" { channel="snmp:target:DAEnetIP2v2:port5pin6" }
Switch Port5Pin7 "Port5.7 [%d]" { channel="snmp:target:DAEnetIP2v2:port5pin7" }
Switch Port5Pin8 "Port5.8 [%d]" { channel="snmp:target:DAEnetIP2v2:port5pin8" }
// *********** Eingaenge des DAEnetIP2v2 Relay Borad ****************
Number ADC1lowT "Trap Adc 1 low [%d]" { channel="snmp:target:DAEnetIP2v2:ADC1lowT" }
SNMP.sitemap
Frame label="SNMP"
{
Switch item=Port5Pin1
Switch item=Port5Pin2
Switch item=Port5Pin3
Switch item=Port5Pin4
Switch item=Port5Pin5
Switch item=Port5Pin6
Switch item=Port5Pin7
Switch item=Port5Pin8
Text item=ADC1lowT
}
In the Basic UI the Text item ADC1lowT which references to the TRAP channel shows only “-”
For me it looks like that OH don’t listen to the TRAP port or don’t get access to it? (but I get no error message)
Have i configured something wrong?
Unfortunately i don’t know how to debug it.
Thanks in advise
David