OpenPnpCaptureCamera on Linux

281 views
Skip to first unread message

ma...@makr.zone

unread,
Dec 21, 2022, 3:32:15 PM12/21/22
to OpenPnP
Hi all,

I'm trying to run OpenPnP on a new Linux system (formerly mostly Windows). I get various problems USB cameras (ELP cameras that work nicely on Windows).

Operation is unreliable. I often need to stop the whole Eclipse (likely the Java VM?) to make it work again (may be debugging related).

The reported min/max values for exposure do not make sense. Setting exposure is behaving as if only the lower bits of the value were significant. Subsequently, the Issues & Solutions exposure tuning does not really work well.

Also get these errors, which are likely related:

[ERR ] getPropertyLimits (ID=2) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getAutoProperty (ID=2) failed on VIDIOC_G_CTRL (errno 22)
[ERR ] getPropertyLimits (ID=2) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getPropertyLimits (ID=2) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getPropertyLimits (ID=2) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getProperty (ID=2) failed on VIDIOC_G_CTRL (errno 22)
[ERR ] getAutoProperty (ID=2) failed on VIDIOC_G_CTRL (errno 22)
[ERR ] getAutoProperty (ID=5) failed on VIDIOC_G_CTRL (errno 22)
[ERR ] getAutoProperty (ID=5) failed on VIDIOC_G_CTRL (errno 22)
[ERR ] getPropertyLimits (ID=3) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getPropertyLimits (ID=3) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getPropertyLimits (ID=3) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getPropertyLimits (ID=3) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getProperty (ID=3) failed on VIDIOC_G_CTRL (errno 22)

Help is very welcome!

_Mark

Dave McGuire

unread,
Dec 21, 2022, 3:39:54 PM12/21/22
to ope...@googlegroups.com
This probably doesn't count as "help", but I'm running ELP cameras
under Linux without difficulty. I've not really dug into their
settings, beyond just setting them such that it works well, but they're
very stable. I'm sure you're running them on separate buses, right?

-Dave

--
Dave McGuire
McGuire Scientific Services, LLC
New Kensington, PA

Jim Young

unread,
Dec 22, 2022, 12:06:04 AM12/22/22
to OpenPnP
The errors are coming from the camera driver. I'm not sure why. What distribution are you using?

mark maker

unread,
Dec 22, 2022, 2:03:44 AM12/22/22
to ope...@googlegroups.com

> I'm sure you're running them on separate buses, right?

Just testing with one for now, but yeah, I'm very aware of that, thanks! 😁

_Mark

mark maker

unread,
Dec 22, 2022, 2:06:19 AM12/22/22
to ope...@googlegroups.com

> What distribution are you using?

Operating System: Kubuntu 22.04
Kernel Version: 5.15.0-56-generic (64-bit)

_Mark
--
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/155d234a-b74b-41e4-8087-022f81251dbdn%40googlegroups.com.

Dave McGuire

unread,
Dec 22, 2022, 6:44:34 AM12/22/22
to ope...@googlegroups.com
On 12/22/22 02:03, mark maker wrote:
> /> I'm sure you're running them on separate buses, right? //
> /
>
> Just testing with one for now, but yeah, I'm very aware of that, thanks! 😁

I figured; it's just important enough to bear mentioning just in case. :)

vespaman

unread,
Dec 22, 2022, 9:37:56 AM12/22/22
to OpenPnP
Hi Mark

Heh! That is exactly what I asked about here 
I have just changed to a new box, hoping it will go away (not Ubuntu any longer), but I guessing it will not.
I don't have any ELP cameras.

 - Micael

mark maker

unread,
Dec 22, 2022, 10:28:10 AM12/22/22
to ope...@googlegroups.com

I see, and linking from there an even older thread from 2018.  🙁

(also found my email client does not find these error keywords in my mailbox... another thing I must fix 😭)

_Mark

--
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.

vespaman

unread,
Dec 22, 2022, 10:28:48 AM12/22/22
to OpenPnP
So, I just tested on the new box, and I have the same errors on this one.

