so,my friend and I have written a small program in C and uploaded it into an Arduino YUN,for a course we are attending at University. This program is quite simple,it interfaces with a webcam,connected to the usb port on Arduino YUN, through a driver and takes pictures.
The problem is that,at the moment,we run this program through ssh using putty,accessing via ssh to Arduino YUN's memory and executing the program.
Is there a way to execute this program automatically? without accessing through ssh?
is there a piece of code that must be written into the loop() function?
I don't know what your code is, so I can only make guesses at what you are trying to do...
we have written this program in C and put it into arduino yun through ssh. It's not an arduino sketch,is a C program. We want to make the Arduino YUN execute it automatically,in loop
With the process class provided by the Bridge library you can run programs and scripts on the linux side and you can also read its output.
maybe this is the right way of solving this problem,I will let you know if we find any other issues; I will check also the process class and cron. Thank you guys
I think it all depends on when/why you want to run your C program, and what you will be doing with the output.
It's most efficient to try and implement it all on the Linux side. Either add a while loop to your process, add it as a cron task, or write a shell script that is run at startup, and periodically calls your C program.
However, if any of these apply, then you will likely want to use some variation of the Process() class in an Arduino sketch:
you need to send results of your C code over the micro-USB port to a computer
you need to use incoming data from the micro-USB port to trigger your C code
you need the results of the C codeto control some shield connector outputs
you need some shield connector inputs to to trigger your C code
So yes, you can make a Process() call within the loop() function of a sketch. But if you don't need to do anything in the list above, it's more efficient to do it in Linux: the host USB port, the networking (wireless and Ethernet) and the SD card are all controlled directly from Linux.
mjpg_streamer -o "output_file.so --help"
MJPG Streamer Version: svn rev: exported
---------------------------------------------------------------
Help for output plugin..: FILE output plugin
---------------------------------------------------------------
The following parameters can be passed to this plugin:
[-f | --folder ]........: folder to save pictures
[-m | --mjpeg ]........: save the stream to an mjpeg file
[-d | --delay ].........: delay after saving pictures in ms
[-s | --size ]..........: size of ring buffer (max number of pictures to hold)
[-e | --exceed ]........: allow ringbuffer to exceed limit by this amount
[-c | --command ].......: execute command after saving picture
[-i | --input ].......: read frames from the specified input plugin
---------------------------------------------------------------
output_init() return value signals to exit