Arduino Forum

Products => Arduino Yún => Topic started by: khchan on Apr 08, 2014, 09:35 am

Title: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: khchan on Apr 08, 2014, 09:35 am
Hi all,

I'm facing a problem when i control the creative VF0470 webcam with Arduino Yun.

Even i have install : kmod-video-uvc.

It show error when i typing command in SSH as per below:


root@ArduinoYun:~# fswebcam test.png
--- Opening /dev/video0...
stat: No such file or directory

Kindly Please help!
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: noblepepper on Apr 08, 2014, 01:45 pm
That is a gspca camera, drivers for uvcvideo cameras aren't likely to support it.
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: khchan on Apr 09, 2014, 08:50 am
Thanks for the response!

Even i have installed those packages like:
- kmod-video-gspca-core
- kmod-video-core

But it seems doesn't work. Is there any possible way for Yun to support this webcam?

Please advise.
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: noblepepper on Apr 09, 2014, 01:17 pm
You will need to troubleshoot yourself, searching for gspca in this forum gives several hits. dmesg and lsusb will give info on the yun.
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: khchan on Apr 11, 2014, 12:19 pm
Hi,

I have try to install the package like: kmod-video-gspca-ov519_3.3.8-1_ar71xx.ipk.

But it not accepted by Yun.

Is it mean that Arduino Yun not supported GSPCA webcam?

Kindly advise.
Thanks.
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: noblepepper on Apr 11, 2014, 07:11 pm
It is hard to say what is wrong if you don't post the actual command you ran and the errors you received.

Did you run opkg update?

Where did the package come from?

What command did you use to try to install?

What does the kernel version match the kernel the module was compiled for? (uname -a will tell you your kernel version)

If your kernel is 3.8.3, does the package at http://chef.mesh.altermundi.net/downloads/stable/ar71xx/packages/ (http://chef.mesh.altermundi.net/downloads/stable/ar71xx/packages/) work?
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: khchan on Apr 14, 2014, 06:15 am
Hi,

Thanks for reply.

Yes, i have performed the opkg update at SSH, and my Yun kernel version is:
Linux ArduinoYun 3.8.3 #8 Mon Aug 19 16:22:39 CEST 2013 mips GNU/Linux.

I have downloaded the file [kmod-video-gspca-ov519_3.8.3-1_ar71xx.ipk] from the link that you have provided to me.
But it doesn't work, and the error as below:

root@ArduinoYun:/mnt/sda1/yun_camera# opkg install kmod-video-gspca-ov519_3.8.3-
1_ar71xx.ipk
Installing kmod-video-gspca-ov519 (3.8.3-1) to root...
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-video-gspca-ov519:
*      kernel (= 3.8.3-1-50d7afd574f6028b1f74bfed6c49de30) *
* opkg_install_cmd: Cannot install package kmod-video-gspca-ov519.

Kindly advise.
Thanks.



Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: noblepepper on Apr 14, 2014, 02:42 pm
You could use
Code: [Select]
opkg --force-depends install kmod-video-gspca-ov519_3.8.3-
1_ar71xx.ipk
to install that package.

I compiled a module that **should** install without forcing the dependencies, you can get it here.
https://www.dropbox.com/s/zmnege8cottr5t5/kmod-video-gspca-ov519_3.8.3-1_ar71xx.ipk (https://www.dropbox.com/s/zmnege8cottr5t5/kmod-video-gspca-ov519_3.8.3-1_ar71xx.ipk)

To compile your own packages use this procedure:
http://playground.arduino.cc/Hardware/Yun#build_linino (http://playground.arduino.cc/Hardware/Yun#build_linino)
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: khchan on Apr 15, 2014, 03:52 pm
Hi,

My webcam is working now  ;) , after i have try your code :
Quote
Code:
opkg --force-depends install kmod-video-gspca-ov519_3.8.3-
1_ar71xx.ipk


Thanks !!
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: kaul on May 10, 2014, 09:14 pm
Im glad your cam works now!

When I use your file and the command to install it it gives me this error:

Code: [Select]
root@Arduino:/mnt/sda1# opkg --force-depends install kmod-video-gspca-ov519_3.8.
3-1_ar71xx.ipk
Installing kmod-video-gspca-ov519 (3.8.3-1) to root...
Configuring kmod-video-gspca-ov519.
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-video-gspca-ov519:
*      kernel (= 3.8.3-1-cf85e4dc55fb28677fb803cf0f9ad60a) *   kmod-video-gspca-core *


opkg install kmod-video-gspca-core gives me:

Code: [Select]
root@Arduino:/mnt/sda1# opkg install kmod-video-gspca-core
Unknown package 'kmod-video-gspca-core'.
Collected errors:
* opkg_install_cmd: Cannot install package kmod-video-gspca-core.


Any idea what I must do? Do I need to compile my own version? I am also using the YUN with its newest firmware.
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: noblepepper on May 11, 2014, 12:24 am
Yes, you need to install kmod-video-gspca-core, have you run opkg update?  Do you see kmod-video-gspca-core when you run opkg list?
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: kaul on May 11, 2014, 02:04 am
@noblepepper: okay, that update worked, thanks a lot. one step further. now I installed the core.

