Yes, there is a way to upload several sketches to your Galileo and then start them whenever you like. Follow these steps to do so:
1. Upload your sketches and copy them into a different folder (uploaded sketches are found in /sketch) but do not change the sketch's name, if you need to identify them change the directory's name instead.
2. To start a specific sketch, stop clloader with the command systemctl stop clloader.service
3. Copy the sketch you want to start to the /sketch directory
4. Start clloader again with the command systemctl start clloader.service
Let me know if it works for you.
Currently in my SD card, i uploaded the 'Blink' example into my i g gen2 board, i ssh through wifi and typed this:
what am i doing wrong?
i also tried running the command in my sd card:
when i run this command, blinking stops momentarily, after half a second, my board keeps blinking.
i can move the 'sketch.elf' file into another directory.... or so it seems.. i use a command to create a new directory on my sd card and move 'sketches.elf' into new location, but wait! it not only does not get created, but my sketches.elf is gone!
figured out how to move 'sketch.elf' into 'sketches' directory, however.... when i delete sketch.elf file in '/sketch' and move 'sketch.elf' in '/sketches' i cant seem to activate the .elf file... tried both stop/start commands with no success...
I'm in trouble right now...
In the uclibc image (in the SD card) , the systemctl command does not exist...
I'm rrying to use the eglibc, but when I connect the Galileo USB to the laptop it is recognized as another device, not as a Galileo...
Maybe because I'm using a Gen 1 Galileo, maybe not, but in either case I'll have to solve my problem first, and later maybe coming back to this...
Starting with nothing loaded, i.e.
I load the Blink example. The LED starts blinking and in the /sketch directory:
systemctl does not work:
and I don't know why, I'm using the last (downloaded yesterday) egclibc yocto image...
Anyway, I'm able to stop the process with the killall command:
The first ps shows the sketch.elf is running and the second one shows it is not running anymore.
Now I rename the sketch.elf so that I remember what sketch is and start the sketch from the command line as suggested by xbolshe:
and the LED starts blinking again.
I stop this process running with ^C and load a second sketch, which actually does exactly the same as Blink and prints On/Off as the LED is HIGH/LOW respectively
and in the linux terminal:
i.e. the sketch.elf is the Blink2 sketch.
As before, I can stop the sketch, rename the file and restart the sketch with the new filename:
There is one side effect, though, which are the so called zombie processes, but I think they are not a problem so far...
u and xbolshe are good! thank you
** one last thing, instead of ^C to stop the process, what's another alternative? i ultimately want to automate launching programs but im having a hard time simulating ^C keystrokes, thanks
You are welcome, it's good to see you are able to have your project going on.
You can use the killall command for stoping processes. Following the examples above:
./Blink.elf /dev/ttyGS0 &
(note the "&" at the end so that the process is started and you have the prompt at the terminal) you can use later
and the sketch should stop running.