SNMP v3 - passwordString is null

I just checked with a QNAP device, it works fine for me with

UID: snmp:target3:20bff957c2
label: SNMP v3 Target
thingTypeUID: snmp:target3
configuration:
  retries: 2
  hostname: <hostname>
  port: 161
  authPassphrase: <pass>
  privProtocol: DES
  refresh: 60
  user: <user>
  securityModel: AUTH_NO_PRIV
  authProtocol: SHA
  timeout: 1500
  engineId: <engineId>
channels:
  - id: test
    channelTypeUID: snmp:string
    label: test
    description: ""
    configuration:
      oid: ".1.3.6.1.2.1.1.1.0 "

How did you determine the engineId? I use

snmpget -v 3 -u <user> -l authNoPriv -a SHA -A <pass> <hostname> 1.3.6.1.6.3.10.2.1.1.0

But take care: For me it is very long and the last byte is on the second line, easy to overlook.

quite strange behaviour here. I try to explain.

The engineId was correct, but I’ve tried the same config, and it was not working. Then I’ve cut/past again the engineId, and it started working. Then I’ve tried AUTH_PRIV, again not working (with DES). Back to AUTH_NO_PRIV, and … not working :frowning:

At the end I’ve cut/paste again the engineId, and AUTH_NO_PRIV started working again :frowning:

Is that with the binding version from this morning or the one I posted this afternoon? The latter should fix reconfiguration issues.

using the last one. Now I’m not able to have AUTH_NO_PRIV working.

reloading openhab and QNAP

reloaded … nothing, AUT_NO_PRIV is not working anymore. Same AUT_PRIV. I’ve found an issue (the password cannot contain special characters). But still not working

OK now AUTH_NO_PRIV works.

two notes:

  • on QNAP side, don’t use special characters in the password. It doesn’t work
  • on OH side, don’t put privPassphrase even if you use as securityModel “AUTH_NO_PRIV”. removed privPassphrase, it became green immediately.

@J-N-K can you please put in the code something that can bypass the privPassphrase configuration if you use the securityModel “AUTH_NO_PRIV”? privProtocol can be in the config, but privPassphrase blocks something.

AUT_PRIV still not working. Investigating

my feeling is there is something in the relation between QNAP and OH that is not stable. If I change the securityModel, to have AUTH_NO_PRIV working again I need to stop/restart the snmp demon in QNAP, and recreate the thing in OH file. Or cut/paste again the engineId. After some changes, it works.

It seems that the QNAP devices change the engine id every time the configuration changes. I changed the code to auto-discover the engine id, maybe you can try if that works better:
org.openhab.binding.snmp-4.2.0-SNAPSHOT.jar.txt (681.3 KB)

do you think we have any chance to see the privacy encryption with DES working?
I’ll try the new binding right now

Yes, that works for me with QNAP. But I believe there is a limit either to length or allows characters. It works with a privacy passphrase 12345678 but not with foobarfoobar.

this is the official documentation:

but this is not correct. Special characters are not allowed (foobar$ doesn’t work). My password for SHA is 10 characters, and it works. I expect also for DES, but something doesn’t work.

wait, now it’s working :slight_smile: SHA and DES, with AUTH_PRIV :smiley:

I’ve just restarted the bundle.

@J-N-K I’ve reloaded for other reasons, and the connection with my Epson printer didn’t work

COMMUNICATION_ERROR
Cannot determine engineId

btw I’ve the right engineId configured in snmp.things

Only the epson printer, the other two (QNAP and APC) are working like a charm.

:frowning:

and after a while …back online.

Strange behaviors :slight_smile:

I think this may be related to the 5s timeout for discovery. If the printer sleeps it is probably not responding fast enough and we have to wait for the next round (default 60s later). I’ll increase the timeout to 15s.

yep exactly :slight_smile:


2024-05-26 17:07:14.300 [INFO ] [ding.snmp.internal.SnmpTargetHandler] - failed to renew target address, waiting for next refresh cycle

edit: I see some up/down during the afternoon. Perhaps, as you said, the printer in idle status is a bit unresponsive

@J-N-K hello :slight_smile:
just to let you know that the last binding in this thread is working well. Just printer and NAS are sometimes offline, but they come back online without manual intervention. Perhaps a timeout, as you said, that can be improved.

Question: when I’ll be able to switch to the normal distro version? in 4.2.0.M4?

thanks
Andrea

See openHAB 4.2 Milestone Builds - #5 by Kai

PR with latest changes is not merged.

Hi @J-N-K

is the latest version in the M4 now? I’ve just upgraded the system.

thanks
Andrea