Browsing URIs on Linux

257 views
Skip to first unread message

ma...@makr.zone

unread,
May 1, 2023, 7:47:56 AM5/1/23
to OpenPnP
Hi everybody,

As you all know, Issues & Solutions provides links to the Wiki (and elsewhere) for instructions and information about issues and solutions. I consider this very important.

So it is unfortunate that some platforms seem not to support it. I have the same problem on a Kubuntu.You get this Error:

Screenshot_20230501_085829

The new test version should now help with this. It tries alternative ways to browse the URI and then falls back to copying the URI to the clipboard if that still didn't work.

Details here:

If this affects you, please test and report back!

_Mark

serge a

unread,
May 1, 2023, 11:49:24 AM5/1/23
to ope...@googlegroups.com
Great

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/edd7858e-5df1-410c-9e7f-5a1fea5471f0n%40googlegroups.com.

justin White

unread,
May 1, 2023, 6:00:22 PM5/1/23
to OpenPnP
Yeah that's the issue I had, I'll try the test version when I get back in front of it.

Litterio Andrea Guainella

unread,
May 2, 2023, 5:28:48 AM5/2/23
to OpenPnP
Hi Mark,
first of all thank you for great feature.
If useful for debug in windows platform the error seems to relate here I mean that in debug I found: "PlatformContext::CoInitializeEx failed (HRESULT = 00000001)" every when try to click to [I] (blue button) in I&S.
This is seems relate to camera driver (OpenPnpCaptureCamera) because with it the popup message appear instead without (ex: used simulatedcamera) the browser open page directly.

Maybe should work changed:

"hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);"
to
"hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);"

Unfortunately I don't have much time lately to test

LAG

Mark

unread,
May 2, 2023, 11:08:18 AM5/2/23
to ope...@googlegroups.com

Hi LAG,

From which test version to which have you updated? I'm asking, because the issue you're describing is hardly related to this topic/PR.

I guess it is related to this:

https://groups.google.com/g/openpnp/c/nF6X3Hj-c9I/m/fdzmz20fAAAJ

If so, we should discuss it further, there.

_Mark

You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpnp/0WTDo56vwow/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/7089857a-c5df-4ffe-bc7f-71510a60978fn%40googlegroups.com.

Litterio Andrea Guainella

unread,
May 2, 2023, 5:13:12 PM5/2/23
to OpenPnP
My OpenPnP version is 2023-05-01_13-16-44.0e5fd25 (Should be latest)...
You are right but I preferred to mention here because as I thought it was relevant to the error raised about: the platform is not compatible when opening the url.

LAG

mark maker

unread,
May 3, 2023, 2:35:07 AM5/3/23
to ope...@googlegroups.com

Hi LAG,

the new version is clear, the question is what version did you have before?

> the platform is not compatible when opening the url.

I'm confused. Are you saying that error appears when opening a URL?

Please post the log.

_Mark

Litterio Andrea Guainella

unread,
May 3, 2023, 6:43:52 AM5/3/23
to OpenPnP
Sorry Mark for mistake,
I didn't understand. Unfortunately I don't remember previous version but I think the penultimate.

For more clarity about it (in this case I not connected to real environment but I have check and same reason happen):

If I click to [I] blue button:

56.png

This happen:

/*** LOG ***/
2023-05-03 12:05:50.374 Main INFO: Bienvenue, Bienvenido, Willkommen, Hello, Namaskar, Welkom, Bonjour to OpenPnP version 2023-05-01_13-16-44.0e5fd25.
2023-05-03 12:05:50.378 Scripting TRACE: Scripting.on Startup
2023-05-03 12:05:50.472 OpenPnpCaptureCamera WARNING: No camera found with ID HD USB Camera \\?\usb#vid_32e4&pid_9230&mi_00#7&8851a40&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global for camera Top
2023-05-03 12:05:50.491 OpenPnpCaptureCamera WARNING: No camera found with ID HD USB Camera \\?\usb#vid_32e4&pid_9230&mi_00#6&5002f53&3&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global for camera Bottom
2023-05-03 12:06:24.618 UiUtils TRACE: Browse to https://github.com/openpnp/openpnp/wiki/Issues-and-Solutions

55.png

So if remove both OpenPnpCaptureCamera camera (because if there is present one OpenPnpCaptureCamera the reason is same), when i try to click the [I] blue button, chrome will open rightly the page
For this I went backwards and traced the error "PlatformContext::CoInitializeEx failed (HRESULT = 00000001)" connected to openpnp-capture