Code: [Select]
root@Arduino:/mnt/sda1# opkg --force-depends install kmod-video-gspca-ov519_3.8.3-1_ar71xx.ipk
Multiple packages (kmod-video-gspca-ov519 and kmod-video-gspca-ov519) providing same name marked HOLD or PREFER. Using latest.
Installing kmod-video-gspca-ov519 (3.8.3-1) to root...
Configuring kmod-video-gspca-ov519.
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-video-gspca-ov519:
*      kernel (= 3.8.3-1-cf85e4dc55fb28677fb803cf0f9ad60a) *


This is the last error I receive. I think I have another kernel since I upgraded to the newest firmware? Do I need to compile my own one? And how to do it if I need to?
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: noblepepper on May 11, 2014, 02:36 am
I believe this thread was about the Yun image and packages that were in use before the one that was just released. If you have upgraded to the new image then run
Code: [Select]
opkg remove kmod-video-gspca-ov519
opkg remove kmod-video-gspca-core
opkg update
opkg install kmod-video-gspca-ov519

and if you have /dev/video0 then ignore the rest of this thread, you should have the modules installed for a Creative Live! VISTA VF0470.


When you use --force-depends I believe it will still show you the error even though it installed it.

Do you see kmod-video-gspca-ov519 when you run opkg list-installed?

Is there a file named /dev/video0?

