LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   embedded device usb detection (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/embedded-device-usb-detection-815421/)

najafa 06-21-2010 08:35 AM

embedded device usb detection
 
Hi,
Am a newbie in embedded Linux design and working on detection of usb devices by an ARM 9 embedded device with a camera. The embedded device should be able to detect the usb device and also sending data mostly video to it for storage in Linux. The video data stored on the usb device should be able to play when connected to an LCD or a computer. Am using the c language. My question is I would like to know if anyone can help me with what I need to know for my work and if there is a source code that can help me.

Thanks in advance

yooy 06-21-2010 08:55 AM

well, you can use hal that automatical mount usb, as detection use crontab that periodical check for mounted usb devices, "find" that search for video files and cp to copy things to storage

Similar way to implrement monitor with xrandr,..

I think it's all possible in bash..

najafa 06-25-2010 07:13 AM

Thanks yooy for the input. Most appreciated.

The usb is to store real time streaming video data from a camera. The camera streaming is done. What am to do is to write a program to detect the usb device and then save the streaming data to it in c language. Any help?

Thanks.

schneidz 06-25-2010 08:58 AM

^ does it make a entry in /var/log/messages when you plug it in.

what i usually do is create a service that tails that file every ten seconds looking for a certain string and performs some action if it finds it.

najafa 06-28-2010 07:00 AM

Hi Schneidz,

Thanks for your input. Really appreciated.
Am a bit lost about 'create a service that tails the file every ten seconds'. How do I do that?
I now have a program that can detect the usb, my next challenge is saving it onto the usb device
in real time from the camera.

Thanks for the help in advance.

schneidz 06-28-2010 08:20 AM

i basically meant to probe /var/log/messages every 10 seconds and do something if you see a line that mentions your usb camera.

not sure how your camera records video; maybe a symlink or fifo will help.


All times are GMT -5. The time now is 01:28 AM.