And:- I should perhaps also say that I am not sure about the camera (down cam) - maybe it is a ELP? It shows up as "Sunplus Innovation Technology Inc", but maybe this is just "inherited" from some other camera/driver.

The up cam (USB3) did not give me any problem, as far as I remember.

Will setup this new box properly in the upcoming days.

- Micael

mark maker

unread,
Dec 22, 2022, 11:57:05 AM12/22/22
to ope...@googlegroups.com

OT: if anybody uses Thunderbird, and suddenly wonders, why messages are not indexed, check this checkbox in the folder properties:

_Mark

Litterio Andrea Guainella

unread,
Dec 22, 2022, 12:15:33 PM12/22/22
to OpenPnP
Hi Mark,
if it can be useful I did an investigation and as you can see from the image error 22 is related to arguments passed incorrectly.
Unfortunately I don't have the pnp with me to debug deeply but I hope it helps.
Also attach linux driver for elp camera and instruction for use

42.png

LAG

43.png
H264_Driver_AP_SDK_V11.zip

Litterio Andrea Guainella

unread,
Dec 22, 2022, 12:29:45 PM12/22/22
to OpenPnP
Side note: seems errorno 22 is normal in v4l2 API because v4l2 poll the device until data return is valid so many attempt doing (maybe ID=x in your example?)

LAG

mark maker

unread,
Dec 23, 2022, 3:47:24 AM12/23/22
to ope...@googlegroups.com

> This probably doesn't count as "help", but I'm running ELP cameras under Linux without difficulty.  I've not really dug into their settings, beyond just setting them such that it works well, but they're very stable.

@Dave McGuire, please send a screenshot of your Device Settings, thanks!

_Mark

mark maker

unread,
Dec 23, 2022, 3:50:21 AM12/23/22
to ope...@googlegroups.com
Thanks LAG,

Some background, for others reading this to understand:

openpnp-capture is a separate C++ project, creating cross-plattform web-cam access, here:

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

Then this is wrapped in Java in the openpnp-capture-java project, here:

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

Finally, OpenPnP is consuming it in the OpenPnpCaptureCamera, here:

https://github.com/openpnp/openpnp/blob/develop/src/main/java/org/openpnp/machine/reference/camera/OpenPnpCaptureCamera.java

I'm not at all familiar with openpnp-capture, even less with the underlying tech, and frankly, I hoped I would never have to look into it. 😅

@LAG, you wrote:

> errorno 22 is normal in v4l2 API because v4l2 poll the device until data return is valid so many attempt doing

do you mean to say the polling is not done properly?

I guess this comes from PlatformStream::getProperty() et al. around here:

https://github.com/openpnp/openpnp-capture/blob/a3975f761ae2fd0453c92e9abff73532a2546a4b/linux/platformstream.cpp#L821

and polls here:

https://github.com/openpnp/openpnp-capture/blob/a3975f761ae2fd0453c92e9abff73532a2546a4b/linux/platformstream.cpp#L55-L65

In fact, after examining this, I'm not sure these are actually real errors. Some properties might simply not be supported by different camera models:

https://github.com/openpnp/openpnp-capture/blob/a3975f761ae2fd0453c92e9abff73532a2546a4b/include/openpnp-capture.h#L73

// supported properties:
#define CAPPROPID_EXPOSURE      1
#define CAPPROPID_FOCUS         2
#define CAPPROPID_ZOOM          3
#define CAPPROPID_WHITEBALANCE  4
#define CAPPROPID_GAIN          5
#define CAPPROPID_BRIGHTNESS    6
#define CAPPROPID_CONTRAST      7
#define CAPPROPID_SATURATION    8
#define CAPPROPID_GAMMA         9
#define CAPPROPID_HUE           10
#define CAPPROPID_SHARPNESS     11
#define CAPPROPID_BACKLIGHTCOMP 12
#define CAPPROPID_POWERLINEFREQ 13

Compare the errors:

[ERR ] getPropertyLimits (ID=2) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getAutoProperty (ID=2) failed on VIDIOC_G_CTRL (errno 22)
[ERR ] getPropertyLimits (ID=2) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getPropertyLimits (ID=2) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getPropertyLimits (ID=2) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getProperty (ID=2) failed on VIDIOC_G_CTRL (errno 22)
[ERR ] getAutoProperty (ID=2) failed on VIDIOC_G_CTRL (errno 22)
[ERR ] getAutoProperty (ID=5) failed on VIDIOC_G_CTRL (errno 22)
[ERR ] getAutoProperty (ID=5) failed on VIDIOC_G_CTRL (errno 22)
[ERR ] getPropertyLimits (ID=3) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getPropertyLimits (ID=3) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getPropertyLimits (ID=3) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getPropertyLimits (ID=3) failed on VIDIOC_QUERYCTRL (errno 22)
[ERR ] getProperty (ID=3) failed on VIDIOC_G_CTRL (errno 22)

Surely the ELP does not support motor-focus (2), motor-zoom (3). And gain (5) seems not to have an Auto setting? That's all OK, IMHO. It should probably not be reported as [ERR], though.

So I guess the flaky behavior is not (directly) related to these error messages.

There can be valid negative values, when the same cam is seen in Windows, especially on Exposure, where I see the actual problems. Maybe there is something not treating that well under Linux (I'll check all when I'm back on Linux):


_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/SpkC2XxB_jk/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/61618f1e-550a-43ad-b389-18b0bfb0c955n%40googlegroups.com.

mark maker

unread,
Dec 23, 2022, 4:27:20 AM12/23/22
to ope...@googlegroups.com

Same ELP camera on Linux:

vs. Windows:

I guess under Windows it does not properly determine which can be set to Auto, i.e. this is better under Linux.

Gain does nothing in Windows, so again i guess this is actually better disabled as under Linux.

However, the Exposure setting is clearly different under Linux, and behaving wrong. By sheer trial an error I can set it manually, but it is all over the place.

Some intermittent connection problems under Linux seem to be gone after I connected the camera "more directly" to the PC, i.e. not through the monitor's hub.

_Mark

vespaman

unread,
Dec 23, 2022, 5:18:26 AM12/23/22
to OpenPnP
Yes also for me, exposure is the annoying part. But maybe (in my case) this is because it is perhaps not so close to the default value, and have huge impact on the picture.
Also, for me at least, I never had any problem (or the error outputs in the command line) when starting openPnP fresh from boot. Only if I stopped openPnP and then restarted it, would I get problem.


  - Micael

Ian Arkver

unread,
Dec 23, 2022, 7:28:18 AM12/23/22
to OpenPnP
You can use v4l2-ctl (part of v4l-utils package) to directly query the camera's controls via the UVC V4L2 interface, bypassing any of the rest of the stack. You can also use v4l2-ctl to set controls and even capture video.

For example, the only ELP USB camera I have shows these controls and allows me to set manual exposure mode (see pic).

As you say returning EINVAL for unsupported controls is normal and not really an error as such.

Regards,
Ian

Screenshot_v4l2ctl.jpg

mark maker

unread,
Dec 23, 2022, 10:41:07 AM12/23/22
to ope...@googlegroups.com

Thanks Ian. My cam's output below.

It seems OpenPnP does it right, but Exposure is just broken in this Linux driver.

I've changed Issues & Solution so at least it will not take 5000 exposure probes, but a maximum of 32 probes distributed across the range. The scan is now completely chaotic, but it still finds a good setting.

Will  make a new testing version soon.

_Mark


> v4l2-ctl --list-devices
USB 2.0 Camera: HD USB Camera (usb-0000:00:14.0-1.1):
       /dev/video5
       /dev/video6
       /dev/media2

Integrated_Webcam_HD: Integrate (usb-0000:00:14.0-6):
       /dev/video0
       /dev/video1
       /dev/video2
       /dev/video3
       /dev/media0
       /dev/media1

> v4l2-ctl --device /dev/video5 --all
Driver Info:
       Driver name      : uvcvideo
       Card type        : USB 2.0 Camera: HD USB Camera
       Bus info         : usb-0000:00:14.0-1.1
       Driver version   : 5.15.64
       Capabilities     : 0x84a00001
               Video Capture
               Metadata Capture
               Streaming
               Extended Pix Format
               Device Capabilities
       Device Caps      : 0x04200001
               Video Capture
               Streaming
               Extended Pix Format