Did you install the gspc-ov519 module from chef.mesh.altermundi.net (http://chef.mesh.altermundi.net), https://www.dropbox.com/s/zmnege8cottr5t5/ (https://www.dropbox.com/s/zmnege8cottr5t5/), or the official repository  http://downloads.arduino.cc/openwrtyun/1/packages (http://downloads.arduino.cc/openwrtyun/1/packages)?
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: federicofissore on May 12, 2014, 11:43 am
From the "New Yun Image" topic

- Added lots of webcam modules

Indeed packages

are available.
Please upgrade your Yun (http://forum.arduino.cc/index.php?topic=235360.0) then install packages from the official arduino repo (that is: opkg update && opkg install kmod-video-gspca-ov519)
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: kaul on May 12, 2014, 02:45 pm
@noblepepper: Thank you so much. My Webcam works now! Awesome job, thanks for your help.

I have one question regarding fswebcam, maybe someone has an answer to it:

fswebcam has a feature built in where you can write the actual date on the shots the cam makes. However I receive this error:

Code: [Select]
--- Processing captured image...
Unable to load font 'sans': libgd was not built with FreeType font support


I also tried to define the path to the font, then however I receive only the error that freetype font support is not given. I understand, that this is an issue of libgd, but maybe someone knows a workaround?

Thanks for your help.
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: kaul on May 13, 2014, 12:23 am
Any idea someone?
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: sonnyyu on May 13, 2014, 02:13 am

@noblepepper: Thank you so much. My Webcam works now! Awesome job, thanks for your help.

I have one question regarding fswebcam, maybe someone has an answer to it:

fswebcam has a feature built in where you can write the actual date on the shots the cam makes. However I receive this error:

Code: [Select]
--- Processing captured image...
Unable to load font 'sans': libgd was not built with FreeType font support


I also tried to define the path to the font, then however I receive only the error that freetype font support is not given. I understand, that this is an issue of libgd, but maybe someone knows a workaround?

Thanks for your help.


recompile libgd with freetype support.

nano ~/OpenWrt-yun/package/feeds/packages/gd/Makefile

Code: [Select]
CONFIGURE_ARGS += \
        --enable-shared \
        --enable-static \
        --disable-rpath \
        --without-x \
        --without-fontconfig \
        --without-freetype \
        --with-jpeg=$(STAGING_DIR)/usr \
        --with-png=$(STAGING_DIR)/usr \
        --without-xpm \
        --without-iconv


remove " --without-freetype \" then recompile libgd. then remove installed libgd force install new revision one.  I have not chance to test it but you should go ahead try it yourself.
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: federicofissore on May 13, 2014, 09:10 am
After you've tested it working, please create a pull request on the packages repo https://github.com/arduino/openwrt-packages-yun
(gd is here (https://github.com/arduino/openwrt-packages-yun/tree/master/libs/gd))
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: kaul on May 13, 2014, 01:13 pm
Thank you, Federico Fissore

Unfortunately I have little linux knowledge. I did the nano, but it seems this file does not exist. I am afraid of doing something wrong while compiling unless I find a step by step guide somewhere. If you can provide one that would be awesome, but I understand that u have limited time.

Thank you anyway and have a great day!
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: federicofissore on May 13, 2014, 01:50 pm
It's already available (https://github.com/arduino/openwrt-yun#openwrt-y%C3%BAn) but it needs some hours to set up, a variable number of hours to build (my 4 cores i7 takes 6 hours) and about 30Giga of free disk space

If you feel it's too difficult, than probably it is. Still, you may want to give it a try, as it may be easier than you think :)

An alternative path is to build just the SDK (or to obtain one from the openwrt website) and adapt instructions like those from fibasile about nodejs (http://fibasile.github.io/compiling-nodejs-for-arduino-yun.html), so that you can build a custom version of package gd

Last alternative is to look for a totally different solution: one could be using fswebcam for taking pictures and use another program for changing them adding time and date
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: kaul on May 13, 2014, 07:25 pm
Well, I just want to recompile libgd with freetype support. Do I need to recomile the whole openwrt for this?

If not, do you have any instructions how to recompile libgd?

Thank you for your patience with me ;)
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: federicofissore on May 13, 2014, 08:50 pm
Yes, as I said:


An alternative path is to build just the SDK (or to obtain one from the openwrt website) and adapt instructions like those from fibasile about nodejs (http://fibasile.github.io/compiling-nodejs-for-arduino-yun.html), so that you can build a custom version of package gd


Openwrt has a 32bit version of it for Attitude Adjustment (OpenWrt-Yun is a custom version of it) here (http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/)
On their wiki there's a "usage" paragraph http://wiki.openwrt.org/doc/howto/obtain.firmware.sdk#usage

I've never used it, so I cannot give you specific support
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: federicofissore on May 13, 2014, 08:53 pm
On a second thought, maybe the Toolchain suffices. I really don't know for sure...
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: khchan on May 14, 2014, 11:49 am
Hi Kaul,

If you would like to add time stamp to your picture once you saving it, maybe this link able to help you :
https://github.com/amicojeko/YouCantTouchThis (https://github.com/amicojeko/YouCantTouchThis)

Code: [Select]
/* A simple function to generate unique timestamp based filenames */

String uniqueFileName(String ext){
  String filename = "";
  p.runShellCommand("date +%s");
  while(p.running());

  while (p.available()>0) {
    char c = p.read();
    filename += c;
  }

  filename.trim();
  filename += "." + ext;

  return filename;


Thanks!
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: sonnyyu on May 15, 2014, 06:36 pm

Hi Kaul,

If you would like to add time stamp to your picture once you saving it, maybe this link able to help you :
https://github.com/amicojeko/YouCantTouchThis (https://github.com/amicojeko/YouCantTouchThis)

Code: [Select]
/* A simple function to generate unique timestamp based filenames */

String uniqueFileName(String ext){
 String filename = "";
 p.runShellCommand("date +%s");
 while(p.running());

 while (p.available()>0) {
   char c = p.read();
   filename += c;
 }

 filename.trim();
 filename += "." + ext;

 return filename;
}  


Thanks!


Have time stamp at file name is nice idea. However you do not need ATmega32u4 help!

Code: [Select]
fswebcam test.png

Code: [Select]
fswebcam `date +"%G%m%d%H%M%S"`.png

It create 20140515123538.png  and has 2014/05/15 12:35:38  as time stamp.

http://linux.about.com/od/commands/l/blcmdl1_date.htm (http://linux.about.com/od/commands/l/blcmdl1_date.htm)
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: sonnyyu on May 16, 2014, 03:11 am
The time stamp is come from openwrt ntp which is required online all the time, but if offline support is is required then real-time clock (RTC) is needed.  However Yun masks all the GPIO which make direct connect RTC chip impossible. Very ugly work around is connect RTC via MCU.
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: khchan on May 16, 2014, 05:06 am
@ sonnyyu, thanks for your suggestion!   ;)
Title: Re: How to Arduino Yun support my webcam?
Post by: FormulaArduino on Jul 24, 2014, 10:33 am
ERROR MESSAGE LIKE BELOW. WHAT SHOULD I DO?

root@Arduino:~# cd /mnt/sda1
root@Arduino:/mnt/sda1# fswebcam test.png
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Adjusting resolution from 384x288 to 352x288.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
Unable to load font 'sans': libgd was not built with FreeType font support

Disabling the the banner.
Writing JPEG image to 'test.png'.
Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: sonnyyu on Jul 24, 2014, 01:48 pm
Work around:

...
Code: [Select]
fswebcam  -i 0 -d v4l2:/dev/video0  --no-banner  --jpeg 95  --save test.jpg
--jpeg 95 will increase quality to 95%.
...


--no-banner

Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: sonnyyu on Jul 24, 2014, 01:50 pm

...
recompile libgd with freetype support.

nano ~/OpenWrt-yun/package/feeds/packages/gd/Makefile

Code: [Select]
CONFIGURE_ARGS += \
        --enable-shared \
        --enable-static \
        --disable-rpath \
        --without-x \
        --without-fontconfig \
        --without-freetype \
        --with-jpeg=$(STAGING_DIR)/usr \
        --with-png=$(STAGING_DIR)/usr \
        --without-xpm \
        --without-iconv


remove " --without-freetype \" then recompile libgd. then remove installed libgd force install new revision one.  I have not chance to test it but you should go ahead try it yourself.

Title: Re: How to Arduino Yun support Creative Live! VISTA VF0470 webcam?
Post by: FormulaArduino on Jul 28, 2014, 11:06 am
Thank you. It works.