Jey-Cee / ioBroker.enocean

Connect and control your EnOcean devices with ioBroker.
Other
24 stars 12 forks source link

Enocean USB300: Error Resource temporarily unavailable Cannot lock port #166

Closed darkwaiter closed 11 months ago

darkwaiter commented 1 year ago

Contact Details

No response

What happened?

Hi,

I have problem with the Enocean adapter since a few days. I have a few windows sensors connected and all were working properly until I did (I suppose) an admin update. Unfortunately I cannot trace it back to a certain moment because I did a few updates over the last weeks and did not recognize that the Adapter was not working properly.

I'm using a USB300 connected to /dev/ttyUSB0 which is set in the adapter config. During the adapter restart the log shows "Error Resource temporarily unavailable Cannot lock port".

Can anybody help we with this Error message?

Thanks

Adapter Version

0.8.5

JS-Controller Version

4.0.24

Node JS Version

18.16.0

NPM Version

9.5.1

Operating System

Debian

Relevant log output

enocean.0 | 2023-06-06 19:12:11.845 | warn | An error occured at serial port: Error: Error Resource temporarily unavailable Cannot lock port
-- | -- | -- | --
enocean.0 | 2023-06-06 19:12:11.519 | info | starting. Version 0.8.5 in /opt/iobroker/node_modules/iobroker.enocean, node: v18.16.0, js-controller: 4.0.24
enocean.0 | 2023-06-06 19:12:05.160 | warn | An error occured at serial port: Error: Port is not open
enocean.0 | 2023-06-06 19:12:05.159 | info | Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason
enocean.0 | 2023-06-06 19:12:05.157 | info | terminating
enocean.0 | 2023-06-06 19:12:05.152 | info | cleaned everything up...
enocean.0 | 2023-06-06 19:12:05.148 | info | Got terminate signal TERMINATE_YOURSELF

Anything else?

No response

Jey-Cee commented 1 year ago

This message means that a other program uses the device. Normally use the /dev/serial/byid path while this is fixed and does not change on a restart.

darkwaiter commented 1 year ago

OK - just found out that the /dev/serial/byid folder does not exist any more. No wonder I cannot find the USB300 as it was setup in the adapter. The Adpter now only let me choose /dev/ttyUSB0. Did some googling but none of the fixes for the missing byid folder worked so far. Is there a way to enter the device id of the USB300 manually? Maybe in a config file?

Device 004 is the right one:

xx@xx:/ $ lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 005: ID 0bda:8771 Realtek Semiconductor Corp. Bluetooth Radio Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC Bus 001 Device 003: ID 10c4:ea60 Silicon Labs CP210x UART Bridge Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Strange thing is that the Zigbee and Bluetooth USB sticks still work properly.

Jey-Cee commented 1 year ago

Missing /dev/serial/by-id is a known issue, while a linux update broke this. But this is already fixed, so try to update your system.

/dev/ttyUSBx should work, but you have to choose the correct USB port.

darkwaiter commented 1 year ago

I tried some fixes but still no /dev/serial/by-id folder - but have a /dev/serial/by-path folder now/again/don't know?!

I also found out, that there is a (slightly hidden) scrollbar in the Enocean adapter settings when choosing the serial connection (on the very right of the screen). Scrolling down gave the option for "/dev/ttyUSB1". In the "standard view" there were only 2 options visible "Choose" and "/dev/ttyUSB0. To be fair I expected a larger selection window with more than two lines (like e.g. in the Zigbee Adapter) if there is more than one option available as long as there is space on the screen.

After switching between /dev/ttyUSB0 and /dev/ttyUSB1 and back again it works fine now. I don't know what has changed - in the end I did not change any setting in the adapter... but as long as it works I'm fine with it.