Media Driver Info:
       Driver name      : uvcvideo
       Model            : USB 2.0 Camera: HD USB Camera
       Serial           :  
       Bus info         : usb-0000:00:14.0-1.1
       Media version    : 5.15.64
       Hardware revision: 0x00000100 (256)
       Driver version   : 5.15.64
Interface Info:
       ID               : 0x03000002
       Type             : V4L Video
Entity Info:
       ID               : 0x00000001 (1)
       Name             : USB 2.0 Camera: HD USB Camera
       Function         : V4L2 I/O
       Flags            : default
       Pad 0x01000007   : 0: Sink
         Link 0x02000010: from remote pad 0x100000a of entity 'Extension 3' (Video Pixel Formatter): Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
       Width/Height      : 1920/1080
       Pixel Format      : 'MJPG' (Motion-JPEG)
       Field             : None
       Bytes per Line    : 0
       Size Image        : 4147789
       Colorspace        : sRGB
       Transfer Function : Rec. 709
       YCbCr/HSV Encoding: ITU-R 601
       Quantization      : Default (maps to Full Range)
       Flags             :  
Crop Capability Video Capture:
       Bounds      : Left 0, Top 0, Width 1920, Height 1080
       Default     : Left 0, Top 0, Width 1920, Height 1080
       Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 1920, Height 1080, Flags:  
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1920, Height 1080, Flags:  
Streaming Parameters Video Capture:
       Capabilities     : timeperframe
       Frames per second: 30.000 (30/1)
       Read buffers     : 0
                    brightness 0x00980900 (int)    : min=-64 max=64 step=1 default=0 value=0
                      contrast 0x00980901 (int)    : min=0 max=64 step=1 default=32 value=32
                    saturation 0x00980902 (int)    : min=0 max=128 step=1 default=60 value=60
                           hue 0x00980903 (int)    : min=-40 max=40 step=1 default=0 value=0
white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=0
                         gamma 0x00980910 (int)    : min=72 max=500 step=1 default=100 value=100
                          gain 0x00980913 (int)    : min=0 max=100 step=1 default=0 value=0
          power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=1 value=2 (60 Hz)
                               0: Disabled
                               1: 50 Hz
                               2: 60 Hz
     white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=1 default=4600 value=4600
                     sharpness 0x0098091b (int)    : min=0 max=6 step=1 default=2 value=0
        backlight_compensation 0x0098091c (int)    : min=0 max=2 step=1 default=1 value=2
                 exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=1 (Manual Mode)
                               1: Manual Mode
                               3: Aperture Priority Mode
             exposure_absolute 0x009a0902 (int)    : min=1 max=5000 step=1 default=157 value=781
        exposure_auto_priority 0x009a0903 (bool)   : default=0 value=0


--
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/SpkC2XxB_jk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+u...@googlegroups.com.

ma...@makr.zone

unread,
Dec 23, 2022, 12:32:30 PM12/23/22
to OpenPnP
Hi,

The improved static exposure calibration by Issues & Solutions is now in the testing version. Allow some minutes to deploy.


Not perfect but coping with the situation.

_Mark

vespaman

unread,
Dec 23, 2022, 1:28:03 PM12/23/22
to OpenPnP
Soo nice with 4mbit! Like an early Christmas present.. :-)

But I have no success in the camera handling - is there a proper way to make this work? I still have to re-enter "13" or nudge the dragbar for the setting to "take".
If I set Exposure time to "Auto" and go to the Issues & Solutions, it now only tries a few settings (brings up a dialog saying Maching still busy after timeout expired, task rejected).
It does give a final result that is somewhat ok (too bright) (And I have to enable the down led light manually before "Accepting" in I&S).

 - Micael

mark maker

unread,
Dec 23, 2022, 2:52:00 PM12/23/22
to ope...@googlegroups.com

