Hi,
after using openHAB 2.5 on a Synology for a while I needed to update now.
I’m now running openHAB 3.2.0. In preparation I had to do the switch from Oracle Java 8 to Azul Java 11. In order to connect to a Weidmann Smart Meter reader I was happily using the Smartmeter binding with OH 2.5 and the following things configuration:
smartmeter:meter:powermeter [port="/dev/ttyUSB0", refresh=10]
With 2.5 everything worked fine. After the switch I constantly (and instantly) get “No provider for port /dev/ttyUSB0 found” and the Smartmeter-Thing never comes online.
Searching the forum I came across several similar posts:
- OH3.X Alternative Java serial provider
- [3.0 M3] Problem with Serial device / Smart Meter Binding
- OH3: SmartMeter Binding looses connection after a while: No provider for port /dev/ttyUSB.COM found
Also I checked the docs for the Serial Port Configuration.
Before writing this I checked and tried the following:
-
cat /dev/ttyUSB0
produces binary output on the console - User openhab has access rights to the device:
$ ls -al /dev/ttyUSB0
crwxrwxr-x 1 openhab users 188, 0 Apr 25 06:44 /dev/ttyUSB0
- To be sure I also added the openhab user to the group dialout
- I’ve also added EXTRA_JAVA_OPTS: -Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0
- Upgraded nrjavaserial to 5.2.1.OH1
- Restarted several times in between the steps.
- Played around with different refresh times (5, 10, 30)
- Removed the textual configuration and added it via UI
From the log (DEBUG):
2022-04-25 17:14:12.053 [DEBUG] [ding.smartmeter.internal.MeterDevice] - Opening connection to smartmeter:meter:powermeter
2022-04-25 17:14:12.056 [DEBUG] [ding.smartmeter.internal.MeterDevice] - Failed to read: No provider for port /dev/ttyUSB0 found. Closing connection and trying again in 2 seconds...; smartmeter:meter:powermeter
java.lang.IllegalStateException: No provider for port /dev/ttyUSB0 found
at org.openhab.binding.smartmeter.internal.sml.SmlSerialConnector.openConnection(SmlSerialConnector.java:137) ~[bundleFile:?]
at org.openhab.binding.smartmeter.internal.MeterDevice.lambda$1(MeterDevice.java:168) ~[bundleFile:?]
at io.reactivex.internal.operators.flowable.FlowableDoOnLifecycle$SubscriptionLambdaSubscriber.onSubscribe(FlowableDoOnLifecycle.java:63) [bundleFile:?]
at io.reactivex.internal.operators.flowable.FlowableTimeoutTimed.subscribeActual(FlowableTimeoutTimed.java:47) [bundleFile:?]
at io.reactivex.Flowable.subscribe(Flowable.java:14479) [bundleFile:?]
at io.reactivex.internal.operators.flowable.FlowableDoOnLifecycle.subscribeActual(FlowableDoOnLifecycle.java:38) [bundleFile:?]
at io.reactivex.Flowable.subscribe(Flowable.java:14479) [bundleFile:?]
at io.reactivex.internal.operators.flowable.FlowableDoOnEach.subscribeActual(FlowableDoOnEach.java:50) [bundleFile:?]
at io.reactivex.Flowable.subscribe(Flowable.java:14479) [bundleFile:?]
at io.reactivex.internal.operators.flowable.FlowableDoOnLifecycle.subscribeActual(FlowableDoOnLifecycle.java:38) [bundleFile:?]
at io.reactivex.Flowable.subscribe(Flowable.java:14479) [bundleFile:?]
at io.reactivex.internal.operators.flowable.FlowableDoOnEach.subscribeActual(FlowableDoOnEach.java:50) [bundleFile:?]
at io.reactivex.Flowable.subscribe(Flowable.java:14479) [bundleFile:?]
at io.reactivex.internal.operators.flowable.FlowablePublish.connect(FlowablePublish.java:130) [bundleFile:?]
at io.reactivex.internal.operators.flowable.FlowableRefCount.subscribeActual(FlowableRefCount.java:91) [bundleFile:?]
at io.reactivex.Flowable.subscribe(Flowable.java:14479) [bundleFile:?]
at io.reactivex.Flowable.subscribe(Flowable.java:14426) [bundleFile:?]
at io.reactivex.internal.operators.flowable.FlowableRepeatWhen$WhenReceiver.onNext(FlowableRepeatWhen.java:100) [bundleFile:?]
at io.reactivex.subscribers.SerializedSubscriber.onNext(SerializedSubscriber.java:100) [bundleFile:?]
at io.reactivex.internal.operators.flowable.FlowableDelay$DelaySubscriber$OnNext.run(FlowableDelay.java:114) [bundleFile:?]
at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker$BooleanRunnable.run(ExecutorScheduler.java:260) [bundleFile:?]
at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker.run(ExecutorScheduler.java:225) [bundleFile:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
This seems to happen because the SmlSerialConnector can’t get an id for the portName (/dev/ttyUSB0):
But why?
I don’t know what else I could try.
Has anyone any idea what else to test or to do?
Could it somehow be related to the Azul Java (OpenJDK Runtime Environment Zulu11.54+25-CA (build 11.0.14.1+1-LTS))?