A Touch of Light

A step towards enlightenment for those living in the world of darkness.

A Young India Fellowship Initiative in collaboration with University of Pennsylvania


      





Tuesday, December 6, 2011

Autorun

Although we finished the first phase of viSparsh. There were certain fine tunings required to make the belt wearable. The belt stills needed to be started by executing a file on ubuntu-terminal. To resolve that we needed an autorun file which automatically runs at startup and kickstarts the belt. This can be done by creating an initialization daemon. We have created this daemon and now the belt can run on its own. The detailed process is given below- 


STEP1: Create the autorun script
Create a new file 'auto_visparsh' at Desktop with the commands starting the viSparsh belt as content. Copy following command in this file. 

COMMAND:
cd /root/OpenNI/Platform/Linux-x86/Bin/Release
./SimpleRead.net.exe


STEP2: Copy this autorun file to /etc/init.d 
/etc/init.d contains all scripts which are run on startup and shutdown automatically. The '.d' in 'init.d' represents 'daemon'. Daemon are the processes which are executed in background.

COMMAND:
cd /etc/init.d
cp /home/visparsh/Desktop/auto_visparsh /etc/init.d


STEP3: Choose the run-level
Create a 'soft-link' of the autorun file in one of the run-level directory {rc0.d, rc1.d rc2.d rc3.d rc4.d, rc5.d, rc6.d}. For our purpose choose 'rc2.d'. Don't use 'rc0','rc1' and 'rc6' they contain shutdown scripts. We can also set priority of the process using 'SXX' where XX represents the priority {00<=XX<=99}. The letter 'S' represents 'Start' and can be replaced by 'K' to deactivate a script.   

COMMAND:
cd /etc/rc2.d
ln -s ../init.d/auto_visparsh S99auto_visparsh

STEP4: Restart
Now restart the board. This time belt will start automatically.

Tuesday, December 6, 2011

Autorun

Although we finished the first phase of viSparsh. There were certain fine tunings required to make the belt wearable. The belt stills needed to be started by executing a file on ubuntu-terminal. To resolve that we needed an autorun file which automatically runs at startup and kickstarts the belt. This can be done by creating an initialization daemon. We have created this daemon and now the belt can run on its own. The detailed process is given below- 


STEP1: Create the autorun script
Create a new file 'auto_visparsh' at Desktop with the commands starting the viSparsh belt as content. Copy following command in this file. 

COMMAND:
cd /root/OpenNI/Platform/Linux-x86/Bin/Release
./SimpleRead.net.exe


STEP2: Copy this autorun file to /etc/init.d 
/etc/init.d contains all scripts which are run on startup and shutdown automatically. The '.d' in 'init.d' represents 'daemon'. Daemon are the processes which are executed in background.

COMMAND:
cd /etc/init.d
cp /home/visparsh/Desktop/auto_visparsh /etc/init.d


STEP3: Choose the run-level
Create a 'soft-link' of the autorun file in one of the run-level directory {rc0.d, rc1.d rc2.d rc3.d rc4.d, rc5.d, rc6.d}. For our purpose choose 'rc2.d'. Don't use 'rc0','rc1' and 'rc6' they contain shutdown scripts. We can also set priority of the process using 'SXX' where XX represents the priority {00<=XX<=99}. The letter 'S' represents 'Start' and can be replaced by 'K' to deactivate a script.   

COMMAND:
cd /etc/rc2.d
ln -s ../init.d/auto_visparsh S99auto_visparsh

STEP4: Restart
Now restart the board. This time belt will start automatically.