> But I have no success in the camera handling - is there a proper way to make this work? I still have to re-enter "13" or nudge the dragbar for the setting to "take".

There is no change in the property handling per se. It is wrong in the  v4l2 driver, as we confirmed. Nothing OpenPnP can do.

> If I set Exposure time to "Auto" and go to the Issues & Solutions, it now only tries a few settings (brings up a dialog saying Maching still busy after timeout expired, task rejected).

Strange. Are you using SwitcherCameras?

> It does give a final result that is somewhat ok (too bright)

Yeah, with the driver reporting a completely wrong range, it is all I could achieve. The important thing is that the calibration does no longer hang OpenPnP. Maybe I can make it more steps, so the chances for it to hit a good value increase.

> (And I have to enable the down led light manually before "Accepting" in I&S).

Hmmm.. I guess this is related to the "Maching still busy after timeout expired, task rejected". The funny thing is that I don't see how this is possible (at least outside of a SwitcherCamera).

After you report back, I will look further.

_Mark

vespaman

unread,
Dec 23, 2022, 5:48:29 PM12/23/22
to OpenPnP
fredag 23 december 2022 kl. 20:52:00 UTC+1 skrev ma...@makr.zone:

> But I have no success in the camera handling - is there a proper way to make this work? I still have to re-enter "13" or nudge the dragbar for the setting to "take".

There is no change in the property handling per se. It is wrong in the  v4l2 driver, as we confirmed. Nothing OpenPnP can do.


Aha, I must have misunderstood.
I guess another workaround would be to do this from the start script, after OpenPnP has started. In a way this is probably what I would prefer anyway, since then I know the settings are properly stored/restored for this application.
 
Strange. Are you using SwitcherCameras?
 
No, straight USB cable from each of the cameras.

> It does give a final result that is somewhat ok (too bright)

Yeah, with the driver reporting a completely wrong range, it is all I could achieve. The important thing is that the calibration does no longer hang OpenPnP. Maybe I can make it more steps, so the chances for it to hit a good value increase.

> (And I have to enable the down led light manually before "Accepting" in I&S).

Hmmm.. I guess this is related to the "Maching still busy after timeout expired, task rejected". The funny thing is that I don't see how this is possible (at least outside of a SwitcherCamera).

After you report back, I will look further.

Well disclaimer: I just have got everything setup on my new computer, so maybe I missed some setting here or there, that triggers this. And when I think about it, the camera settings dialog where sluggish from time to time, so maybe this is something related to the camera driver as well.
TBH, this is not really a problem for me (I only tested Auto Exposure + I&S to try to understand/find a solution to my main problem) , but I am happy to help test further if you like!

Regards,
  Micael

vespaman

unread,
Dec 24, 2022, 6:09:13 AM12/24/22
to OpenPnP
Hi Mark,

So here's a short log snippet of the "Machine is still busy.."
Today, the down light comes on/goes off as it should though. If I clear the dialog during the process, a new one will arrive.
Log cleared just before pressing "Accept" in I&S;

