• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USB camera issues

I have a docker container with a Python application that connects to a USB (infrared) camera. 

The docker container runs fine on the Raspberry Pi 3 B, but not on the netPI. 

On the netPI, additionally to running in privileged mode, I have added following devices: 
/dev/gpiomem (for digital IO), 
/dev/bus (for usb; I also tried with just /dev/bus/usb), 
/dev/video0, and

The camera library complains about data corruption and "select error". Since, the problem does not appear on the Raspberry Pi and happens inside code I do not own, I see no way how to debug this.

Any idea what other docker container configuration could be missing? Or any ideas on how to investigate this?

Some extra details, just in case:
- The RaspberryPi is connected to the intranet via Wifi, the netPi via Ethernet.
- Infrared Camera: Optris Xi400, https://www.optris.global/optris-xi-400
- Camera SDK for Linux: http://documentation.evocortex.com/libir...index.htmlhttps://evocortex.org/downloads/
- The container is based on the image https://hub.docker.com/r/balenalib/raspberry-pi (balenalib/raspberry-pi-debian-python:3.7.4).
- The Python app also reads and write some GPIOs.
- There's a second container running Redis.

Well David,

as you know Docker on netPI is more restricted than on standard RPi3 in terms of not allowing auto-"/dev"-mapping in privileged mode and not allowing volume bind mappings. So it could be that something more is needed.

The only method I can recommend is to use the tracing tool "strace". You can install it using "apt-get install strace". After installing it you can call "strace -f <your application>" and it prints on screen what Linux systems calls are made by this application and you also see at which point of the calls it fails.

Usually you see then what it is complaining about.

But let me ask you this. On your standard Raspberry Pi ... are you using Raspbian Full with a HDMI Desktop with mouse and keyboard or are you using a Raspbian Lite?

You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

I installed Raspbian Lite initially, but I did install the necessary desktop tools afterwards via apt-get install. I usually work through SSH and VS Code on the Rasberry Pi, but can as well connect keyboard, mouse and screen if necessary.

I will try your suggestion.

Kind regards,
But David let me ask you this question: how is your camera working without any HDMI display on your netPI? It cannot display anything. So expect the camera driver to hook itself into any display server to provide a camera output on screen. But how do you do a Desktop on netPI?
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

Hmmm, I am not sure I understand your point.

I don't want or need to see the images. The application receives them via callbacks from the camera's SDK, computes some statistics (max temp in a given area), takes some decisions based on that (set output low if threshold is crossed), and makes that data available to the outside world.

I am not sure why I would need an HDMI display for this kind of application?

Kind regards,
Oh now I understand your point.

This camera is not delivering "pictures" or "frames" like a classic camera would do ... instead it has a kind of software API that you can use to pull information of any kind from the camera.

Then forget my previous remark.

You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

Yes, you're right, I should have made that clear from the start.

For your information:

I tried strace -f as you suggested, but unfortunately, it did not reveal any missing device mapping (/dev/xyz).
I did see calls to mmap, so I enabled the corresponding capability in portainer. In fact, I enabled them all, just to be sure.

Still, no luck. Data does not come through even though the camera receives commands: I hear the camera changing focus during the initialization.

I like the concept of the netPI, but it does not seems a good match for our application.

Thank you for the support,
Well David,

the security concept is indeed sometimes a little bit difficult to handle. Today I have to admit that in no case I haven't seen an application yet that is not working under that concept. Yours would be the first one ineed. But there is of course one remaining thing. It's the kernel 4.9 we are using while you maybe use kernel 4.19 on your raspberry pi. I am thinking more in this direction rather than to have doubts about the secured Docker.

In the end the only olution I see right now is to order a netPI without SD card (little bit cheaper) or a netPI in Revision #2 from ur which has an SD card but that isn't glued any more with the SD card socket. With both devices you are able to run your own SD card used with your standard Raspberry Pi before. It will work right away.

How about that proposal?

You never fail until you stop trying.“, Albert Einstein (1879 - 1955)


Possibly Related Threads...
Thread Author Replies Views Last Post
  [SOLVED] Docker issues AlexRegev 7 192 June-26th-2019, 02:14 PM
Last Post: AlexRegev
  Issues Updating the netPI PRingelberg 5 158 August-14th-2018, 11:14 AM
Last Post: Armin@netPI

Forum Jump:

Users browsing this thread: 1 Guest(s)