Community
cancel
Showing results for 
Search instead for 
Did you mean: 
NK
New Contributor I
1,044 Views

Running the Code in galileo gen2 after restart

I have worked with galileo gen2 using node.js as well as C.But when I power it off and on immediately, the node.js program automatically runs but the C program doesn't.

Also another problem I have encountered with eclipse IDE is that when I disconnect a particular galileo from the IDE, the program also stops running.

Any reason why this happens?

Nathan

Tags (2)
5 Replies
idata
Community Manager
95 Views

Hello KS_Nathan,

 

 

The reason why the script (uploaded with Eclipse) stops working is because it is stored in a temporary directory, called /tmp. Every time the board boots this directory is cleaned.

 

How are you making the JavaScript code run on boot? Did you make a system service? If so, that's the correct approach, and if you would like the C code to run every time on boot, you should add it to the service or create a new one for this script.

 

In case you are not using a system service, let me know how you are making the JavaScript code run on boot. Or let me know if you need help creating a system service.

 

 

Peter.
NK
New Contributor I
95 Views

I donot know what a system service is but the javascript code I wrote it in Intel XDK IoT edition and uploaded on to the board always started working even after boot, but please do explain me how to add the C code (eclipse IDE ) to the system service.

regards

Nathan

idata
Community Manager
95 Views

Check /message/358383# 358383 this thread, in there I explain how to create a C or C++ script that runs every time on boot by using a system service. Let me know if you are able to create one for your project.

Peter.

NK
New Contributor I
95 Views

Hey peter, what about when I just disconnect from the galileo(in Eclipse) instead of powering it off would this method still be working there?

Because it stops as and when i disconnect

Nathan

idata
Community Manager
95 Views

If you use the method I described above you won't need to use Eclipse. That way you will be able to run your scripts directly from Linux. They shouldn't be affected if you disconnect the board from the PC. As long as your board is powered the script should run.

 

I personally like to work directly from Linux better. I usually use an IDE (Arduino, XDK, Eclipse...) when prototyping a script but when it is ready, I believe the best option is to work with them directly from Linux since you have more control over the process that way.

 

 

Peter.
Reply