There are many ways to do this, but on the Intel® Edison board, I found that the easiest way is using the /etc/init.d directory. If this is your first time using init.d for start-up scripts, you’re going to have to first create the directory. Else, skip to Step 2:
root@edison:~# mkdir /etc/init.d
Now let's switch into that directory.
root@edison:~# cd /etc/init.d
Next, we’re going to create a bash script in this folder that contains our boot commands. In this case, we’re automating the Arduino sketch to run at startup.
In any case, open your favorite text editor and create the script automateSketch.sh:
root@edison:/etc/init.d# vi automateSketch.sh
Add the following contents into the script.
exec /sketch/sketch.elf /dev/ttyGS0 /dev/ttyGS0
Really, it’s just the two commands.
Now we can make the script executable by changing the permissions with chmod.
root@edison:/etc/init.d# chmod +x /etc/init.d/automateSketch.sh
root@edison:/etc/init.d# chmod +x automateSketch.sh
Now, to make sure this script is executed every time Linux* boots, issue the following command and wait for the response shown below:
oot@edison:/etc/init.d# update-rc.d automateSketch.sh defaults
Adding system startup for /etc/init.d/automateSketch.sh
And we're done! We can see if it worked:
For more such intel IoT resources and tools from Intel, please visit the Intel® Developer Zone
Other Popular Deals
- The 10 best job hunting apps on AndroidTop 10 Android launchers (June 2017)
- The 10 scariest horror games on AndroidAndroid app stores: 5 best alternatives to Google Play Store
- Best Android apps for rooted devices18 apps for a memorable Valentine's Day
- Top 15 Android games that you should playThe 20 best looking games for mobile phones
- 8 Android apps to tickle your funny bone17 must have apps for any Android device (plus alternatives)
- 5 apps to get the Android Lollipop look on your smartphoneTake control of your Android device with these apps
- 7 weird and strange apps for your Smartphone10 neat Google apps you may not know of
- Perfect Viewer10 essential Indian apps for Android devices