Seems as here as related to "PlatformContext::CoInitializeEx failed (HRESULT = 00000001)" for return false to compatibility...
I hope is understand

LAG

mark maker

unread,
May 3, 2023, 10:46:29 AM5/3/23
to ope...@googlegroups.com
Hello LAG,

this is really very strange.

Unfortunately, I have no idea about COM because I refuse to even touch it with a ten-foot pole, bad bad tech.

_Mark

Ian Arkver

unread,
May 3, 2023, 4:20:20 PM5/3/23
to OpenPnP
Interesting. I had a quick google and found a different SO answer to the one you linked in your PR. That uses a similar but slightly different set of fallbacks and on Windows seems to call explorer to launch the URI.

Similar bug thread here, with linked SO answer here which leads to this github repo here. Maybe there's a chance this works better on Windows?

Regards,
Ian

Mark

unread,
May 4, 2023, 7:21:06 AM5/4/23
to ope...@googlegroups.com

I believe the problem is actually with the openpnp-capture. It somehow leaves the COM context in an illegal state.

As LAG confirmed, it all works when he deletes the OpenPnpCaptureCameras. So this is likely related to the new version of openpnp-capture that was recently deployed into OpenPnP:

https://groups.google.com/g/openpnp/c/nF6X3Hj-c9I/m/fdzmz20fAAAJ

Something seems off with the Windows side of openpnp-capture. There have been various changes in the way COM objects are released. Incredibly, COM uses reference counting, even across processes (hence the "I won't even touch it with a ten-foot pole"). I tried to fix one obvious bug, but it still seems broken.

I believe it should be rolled back to the old version (just the Windows part, not the Mac/Apple Silicon/ARM/Raspi additions).

@vonnieda, what do you think?

_Mark

Jason von Nieda

unread,
May 4, 2023, 11:30:12 PM5/4/23
to OpenPnP
I can look into this and try to fix it Monday. Till then, if you think it's needed, feel free to roll back.

Jason

ma...@makr.zone

unread,
May 11, 2023, 10:58:49 AM5/11/23
to OpenPnP
I've reverted the openpnp-capture-java dependency back to version 0.0.22, which is the version prior to 2023-03-20 22:24:13.

This will also roll back the native support for Mac Apple silicon and other stuff. But as some Windows users reportedly can't work at all, I think this is justified (Mac users can keep using the previous test version until it is resolved).

I hope this can soon be resolved, either by just rolling back the Windows specific code, or by fixing the bugs.

Somebody familiar with COM? HELP WANTED!

Details here:

_Mark

mark maker

unread,
May 11, 2023, 11:04:08 AM5/11/23
to ope...@googlegroups.com

Jim Young

unread,
May 11, 2023, 11:33:16 AM5/11/23
to OpenPnP
It's been some years, but I have worked with COM.

mark maker

unread,
May 11, 2023, 12:10:47 PM5/11/23
to ope...@googlegroups.com

> It's been some years, but I have worked with COM.

Cool 😎 💯

I guess you've seen the problems described above. It is about the Windows stuff, which happens in win/.

https://github.com/openpnp/openpnp-capture/tree/master/win

Note that the library dependency was not updated in OpenPnP for a long time (until March 20, 2023). The last adopted version was 0.0.22 from Sep. 2020:

https://github.com/openpnp/openpnp-capture/tree/v0.0.22

I guess all the Windows specific changes since then are "suspicious". 😅

Plus there was a semantic merge conflict, that I tried to fix (with my limited knowledge about COM), but I might still have overlooked further issues:

https://github.com/openpnp/openpnp-capture/pull/65

Or maybe it is something completely different.

Apparently it is difficult to debug and test inside OpenPnP. The only thing I was able to do myself was using the

win/test/openpnp-capture-test.exe

Jason gave some advice but I did not follow up on it:

https://github.com/openpnp/openpnp-capture/pull/65#issuecomment-1509000858

Thanks! 💯

_Mark

Jim Young

unread,
May 11, 2023, 1:39:47 PM5/11/23
to OpenPnP
What specific steps can reproduce this problem in OpenPnP? I'm seeing references to clicking on URIs and opening script files, but I'm not understanding how this is related to video capturing and video processing in the openpnp-capture DLL?

I'm just trying to get a high level idea of what is going on.

Jason von Nieda