2022-12-24 11:48:40.867 ReferenceActuator DEBUG: DOWNLED.actuate(50.0)
2022-12-24 11:48:40.867 GcodeAsyncDriver DEBUG: serial://ttyUSB0 commandQueue.offer(M822 S50.0 ; DOWNLED M822 on / M823 off, 10000)...
2022-12-24 11:48:40.867 GcodeAsyncDriver$WriterThread TRACE: [serial://ttyUSB0] >> M822S50
2022-12-24 11:48:40.868 GcodeDriver$ReaderThread TRACE: [serial://ttyUSB0] << ok
2022-12-24 11:48:40.917 Scripting TRACE: Scripting.on Camera.BeforeSettle
2022-12-24 11:48:40.918 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:40.932 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:40.936 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:40.958 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:40.965 AbstractSettlingCamera TRACE: autoSettleAndCapture t=48 auto settle score: 26.148 compute time: 7
2022-12-24 11:48:40.965 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:40.983 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:40.990 AbstractSettlingCamera TRACE: autoSettleAndCapture t=73 auto settle score: 0.000 compute time: 7
2022-12-24 11:48:40.990 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:41.010 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:41.019 AbstractSettlingCamera TRACE: autoSettleAndCapture t=102 auto settle score: 0.204 compute time: 8
2022-12-24 11:48:41.019 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:41.049 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:41.069 AbstractSettlingCamera TRACE: autoSettleAndCapture t=152 auto settle score: 25.563 compute time: 20
2022-12-24 11:48:41.069 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:41.090 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:41.096 AbstractSettlingCamera TRACE: autoSettleAndCapture t=179 auto settle score: 0.221 compute time: 6
2022-12-24 11:48:41.096 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:41.111 MessageBoxes DEBUG: Error: java.util.concurrent.TimeoutException: Machine still busy after timeout expired, task rejected.
2022-12-24 11:48:41.115 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:41.122 AbstractSettlingCamera TRACE: autoSettleAndCapture t=205 auto settle score: 0.233 compute time: 7
2022-12-24 11:48:41.122 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:41.144 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:41.150 AbstractSettlingCamera TRACE: autoSettleAndCapture t=233 auto settle score: 0.760 compute time: 6
2022-12-24 11:48:41.151 AbstractSettlingCamera DEBUG: autoSettleAndCapture in 234 ms
2022-12-24 11:48:41.151 Scripting TRACE: Scripting.on Camera.AfterSettle
2022-12-24 11:48:41.151 ReferenceActuator DEBUG: DOWNLED.actuate(0.0)
2022-12-24 11:48:41.151 GcodeAsyncDriver DEBUG: serial://ttyUSB0 commandQueue.offer(M822 S0.0 ; DOWNLED M822 on / M823 off, 10000)...
2022-12-24 11:48:41.152 GcodeAsyncDriver$WriterThread TRACE: [serial://ttyUSB0] >> M822S0
2022-12-24 11:48:41.152 GcodeDriver$ReaderThread TRACE: [serial://ttyUSB0] << ok
2022-12-24 11:48:42.740 ReferenceActuator DEBUG: DOWNLED.actuate(50.0)
2022-12-24 11:48:42.741 GcodeAsyncDriver DEBUG: serial://ttyUSB0 commandQueue.offer(M822 S50.0 ; DOWNLED M822 on / M823 off, 10000)...
2022-12-24 11:48:42.741 GcodeAsyncDriver$WriterThread TRACE: [serial://ttyUSB0] >> M822S50
2022-12-24 11:48:42.742 GcodeDriver$ReaderThread TRACE: [serial://ttyUSB0] << ok
2022-12-24 11:48:42.791 Scripting TRACE: Scripting.on Camera.BeforeSettle
2022-12-24 11:48:42.791 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:42.821 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:42.825 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:42.853 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:42.868 AbstractSettlingCamera TRACE: autoSettleAndCapture t=76 auto settle score: 0.171 compute time: 14
2022-12-24 11:48:42.868 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:42.887 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:42.894 AbstractSettlingCamera TRACE: autoSettleAndCapture t=102 auto settle score: 0.170 compute time: 6
2022-12-24 11:48:42.894 Scripting TRACE: Scripting.on Camera.BeforeCapture
2022-12-24 11:48:42.918 Scripting TRACE: Scripting.on Camera.AfterCapture
2022-12-24 11:48:42.925 AbstractSettlingCamera TRACE: autoSettleAndCapture t=134 auto settle score: 0.170 compute time: 6
2022-12-24 11:48:42.926 AbstractSettlingCamera DEBUG: autoSettleAndCapture in 135 ms
2022-12-24 11:48:42.926 Scripting TRACE: Scripting.on Camera.AfterSettle
2022-12-24 11:48:42.926 ReferenceActuator DEBUG: DOWNLED.actuate(0.0)
2022-12-24 11:48:42.926 GcodeAsyncDriver DEBUG: serial://ttyUSB0 commandQueue.offer(M822 S0.0 ; DOWNLED M822 on / M823 off, 10000)...
2022-12-24 11:48:42.926 GcodeAsyncDriver$WriterThread TRACE: [serial://ttyUSB0] >> M822S0
2022-12-24 11:48:42.927 GcodeDriver$ReaderThread TRACE: [serial://ttyUSB0] << ok
2022-12-24 11:48:43.804 ReferenceActuator DEBUG: DOWNLED.actuate(50.0)


 - Micael

vespaman

unread,
Dec 24, 2022, 9:57:33 AM12/24/22
to OpenPnP
I guess another workaround would be to do this from the start script, after OpenPnP has started. In a way this is probably what I would prefer anyway, since then I know the settings are properly stored/restored for this application.

So the quickest fix that seems to work; add the following line to OpenPnP start script.
(sleep 5 && v4l2-ctl -d /dev/video2 -c exposure_absolute=13)&

At least it works for a normal run, afaict. But not if pressing the "test" button on the camera/device tab. But that is a minor issue.

I will probably add all settings to all cameras like this in a separate script, so I don't have to think about the camera settings when changing computer next time. (And also I don't have to worry if I accidentally changes the settings of the wrong camera (has happened millions of times.. ))

 - Micael

mark maker

unread,
Dec 29, 2022, 3:54:02 PM12/29/22
to ope...@googlegroups.com

Hi all,

I added a new option Freeze Properties to the OpenPnpCaptureCamera.

Best read the Instruction for Use:

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

This PR also fixes the "Machine still busy after timeout expired, task rejected" error.

Allow for a few minutes to deploy a new test version.

_Mark

--
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/728bb8bd-f796-4c6b-9ef7-46abbe64ae93n%40googlegroups.com.

vespaman

unread,
Dec 30, 2022, 3:57:13 AM12/30/22
to OpenPnP
Hi Mark,

So great! I don't know how many times I have had to redo these settings because of my own clumsiness in all sorts of ways (e.g. wrong USB port, selecting the up camera, when I intended to change the down camera etc etc).
Much appreciated! Will go test now..

 - Micael

vespaman

unread,
Dec 30, 2022, 4:44:16 AM12/30/22
to OpenPnP
OK, so my test results are as follows;

When I go to the camera setup, and change the exposure time, it changes to the value I want also in camera. But then, if I enable "Freeze", the apply button appears, great! But when I then hit apply, the picture goes back to the bad value again. If I then hit "reapply to camera", there no change in the camera view. This is a bit confusing.
And if I restart the program, the exposure is still wrong, until I go into the camera device dialog again, and press "Reapply to camera", then I got the settings I want loaded down to camera. So the second time/after restart, the Reapply works. But the startup loading of the saved settings seems not to work.


 - Micael

mark maker

unread,
Dec 30, 2022, 7:18:55 AM12/30/22
to ope...@googlegroups.com

> And if I restart the program, the exposure is still wrong, until I go into the camera device dialog again, and press "Reapply to camera", then I got the settings I want loaded down to camera. So the second time/after restart, the Reapply works. But the startup loading of the saved settings seems not to work.

Darn, I wasn't able to reproduce on my Linux, so I already feared it will not solve the problem on your side (that's why I made the "Reapply to camera" button).

I wonder if the magic is in that sleep 5 that you had in your script. Let the camera run for a while and set the property after that. Or set it periodically, until it reads back as set. Pity I cannot reproduce.

I'm sure I asked before, but what camera make/model is that?

_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/SpkC2XxB_jk/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/6f2bc6ee-ae50-4c12-b103-d7a4d6752693n%40googlegroups.com.

vespaman

unread,
Dec 30, 2022, 9:03:48 AM12/30/22
to OpenPnP
Supposedly, it might be ELP, but I cannot swear by it, since I got it with my chmt48. The guy that I bought everything from had intended to convert to openpnp but never got around doing it. He had followed this group, so I think he got what was suggested. If I remember correctly the box it came in was blue and rather anonymous.
 
It comes up as this in kernel log;
[    1.740330] usb 1-1: New USB device found, idVendor=1bcf, idProduct=2283, bcdDevice= 5.07
[    1.740335] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.740336] usb 1-1: Product: FHD Camera
[    1.740337] usb 1-1: Manufacturer: SunplusIT Co

Thats all I know. I wouldn't mind changing it, but I don't have the stamina right now, to do it, since it means so much work.

 - Micael

mark maker

unread,
Dec 30, 2022, 9:31:02 AM12/30/22
to ope...@googlegroups.com

My FullHD 1080p ELP shows as:

[ 8941.875683] usb 1-1.1: new high-speed USB device number 23 using xhci_hcd
[ 8942.096755] usb 1-1.1: New USB device found, idVendor=05a3, idProduct=9230, bcdDevice= 1.00
[ 8942.096771] usb 1-1.1: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[ 8942.096776] usb 1-1.1: Product: USB 2.0 Camera
[ 8942.096780] usb 1-1.1: Manufacturer: HD Camera Manufacturer
[ 8942.104241] usb 1-1.1: Found UVC 1.00 device USB 2.0 Camera (05a3:9230)
[ 8942.158449] input: USB 2.0 Camera: HD USB Camera as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input46

The recommended HD 720p model will likely differ a bit, but I fear not as much as yours.

Could you do some tests as to whether reapplying the properties after a certain time does the trick?

And is it stable after that?

I would then add it in the homing handler, i.e. whenever the machine is homed, the camera properties are reapplied. This kind of "re-initialize everything to a know good state" makes sense under "homing" in my book. Agree?

If this works, no need to change the camera if it is otherwise good quality.

  • Supports good quality MJPEG or better (no discernible compression artifacts)
  • 720p or 1080p or similar (and not much more)
  • FPS 30 or better.
  • Color preferred
  • Manual exposure setting that really works
  • Manual white balance that really works
  • Can disable image sharpening

_Mark

mark maker

unread,
Dec 30, 2022, 9:56:41 AM12/30/22
to ope...@googlegroups.com

Hi Micael,

the reapplication is now done in the homing handler. I believe this should solve this issue in all practical operational scenarios.

During non-operational scenarios (still setting the machine up), you should be able to get by using the Reapply button in the camera.

Obviously the real bug is somewhere else, with the camera and/or driver and/or kernel.

See:

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

Allow some minutes for the new test version to deploy.

_Mark

vespaman

unread,
Dec 30, 2022, 9:57:11 AM12/30/22
to OpenPnP

Well, my camera (1080p30 colour) is working OK, but the lens I am not happy with. If I would restart, I'd try to move it a bit further away from the board, to minimize the optical edge distortion.
The thing I see is that I get a notice in I&S regarding gain, that it should be set to 0, but gain is greyed out, so it cannot be changed in UI.
 
If I press 'Reapply to camera' after startup, it works for the session, but if I press 'test' it goes back to the wrong level. (I then have to press reapply again).

  - Micael

mark maker

unread,
Dec 30, 2022, 10:13:05 AM12/30/22
to ope...@googlegroups.com

The test button closes and the reopens the camera, which explains what you see. Assuming you don't use this button routinely I think you can live with that.

_Mark

vespaman

unread,
Dec 30, 2022, 10:21:57 AM12/30/22
to OpenPnP
Yes,  the test button is not a problem, I just mentioned it in order to give a complete picture of how it is behaving.

 -  Micael

Dave McGuire

unread,
Jan 23, 2023, 11:37:45 AM1/23/23
to ope...@googlegroups.com, mark maker
On December 23, 2022 3:47:30 AM mark maker <ma...@makr.zone> wrote:
> /> This probably doesn't count as "help", but I'm running ELP cameras
> under Linux without difficulty. I've not really dug into their
> settings, beyond just setting them such that it works well, but they're
> very stable. /
>
> @Dave McGuire, please send a screenshot of your Device Settings, thanks!

Mark, my apologies, I missed this request. Do you still need that screenshot?

-Dave

--
Dave McGuire
McGuire Scientific Services, LLC
New Kensington, PA


ma...@makr.zone

unread,
Jan 23, 2023, 11:57:30 AM1/23/23
to OpenPnP
No hurry but would be interesting as a comparison.
_Mark
Reply all
Reply to author
Forward
0 new messages