stm32_tiny_monitor icon indicating copy to clipboard operation
stm32_tiny_monitor copied to clipboard

fast_host.py and slow_host.py don't work on Arch Linux

Open efe3535 opened this issue 1 year ago • 5 comments

fast_host.py

------------- [ initialize ] -------------

Device not found... Connect device
Device Found!!
Setting device configuration...
ERROR: USBError occured. Re-connect the device...

---------------- [ end ] ----------------


------------- [ handshake ] -------------

ERROR: USBError occured. Re-connect the device...

---------------- [ end ] ----------------


------------- [ stream start ] -------------

Streaming started...
Traceback (most recent call last):
  File "/home/enginar/git-repos/stm32_tiny_monitor/host_python_scripts/fast_host/start_host.py", line 1, in <module>
    import fast_host
  File "fast_host.pyx", line 146, in init fast_host
    initialize()
  File "fast_host.pyx", line 141, in fast_host.initialize
    stream_out(usb_device)
  File "fast_host.pyx", line 101, in fast_host.stream_out
    img = Image.frombytes('RGB', (w, h), sct.grab(monitor).rgb)                 # <-- mss is way fater than pyautogui
  File "/usr/lib/python3.10/site-packages/mss/base.py", line 88, in grab
    return self._grab_impl(monitor)
  File "/usr/lib/python3.10/site-packages/mss/linux.py", line 446, in _grab_impl
    ximage = self.xlib.XGetImage(
  File "/usr/lib/python3.10/site-packages/mss/linux.py", line 191, in validate
    raise ScreenShotError(err, details=details)
mss.exception.ScreenShotError: XGetImage() failed
~/git-repos/stm32_tiny_monitor/host_python_scripts/f

slow_host.py

------------- [ initialize ] -------------

TinyMonitor Found... :)
Setting device configuration...
ERROR: USBError occured. Re-connect the device...

---------------- [ end ] ----------------


------------- [ handshake ] -------------

ERROR: USBError occured. Re-connect the device...

---------------- [ end ] ----------------


------------- [ stream start ] -------------

Streaming started...
Traceback (most recent call last):
  File "/home/enginar/git-repos/stm32_tiny_monitor/host_python_scripts/slow_host/host.py", line 144, in <module>
    initialize()
  File "/home/enginar/git-repos/stm32_tiny_monitor/host_python_scripts/slow_host/host.py", line 139, in initialize
    stream_out(usb_device)
  File "/home/enginar/git-repos/stm32_tiny_monitor/host_python_scripts/slow_host/host.py", line 99, in stream_out
    img = Image.frombytes('RGB', (w, h), sct.grab(monitor).rgb)                 # <-- mss is way fater than pyautogui
  File "/usr/lib/python3.10/site-packages/mss/base.py", line 88, in grab
    return self._grab_impl(monitor)
  File "/usr/lib/python3.10/site-packages/mss/linux.py", line 446, in _grab_impl
    ximage = self.xlib.XGetImage(
  File "/usr/lib/python3.10/site-packages/mss/linux.py", line 191, in validate
    raise ScreenShotError(err, details=details)
mss.exception.ScreenShotError: XGetImage() failed

efe3535 avatar Jul 21 '22 10:07 efe3535

That's weird. Unfortunately I don't have Arch Linux installed at this moment. I'll try to install it using virtual box and test the script.

Can you test on debian based system? Since I tested it only on Ubuntu/kubuntu

abhra0897 avatar Jul 22 '22 05:07 abhra0897

When I have the time I'll give this a chance, thank you!

efe3535 avatar Jul 22 '22 08:07 efe3535

Hi, I'm just curious if you could solve this issue.

I found a github issue about similar problem: https://github.com/mozilla/iris/issues/621

Apparently, if your system is using Wayland instead of X11, this problem might occur.

abhra0897 avatar Jan 30 '23 20:01 abhra0897

Unfortunately I switched to a Mac a month ago, so I'm unable to reproduce the issue. I was using X11 at the time though.

efe3535 avatar Jan 31 '23 16:01 efe3535

No problem.. Thanks for the confirmation.

abhra0897 avatar Feb 02 '23 06:02 abhra0897