unread,
May 11, 2023, 2:34:03 PM5/11/23
to OpenPnP
I spent some time on this Monday but didn’t arrive at a solution. I reviewed all the PRs that have been merged since the last major update and I didn’t find any specific issues. When I ran out of time I was in the process of getting C/C++ debugging working in Windows so I could trace some stuff out.

I believe what is happening is that something in openpnp-capture, which is native and uses a bit of COM for Windows Media Foundation, is failing to properly cleanup or setup the COM environment, and somehow this is causing conflicts for other native libraries in OpenPnP that use COM.

Since v0.0.22 of openpnp-capture to current, there have really just been a handful of Windows specific changes. It's easy to see them here: https://github.com/openpnp/openpnp-capture/commits/master/win

They are:

A few of those introduce some COM concepts I've not used, so it's possible something slipped by in merging those.

The difficulty in testing and debugging this is because of the complexity of getting the library into OpenPnP for testing. You have to build openpnp-capture.dll, then build that into openpnp-capture-java, which is a Java wrapper, and then build that into OpenPnP.

What I usually do is something like this:

1. Setup native build environment openpnp-capture.
2. Setup Java build environment for openpnp-capture-java.
3. Setup Java build environment for openpnp.
4. Use a script or batch file to build openpnp-capture and copy the binary into openpnp-capture-java.
5. Build openpnp-capture-java and install to local repo with `mvn install`. This will install the current build into the local Maven repo on your disk so that other Maven tasks pick it up.
6. Build openpnp using `mvn package` to pick up the new dependency.
7. Test OpenPnP.
8. Repeat.

Sounds like a lot, but it's really just a Bash one-liner and takes like 30 seconds to build everything.

I can continue hacking on this Monday, but if you'd like to jump in that would be most appreciated! In particular, if you could review the Windows related changes in the PRs above and see if anything jumps out that would be great.

I'm pretty busy for the next few days, but I will keep a close eye on this thread and respond to any questions ASAP. In particular, if you have questions about building, deploying, versions, etc. I can answer those very quickly. It's a complicated set of build systems and there's a lot to learn.

Thanks,
Jason



Mark

unread,
May 17, 2023, 3:32:43 PM5/17/23
to ope...@googlegroups.com

Like I described here, and in the following post...

https://groups.google.com/g/openpnp/c/SFUnSoJpUig/m/uzOLsa2vAAAJ

... I guess I found the real culprit.

https://bugs.openjdk.org/browse/JDK-8270269

So it isn't the openpnp-capture .dll that is causing this, really. But in order to accomodate the stupid COM constraint, and the JVM bug, we likely need to use:

    CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)

And I now realize that LAG has suspected this two weeks ago!

https://groups.google.com/g/openpnp/c/0WTDo56vwow/m/2vurCpoKCAAJ

I hope @Jim Young or @LAG could give it a go and make a PR? 😁😎

https://github.com/openpnp/openpnp-capture

I frankly haven't got the time...

_Mark

Mark

unread,
May 18, 2023, 8:11:55 AM5/18/23
to ope...@googlegroups.com

Hi everybody,

The test version of OpenPnP now again contains the newest openpnp-capture-java library, as it turned out not to be the culprit.

Apple silicon and Raspi 4 users should be happy again.

Windows users please use the workaround as described here:

https://github.com/openpnp/openpnp/pull/1560

Allow some minutes to deploy.

_Mark

Mark

unread,
May 18, 2023, 8:48:47 AM5/18/23
to ope...@googlegroups.com

I've quickly made a PR fixing the

CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)

But that's all I can offer at the time (gotta go).

@vonnieda, perhaps you can quickly have a look and/or deploy for us to test.


_Mark

Jason von Nieda

unread,
May 19, 2023, 4:15:25 PM5/19/23
to OpenPnP
Thanks Mark, I deployed it. Will take 4-8 hours to hit Maven, then we can try it in OpenPnP. New version is v0.0.28.

Thanks,
Jason

Mark

unread,
May 25, 2023, 3:09:23 PM5/25/23
to ope...@googlegroups.com

Hi everybody,

this fix is now in the new test version. Allow some minutes to deploy.

OpenPnpCaptureCamera should now again work together with the installer-packaged Java 17's Desktop functionality on Windows.

Opening the Scripts directory or browsing URLs should work.

Details:

https://github.com/openpnp/openpnp/pull/1562

_Mark

Reply all
Reply to author
Forward
0 new messages