I am a beginner of working in the Intel Galileo Gen 2 board. I am using Eclipse IDE to build the script into the board. I am working in the blinking led projects it worked.
Every time I am using putty to executing the led blink project.
I want when I am switch on the board that led blink project it will be automatically executive.
what is the procedure it will be run automatically my script?
any body know about that please share with me.
If I'm not mistaken, once you upload a script from the Eclipse IDE, the scripts files get stored on /tmp. This directory gets erased every time the board reboots. My suggestion, if you want to get a script that starts automatically on boot, is to compile the script on the board's file system (using gcc or g++, etc.) and create a system service that starts it on boot (using https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and... systemd).
I am using Eclipse IDE it will make a image file after build the script file(e.g blink.c file).
I got a blink file. After i am build the blink file into Intel Galileo Gen 2.
It was blinked. that time i plug out the power cable and plug on the power cable it not blinked.
once again i build the same file on the board.
how to run that build file automatically when i am plug up the power.
If you want the script to start automatically on boot, then you will have to create a system service. I'll give you a brief example on how to do one:
The first thing you will need is your script. Right now, I will use a simple Blink script:
# include "mraa/gpio.h"
int main(int argc, char** argv)
mraa_platform_t platform = mraa_get_platform_type();
mraa_gpio_context gpio, gpio_in = NULL;
char* board_name = mraa_get_platform_name();
int ledstate = 0;
gpio = mraa_gpio_init(13);
fprintf(stdout, "Welcome to libmraa\n Version: %s\n Running on %s\n", mraa_get_version(), board_name);
ledstate = !ledstate;
Compile it and create an executable file with the command:
gcc blink.c -o blink.out -lmraa
After you've done that you can test it with "./blink.out" and you should see a blinking light on your board.
Now we can create our system service:
It'll look like this:
Description=Starts a blink script on boot
This file must be named with an extension ".service", so my service is called blink.service. And it must be stored in /lib/systemd/system/.
After you have stored the service file, type the command "systemctl enable blink.service". If you named your service different change blink.service for what you called it.
Now if you reboot the board you should see the blink starting on boot.
Thanks. Now it is working when i am plug up the board. it will automatically running.
gcc blink.c -o blink.out -lmraa
In the above line why we use -lmraa to create a executable file
If any script we can use -lmraa to create a executable file.
"-lmraa" is not used to create an executable file but to include MRAA when compiling it with gcc. In fact the option to create the executable in that command is "-o". If you would like to learn more about how to use gcc, I'd suggest you to check http://linux.die.net/man/1/gcc gcc(1): GNU project C/C++ compiler - Linux man page.