katie-snow / QtPyUltimarc

Python and QML tool for configuring Ultimarc USB devices.
GNU General Public License v3.0
12 stars 2 forks source link

Errors when trying to access Mini-PAC #44

Open ionetworkadmin opened 8 months ago

ionetworkadmin commented 8 months ago

I just purchased a Mini-PAC board and am attempting to connect to it. I'm using Linux Mint 21.2 with Kernel 6.6.6. I installed your ultimarc-ui tool. The gui opens successfully and recognizes the Mini-PAC device with ID number. When I click into the device it just spins because the terminal is showing the errors below. Any ideas? I intend to try connecting using Windows to confirm the board is ok, but the goal is to use it with Linux.

sysadmin@Oryx:~$ ultimarc-ui

USB device encountered an unexpected error, quitting. file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:95:17: Unable to assign [undefined] to bool file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:119:21: Unable to assign [undefined] to QUrl file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:133:25: Unable to assign [undefined] to QString file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:138:25: Unable to assign [undefined] to QString file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:137:25: Unable to assign [undefined] to bool file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:148:25: Unable to assign [undefined] to QString file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:147:25: Unable to assign [undefined] to bool file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:153:25: Unable to assign [undefined] to QString file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:163:13: Unable to assign [undefined] to QUrl

TypeError: print_exception(): Exception expected for value, str found


I also tried just the cli commands, but got errors there too.

sysadmin@Oryx:~$ ultimarc mini-pac --get-config

USB device encountered an unexpected error, quitting.

Traceback (most recent call last): File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/tools/mini_pac.py", line 140, in run exit_code = process.run() File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/tools/mini_pac.py", line 73, in run response = dev_h.get_device_config(indent, self.args.file) File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/devices/mini_pac.py", line 160, in get_device_config json_obj = self.to_json_str(config) File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/devices/mini_pac.py", line 145, in to_json_str return json_obj if self.validate_config(json_obj, 'mini-pac.schema') else None File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/devices/_device.py", line 408, in validate_config schema = cls.load_config_schema(schema_file) File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/devices/_device.py", line 397, in load_config_schema with open(schema_path) as h: FileNotFoundError: [Errno 2] No such file or directory: '/home/sysadmin/schemas/mini-pac.schema'

tool encountered an unexpected error, quitting.

ionetworkadmin commented 8 months ago

Just to update the functionality of the mini-pac board, I plugged it into a Windows machine and ran the Windows configuration tool and it worked fine. So the mini-pac board is OK.

katie-snow commented 8 months ago

This has to do with the schema files not being found. It is most likely the same as issue #38.

katie-snow commented 8 months ago

The new release is out on pypi.

ionetworkadmin commented 8 months ago

I update, but still got errors. So I ran the following command to force a complete re-install. pip install --upgrade --force-reinstall ultimarc[ui]

It then gave different errors.

sysadmin@Oryx:~$ ultimarc-ui

LIBUSB_ERROR_ACCESS (-3): Access denied, failed to open device d209:0440. An error occurred executing the property metacall 1 on property "large_spacing" of Units(0x611738f8d1a0) Traceback (most recent call last): File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/ui/device_model.py", line 79, in data return self.device.get_qml() File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/ui/devices/mini_pac.py", line 72, in get_qml self.populate() File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/ui/devices/mini_pac.py", line 60, in populate with dev as dev_h: File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/devices/_base.py", line 123, in enter raise USBDeviceNotFoundError(self.dev_key) ultimarc.exceptions.USBDeviceNotFoundError: d209:0440: Device was not found when trying to open it.

The above exception was the direct cause of the following exception:

SystemError: _PyEval_EvalFrameDefault returned a result with an exception set file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:144: Error: _PyEval_EvalFrameDefault returned a result with an exception set file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:148:25: Unable to assign [undefined] to QString file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:147:25: Unable to assign [undefined] to bool file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:153:25: Unable to assign [undefined] to QString file:///home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/qml/complex/DelegateDetail.qml:163:13: Unable to assign [undefined] to QUrl

ionetworkadmin commented 8 months ago

Running the cli command gave this.

sysadmin@Oryx:~$ ultimarc mini-pac --get-config

LIBUSB_ERROR_ACCESS (-3): Access denied, failed to open device d209:0440.

Traceback (most recent call last): File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/tools/mini_pac.py", line 140, in run exit_code = process.run() File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/tools/mini_pac.py", line 71, in run with dev as dev_h: File "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/devices/_base.py", line 123, in enter raise USBDeviceNotFoundError(self.dev_key) ultimarc.exceptions.USBDeviceNotFoundError: d209:0440: Device was not found when trying to open it.

tool encountered an unexpected error, quitting.

katie-snow commented 8 months ago

This error is from not having the udev rule placed in the rules.d directory. In "/home/sysadmin/.local/lib/python3.10/site-packages/ultimarc/udev/" there is the file 95-ultimarc.rules. Copy that file into /etc/udev/rules.d/ directory, you will need to do this with root permissions. Then restart the machine. That will fix this issue.

ionetworkadmin commented 8 months ago

I think we're almost there. I copied the file you specified, and the ultimarc-ui can now access the mini-pac without errors. Is there a way to make that file copy to the appropriate location during installation of ultimarc[ui] ?

But once it's open there's only 1 button option shown, and clicking the 'Write Device' button seems to do nothing.
ultimarc-ui

I was able to pull the config via CLI and write it out to a json file successfully. I haven't tried pushing any changes back into the device using CLI yet though.

katie-snow commented 8 months ago

This is a problem with using the latest PySide6. I was able to see the same problem. Going back to version 6.5.0 resolved the problem for me.

pip install PySide6==6.5.0 will get you on the PySide6 that will work correctly.

ionetworkadmin commented 8 months ago

Excellent. That worked perfectly, and I can now edit and write the changes to the device successfully. Thank you!

May I suggest adding a popup or text confirmation on the screen to confirm that changes were written to the device when clicking the 'Write Device' button. It is working and writing the changes to the device, but I had to pull the config separately to confirm because clicking the 'Write Device' button doesn't log or display that it's doing anything.