Emlid

Community Forum

USB Camera Guide


(Tevin Macias) #1

Hi everyone I’m wanting to use a USB camera with the RPI 3b+ and NAVIO 2. I m using Mission Planner.

Does anyone have any walkthrough or help for how to do this?


(Vikeyer) #3

Hello!
What exactly do you mean by ‘use a USB camera’?
Here I can see the guide. But here USB camera doesn’t integrate in any way to Mission Planner, it is just streaming to target laptop, so the one can see the video stream. However, you can utilize GStreamer to do whatever you want with the stream.


(Tevin Macias) #4

I mean using a USB camera plugged into the Raspberry PI 3b+.


(Vikeyer) #5

Yes, I understand that, but what is your project? What do you want to do with video?


(Tevin Macias) #6

The end goal is to use object detection and stream the video to a cloud for review later.


(Vikeyer) #7

Ok, then I definitely suggest you use GStreamer because it allows you to retrieve video stream into an application either on C++ or Python (maybe even some other languages). Check out this topic, I’ve left there some links that might be useful to you.


(Tevin Macias) #8

Thank you so much. I’ll report back on our results.


(Emily Garvie) #10

So I have followed the instructions on the page that has been linked here but I am receiving the error “Failed to start raspicam.service: Unit raspicam.service is masked” and I cannot figure out how to unmask it.
I tried to use “file /lib/systemd/system/raspicam.service” but it says there is no such file or directory. Any help would be much appreciated.


(Vikeyer) #12

Hi!
Well, that’s strange, I’ve never faced such a problem… First of all: did you enabled raspberry camera through raspi-config?
Something like sudo raspi-config > interfaces > camera > enable and then reboot the device.
If you are using not Raspbian OS, most likely you will have to install raspi-config first.


(Emily Garvie) #13

Okay I was able to get past this. I just had to rewrite the script because apparently the file was empty, which was making it show up as masked. Now when I attempt to run “sudo systemctl start raspicam” I get an error of invalid argument. I ran “sudo systemd-analyze verify raspicam.service” and received this reply

boot.mount: Unit is bound to inactive unit dev-disk-by\x2dpartuuid-7329c1dd\x2d01.device. Stopping, too.

[/etc/systemd/system/raspicam.service:6] Unbalanced quoting, ignoring: "/bin/sh -c “/usr/bin/raspivid -n -w 1280 -h 720 -b 1000000 -fps 15 -t 0 -o - |$”

raspicam.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.

raspicam.service: Failed to create raspicam.service/start: Unit raspicam.service is not loaded properly: Invalid argument.

I’m not exactly sure where to go from here. Perhaps creating a ExecStart/Stop setting?


(Vikeyer) #14

Can you, please provide a full description of what you doing? I see some familiar things, that I might help you with, but I’m not sure that I understand correctly what is going on. Thank you!