drcrook
Posts: 11
Joined: Tue May 19, 2015 8:33 pm

Access Camera from Docker Container

Fri Jan 12, 2018 7:40 pm

Hey Folks,

I'm working up an open source sample for Microsoft's new IoT Edge platform w/ Raspberry Pi to do computer vision etc on the actual raspberry pi without any cloud comms (aside from firmware updates and dev ops process).

Anyways, It appears I'm having issues getting access to the raspberry pi's raspbistill capabilities. I've even logged into the container on the pi and tried to just use the cmd line raspistill to no effect.

The code is written in nodejs using the node-raspistill and pixel-getter npm packages. I launch the container with --privileged (I'll scope it back later).

Below is the dockerfile:

Code: Select all

FROM resin/rpi-raspbian:jessie

RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install -y wget
RUN usermod -a -G video root

WORKDIR /usr/src/app

RUN wget http://node-arm.herokuapp.com/node_latest_armhf.deb 
RUN sudo dpkg -i node_latest_armhf.deb

COPY package*.json ./
RUN npm install

COPY . .

CMD ["node", "app.js"]
running the container with the following cmd: "docker run --privileged -it picamera /bin/bash" and then attempting to execute the commands:
"/opt/vc/bin/raspistill -vf -hf -o cam1.jpg" or "raspistill -vf -hf -o cam1.jpg" gets me: "No such file or directory".

I'm pretty sure if I can find raspistill and get it added to the path the nodejs wrapper library will start working. Any tips or hints are greatly appreciated. I've been digging through random dockerfiles on github to no avail thus far.

Thanks!

drcrook
Posts: 11
Joined: Tue May 19, 2015 8:33 pm

Re: Access Camera from Docker Container

Fri Jan 12, 2018 8:58 pm

Of course one finds the answer shortly after posting the question; apologies. For documentation purposes and the benefit of others, the problem is that I did not install some raspberry pi core dependencies in my docker file. The new working docker file is blow:


Code: Select all

FROM resin/rpi-raspbian:jessie

RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install -y wget
RUN apt-get install libraspberrypi-bin -y
RUN usermod -a -G video root

WORKDIR /usr/src/app

RUN wget http://node-arm.herokuapp.com/node_latest_armhf.deb 
RUN sudo dpkg -i node_latest_armhf.deb

COPY package*.json ./
RUN npm install

COPY . .

CMD ["node", "app.js"]

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 22 guests