Skip to content

How can I display the video feed from a USB camera connected to the Coral Dev Board while controlling it with WSL on Windows 10?/How to use Coral Dev Board on win10? #2

@loiswen

Description

@loiswen

Description

I am a newcomer using the Coral Dev Board. I want to connect a camera to the Coral Dev Board, run a model, and then send the results to a Windows host for processing and display.
Initially, I controlled Coral using WSL on Windows 10. I wrote some Python programs, pushed them to the development board to run, and communicated the running results on Coral to a program on Windows through socket communication. However, I found that I couldn't view the camera content successfully because Python scripts in WSL cannot use the graphical user interface.
I use socket communication to have the Coral send video data to the Windows side. The code can run, but the sending code on the Coral side only runs for a moment and then stops, with the following output:

mendel@purple-yarn:~$ python3 fasong.py

HOST IP: 127.0.0.1

LISTENING AT: ('192.168.101.2', 9999)

GOT CONNECTION FROM: ('192.168.101.82', 55082)

qt.qpa.xcb: could not connect to display

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.7/dist-packages/cv2/qt/plugins" even though it was found.

This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

Aborted 

Therefore, I attempted to control Coral directly on Windows 10 but encountered the following output:

17272@DESKTOP-FEIFH6G MINGW64 ~/Desktop
$ mdt shell
Waiting for a device...
Connecting to purple-yarn at 192.168.101.2
Key not present on purple-yarn -- pushing

Couldn't connect to keymaster on purple-yarn: [WinError 10061] The target computer actively refused the connection and could not be reached.

Did you previously connect from a different machine? If so,
mdt-keymaster will not be running as it only accepts a single key.

You will need to either:
   1) Remove the key from /home/mendel/.ssh/authorized_keys on the
      device via the serial console

- or -

   2) Copy the mdt private key from your home directory on this host
      in ~/.config/mdt/keys/mdt.key to the first machine and use
      'mdt pushkey mdt.key' to add that key to the device's
      authorized_keys file.

Failed to push via keymaster -- will attempt password login as a fallback.
Can't login using default credentials: Bad authentication type; allowed types: [
'publickey']

However, I can connect using the 'mdt shell' command in PuTTY, but when running a Python script in PuTTY to transmit image data via socket, I encounter the same issues as in WSL.

How can I achieve the desired functionality?

Click to expand!

Issue Type

Performance, Support

Operating System

Windows 10, Mendel Linux, Linux, Ubuntu

Coral Device

Dev Board

Other Devices

No response

Programming Language

Python 3.7

Relevant Log Output

WSL:
====================================
mendel@purple-yarn:~$ python3 fasong.py
HOST IP: 127.0.0.1
LISTENING AT: ('192.168.101.2', 9999)
GOT CONNECTION FROM: ('192.168.101.82', 52260)
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.7/dist-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

Aborted

==================================
git bash:
==================================
17272@DESKTOP-FEIFH6G MINGW64 ~/Desktop
$ mdt devices
purple-yarn             (192.168.101.2)

17272@DESKTOP-FEIFH6G MINGW64 ~/Desktop
$ mdt shell
Waiting for a device...
Connecting to purple-yarn at 192.168.101.2
Looks like you don't have a private key yet. Generating one.
Key not present on purple-yarn -- pushing

Couldn't connect to keymaster on purple-yarn: [WinError 10061]The target computer actively refused the connection and could not be reached.

Did you previously connect from a different machine? If so,
mdt-keymaster will not be running as it only accepts a single key.

You will need to either:
   1) Remove the key from /home/mendel/.ssh/authorized_keys on the
      device via the serial console

- or -

   2) Copy the mdt private key from your home directory on this host
      in ~/.config/mdt/keys/mdt.key to the first machine and use
      'mdt pushkey mdt.key' to add that key to the device's
      authorized_keys file.

Failed to push via keymaster -- will attempt password login as a fallback.
Can't login using default credentials: Bad authentication type; allowed types: [
'publickey']
=================================
putty:
=================================
purple-yarn login: mendel
Password:
Last login: Wed Dec 27 12:58:58 UTC 2023 from 192.168.101.82 on pts/0
Linux purple-yarn 4.14.98-imx #1 SMP PREEMPT Tue Nov 2 02:55:21 UTC 2021 aarch64

The programs included with the Mendel GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Mendel GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
mendel@purple-yarn:~$ python3 fasong.py
HOST IP: 127.0.0.1
LISTENING AT: ('192.168.101.2', 9999)
GOT CONNECTION FROM: ('192.168.101.82', 52489)
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.7/dist-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

Aborted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions