I’m trying to use for the first time the SNMPv3 to collect some info from my NAS. Here my conf:
Thing snmp:target3:QNAP "QNAP" @ "Techroom" [ hostname="192.168.3.3", engineId="xxxxxxxxxxxxxxxxxxxxxxxx", user="test", securityModel="AUTH_NO_PRIV", authPassphrase="pass", authProtocol="SHA" ] {
Channels:
Type string : Model [ oid=".1.3.6.1.2.1.47.1.1.1.1.2.1", mode="READ" ]
Type string : Serial [ oid=".1.3.6.1.2.1.47.1.1.1.1.11.1", mode="READ" ]
Type string : Firmware [ oid=".1.3.6.1.2.1.1.1.0", mode="READ" ]
Type string : Upgrade [ oid=".1.3.6.1.4.1.8072.1.2.1.1.4.0.10.1.3.6.1.4.1.55062.1.12.7.127", mode="READ" ]
The log I see:
2024-05-24 17:13:33.691 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'snmp:target3:QNAP': Cannot invoke "org.snmp4j.smi.OctetString.getValue()" because "passwordString" is null
java.lang.NullPointerException: Cannot invoke "org.snmp4j.smi.OctetString.getValue()" because "passwordString" is null
at org.snmp4j.security.AuthGeneric.passwordToKey(AuthGeneric.java:294) ~[?:?]
at org.snmp4j.security.SecurityProtocols.passwordToKey(SecurityProtocols.java:342) ~[?:?]
at org.snmp4j.security.USM.addUser(USM.java:902) ~[?:?]
at org.openhab.binding.snmp.internal.SnmpServiceImpl.addUser(SnmpServiceImpl.java:184) ~[?:?]
at org.openhab.binding.snmp.internal.SnmpServiceImpl.addUser(SnmpServiceImpl.java:179) ~[?:?]
at org.openhab.binding.snmp.internal.SnmpTargetHandler.initialize(SnmpTargetHandler.java:213) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor109.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [bundleFile:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:840) [?:?]
yes it is … and yes, even with my printer, you can always find the “engineId” with snmpwalk. I can confirm.
As I can confirm that I’ve found (perhaps) the issue.
For a reason I don’t know, some hosts permits the config of SNMPv3 only with the encryption of both auth and data. I’ve tried with my printer, and it works. Auth only doesn’t work.
I’ll check with the QNAP NAS and let you know shortly.
Please uninstall the binding, download the attached file, remove the .txt extension and drop the file in your addons folder. I have done some other improvement, please try if that works for you.
Is there any log on the QNAP why it is not responding?Unfortunately in most cases there is just “no answer” if something is wrong. Did you try the different SHA lengths? Maybe they require one of these.
I have prepared a new version
<removed> which should resolve the issue with restarting the bundle after a config change.