This happens when dongle has been plugged in but scanner isn't awake when Connect issued. Need some kind of alert to wake up scanner.
2024-02-20 16:29:59,361 barcode-scanner INFO: barcode scanner async reader started with port COM5
Exception in thread Thread-14 (reader_thread):
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\lking\Documents\Lou's Software\projects\tm-csv-connector\tm-csv-connector\barcode-scanner-client\app.py", line 187, in reader_thread
run(reader(port, logging_path))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 649, in run_until_complete
return future.result()
File "C:\Users\lking\Documents\Lou's Software\projects\tm-csv-connector\tm-csv-connector\barcode-scanner-client\app.py", line 157, in reader
transport, protocol = await create_serial_connection(readloop, InputChunkProtocol, port)
File "c:\Users\lking\Documents\Lou's Software\projects\tm-csv-connector\tm-csv-connector\.venv\lib\site-packages\serial_asyncio\__init__.py", line 448, in create_serial_connection
serial_instance = serial.serial_for_url(*args, **kwargs)
File "c:\Users\lking\Documents\Lou's Software\projects\tm-csv-connector\tm-csv-connector\.venv\lib\site-packages\serial\__init__.py", line 90, in serial_for_url
instance.open()
File "c:\Users\lking\Documents\Lou's Software\projects\tm-csv-connector\tm-csv-connector\.venv\lib\site-packages\serial\serialwin32.py", line 64, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'COM5': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)
Need to recover from this in scanner client
This happens when dongle has been plugged in but scanner isn't awake when Connect issued. Need some kind of alert to wake up scanner.