Using Raspberry Cam instead of USB

Hi There,
i’ve connected my Wide-Angle-RaspberryCam to the CORE2-ROS.
I want to use the Raspberry-Cam instead of an USB-Cam with the Cloud.

I already got the RaspiCam up to /dev/video0 but the Cam is not connected in WebUI.

Is there a solution to use the RaspiCam with WebUI and Cloud ?

Hi Souko,

If you can see your Raspberry-Cam as:

/dev/video0

device, everything should work like in example on our website:

https://husarion.com/core2/tutorials/howtostart/video-streaming-from-a-camera/

In point 2.1, in section “CORE2-ROS + USB camera”, everything is explained and it doesn’t matter which camera you are using if it’s listed in /dev/ catalog as:

/dev/video*

Remember to reboot your device before start using video stream.

Regard,
Hubert.

Hi,
hm…
I tried to open the Cam with MPlayer, and it works fine.

But with “UI example” from cloud - no Cam-Stream. Also tried to reboot and disable and re-enable the Cam in Cloud-settings.

Any further Ideas ?

Hi,

It’s possible that you accidentally removed husarion-camera package. Check it by typing:

sudo apt-get install husarion-camera

I’m waiting for the results.

Regard,
Hubert.

Hm… apt says:

husarion-camera is already the newest version (2017.07.27.1).

if I try to execute husarion-camera manually, I get this:

husarion@core2-ros:~$ husarion-camera     
Traceback (most recent call last):
File "/usr/bin/husarion-camera", line 26, in <module>
reset_camera()
File "/usr/bin/husarion-camera", line 6, in reset_camera
function_id = os.readlink('/sys/class/video4linux/video0/device').split('/')[-1]
FileNotFoundError: [Errno 2] No such file or directory: '/sys/class/video4linux/video0/device'
Traceback (most recent call last):
File "/usr/bin/husarion-camera", line 38, in <module>
url = sys.argv[1] if len(sys.argv) > 1 else open('/run/husarion-usb-camera-url').read()
FileNotFoundError: [Errno 2] No such file or directory: '/run/husarion-usb-camera-url'

And this is the “ls” from the missing File/Dir:

husarion@core2-ros:/$ ls /sys/class/video4linux/video0/      
dev  dev_debug  index  name  power  subsystem  uevent

If I connect my Logitech USB-Cam or my Microsoft LifeCam - both are working.
their “ls” looks like this:

husarion@core2-ros:/$ ls /sys/class/video4linux/video1/
dev  dev_debug  device  index  name  power  subsystem  uevent

So for any reason for the Raspberry Cam-Interface the “Device” Node is missing !?

Hi.

Thank you much for very comprehensive report and I’m sorry for inconvenience. We will find a solution and share it with you as soon as possible.

Regard,
Hubert.

@Souko
You need to load Raspberry Pi camera driver in order to be able to use it as Husarion Camera:

sudo modprobe bcm2835-v4l2

If you want this setting to persist between restarts, execute:

sudo sh -c 'modprobe bcm2835-v4l2 >> /etc/rc.local'

Hi,
I already loaded the module “bcm2835-v4l2” - Otherwise the RaspiCam wouldn’t show up as /dev/video0 and it also wouldn’t work with MPlayer.

Also, it’s recommended to use /etc/modules instead of rc.local to load modules at boot-time:

echo bcm2835-v4l2 >> /etc/modules

Hi there,
any Updates on this ?

Hi Souko.

We working on this, but we have to wait for Wide-Angle-Raspberry Cam just like yours. Please give us some more time to check this issue. We will find a solution very soon.

Regard,
Hubert.

Ok - no Problem.

If I can do something to help, let me know !

Thank you for the good cooperation!! :smile:

Hi there,
2 weeks… any Updates ?

Hi Souko.

We have investigated the issue and the reason for Raspberry-Cam not to work is that it is currently not supported by Chrome. As our platform is chrome based, for the time being it is not possible to use this device with husarion-camera. We are however working on developing a solution, but it will take some time.

Regard,
Hubert.

Hi there,
got it to work !!
just use the following command after Startup:

sudo modprobe bcm2835-v4l2 gst_v4l2src_is_broken=1

OR just add the following to /etc/modules:

bcm2835-v4l2

AND the other line to /etc/modporbe.d/bcm2835-v4l2.conf (you have to create this File - The Name can be different, only the .conf is important)

options bcm2835-v4l2 gst_v4l2src_is_broken=1

After Reboot - The Cam is working !

2 Likes

Hi Souko,

I have a couple of questions for you.
Which SBC do you use? RPI3 or the Tinkerboard?
Is your Camera still working fine? with the cloud?
I have a core2ros+Tinkerboard.
Will you share with me what steps you have made to get it working.
Thanks the help.
Regards,
Fred

Hi,
I used an RaspberryPi 3
no Idea if thath works with the same steps as I described in my last Post above yours.

Haven’t used my Robot in the last months because of other Projects, so I can’t say if it still works with the last Updates.

Hi,
Thanks for your swift response.
Yes, I am not sure whether your solution will be working with the Tinkerboard.
I already have problem using the USB Camera.
I have to find out myself,
Regards,
Fred