SNMP 2.x issue

@anonymous.one any news here?

My apologies, Iā€™ve been fighting off a head cold and some other life stuff needed my attention.

Testing with Paper UI, I donā€™t see ā€˜doNotLogExceptionā€™ on the channel as an option; onValue worked using the IP address. The offValue still returns UNDEF when I disable wifi on the phone, have tried Null/NULL/UNDEF and donā€™t receive an OFF value.

Similar results for the configuration file, I was able to add both new values ā€˜doNotLogException=ā€œtrueā€, exceptionValue=ā€œOFFā€ā€™. And checking back on my openhab.log file I have a full day of SNMP Exceptions.

Just to also verify this is the right version (I think I updated to the latest, but want to verify):

2.5.0.201908161733
1 Like

Not sure :D. Could also be I forgot to upload the bundle. I compiled a new one (timestamp today).Sorry.

1 Like

Not a problem at all, with that head cold I couldnā€™t be sure if I ran the updated jar or not. :wink:

Looks like we have a winner with this latest update, ONs and OFFs are show correctly for the item states based on my phoneā€™s wireless being on or off.

Going to do some testing on the 802.11 association OID that I also use, I donā€™t think that one behaves like the ARP table but it has been a while since I set that up. After I finish up some work things and having to go to a fair, Iā€™ll spin up some more testing!

Thanks for the awesome work @J-N-K!!!

2 Likes

So had some odd issues with my OH, to such an extent that I had to restart the service as everything just stopped working; shortly before this I was testing with my wireless dot11assoc OID, what is odd is that all 4 OIDs showed up as NULL (4 OIDs = 2.4 Ghz & 5 Ghz, for two access points). What is more odd is the previous working item went into a NULL value. At this point Iā€™m unsure if it was due to what I was testing or something else blew a gasket; running 2.5 M2, only bleeding edge binding is SNMP currently (just a point of reference for future readers).

So for a new round of testing I tracked down which access point I had an association to by doing a snmpwalk from the OH system on OID .1.3.6.1.4.1.9.9.273.1.2.1.1.16.random.generated.values (its random per device) and have the hex string value of ā€˜c0 a8 01 05ā€™ returned. I have tried periods and ā€˜ā€™ like I did in my solution in the snmp1.x binding. The item value never updates, so I do know I am using an IP of the AP that is not in the same subnet as OH (the ARP table OID, I was using an IP in the same subnet as OH; havenā€™t added that back into OH yet). Or the value of the OID is the problem?
image

Using Paper UI currently as the thing file does not like something I have done and Iā€™m trying to keep troubleshooting limited to hopefully ID this issue.

Let me know if I can provide any other info @J-N-K.

You get a string that reads c0 a8 01 05 or you get a four character string with the corresponding characters?

The string is a hex string equal to the phoneā€™s IP address, so each device will result in a different value. Since the first three octets of the IP are the same it is always ā€˜c0 a8 01 **ā€™ for the subnet 192.168.1.xxx.

So you get 11 bytes? Or 4 bytes and this is converted for display?

Iā€™m not entirely sure if I know the answer and Iā€™m not finding any good information via Google :confused:

The complete output of the snmpwalk is this:

Hex-STRING: c0 a8 01 05

Looks like 4 bytes. Iā€˜ll have to think about it a little bit.

1 Like

No rush, the 1.x binding is still doing the heavy lifting; and the ARP one is the more important one, this one is more of a helpful functionality.

Let me know if there is any other information/logs I can provide!

1 Like

Please try bundle:update <number> https://janessa.me/esh/org.openhab.binding.snmp-hexstring.jar', documentation is here.

1 Like

Initial testing looks good in PaperUI so far, did find an peculiar issue when I re-setup the thing in PaperUI from scratch the hex option is not in the drop down. Saving it as another value and then editing it displayed the new hex option.

I will get the other 3 channels setup as my phone is being a pita right now and jumping to the other AP or the wrong frequency.

Awesome work @J-N-K!

1 Like

I have no idea how this could happen. Did you try restarting openHAB? I guess Someone caches the old definition somewhere.

Iā€™ll give that a try before I start on adding all the channels added.

Apologies, work and family life have kept me from testing this; unless something else blows up on me tomorrow at work I should have free time tomorrow night.

Another update on the hexstring SNMP, I finally got around to a restart and some testing yesterday during the US holiday; the items have been linked for over 24 hours and Iā€™ve moved throughout my house but only 1 item shows an update the other 3 still report UNDEF.

Iā€™m going to spin up a VM and install OH 2.5 M2 with this hexstring SNMP binding so I can more easily restart OH without having to deal with members of the household or wait for all the various files to load into memory.
Just for grins where does the hexstring.jar file reside in the linux file system, when performing a restart the original binding for 2.5M2 is installed and I could just chuck in the file in the addon folder on the VM to also avoid that issue. I can always resort to tracking it down on the current system, just asking if anyone already knew the location. :slight_smile:

Alright @J-N-K got a second dedicated OH up and running for the SNMP testing, I have both things (one per access point), 2 channels per thing, and 1 item per channel.

Currently all 4 items have UNDEF for a state, I tracked down with OID to identify which AP I was connected to; so far Iā€™ve tried with a .1 and a 1 at the start of the OID string. Going to try some variations of the hex value.
I also have the exception set to be OFF, so Iā€™m unsure why the system isnā€™t force an OFF state on the items?

1 Like

You need to show the complete configuration and set the log level at least to debug, better to trace. Post the log.

I have the binding set to DEBUG at the moment using the following, everything else is the default levels let me know if I need to change one of the others:

log:set DEBUG org.openhab.binding.snmp

Didnā€™t catch this the other day (I blame SAP for eating all my troubleshooting thinking) but the channel creation in PaperUI is generating this error in the openhab.log

[WARN ] [ding.snmp.internal.SnmpTargetHandler] - illegal value configuration for channel snmp:target:6b528f67:phone_arp
[WARN ] [ding.snmp.internal.SnmpTargetHandler] - illegal value configuration for channel snmp:target:6b528f67:phone
[WARN ] [ding.snmp.internal.SnmpTargetHandler] - illegal value configuration for channel snmp:target:89ec82ec:phone24

Thought the underscore was the issue, phone24 is the hex AP OID, and the phone/phone_arp is the original one we tested on.
It also looks like items are not linking to the channels (my guess is due to the log above).

image