2 Replies Latest reply on Jan 12, 2016 10:10 AM by cificeps

    Compatibility between Intel XDK and Arduino IDE


      I'm making an IoT project: A fingerprint lock with the major function is open with the identification of finger-ID and minor function is upload the time when we entrance to the internet. We can see these data via HTML pages or directly type address in web browsers.

      But the major problem is: The major function I code in Arduino IDE (I cannot code in other language cause it contains libraries that supported only in Arduino IDE- adafruit fingerprint library). And the rest- upload data to the internet and show them in web browsers is written in node.js(which is available in Intel XDK). So how can I make these two code run parallel in Intel Galileo 2 and they can commute each other.

      First, I tried upload a node.js to Galileo via Intel XDK and then upload program.ino via Arduino IDE and encountered an error with putty... something like Arduino IDE want to erase the old sketch and upload the new one but it has no right to do so. It show "permission denied".

      Then I think I should combine them in a single sketch in Inte XDK. But program.ino is written in C++ followed by many libraries and node.js is written in JavaScript. To do so, I must exchange the whole sketch from C++ to JavaScript.I think this is impossible.


      So, can anyone show me the method for 2 "languages": Arduino and Linux run parallel and Linux can refer to data drawn from  Arduino pinout embeded in Galileo and post them in the internet so we can see them via html or something like that.


      Thanks a lot! ^_^

        • 1. Re: Compatibility between Intel XDK and Arduino IDE

          Hello cificeps,


          I recommend you to try to execute the node script directly in the Galileo's terminal. Every script, including Arduino sketches, is a process in the Linux OS. You can execute a node script and an Arduino sketch at the same time. From the Linux side, it would be seen as two processes running. Maybe the way how the XDK uploads and runs the script is causing that behavior.


          If you have your script (.js), you can copy it and execute it directly in Galileo's terminal by running the following command: node myScript.js. This approach might work and let you execute the node script and upload an Arduino sketch to have both running.


          On the other hand, I recommend you to check the following document where there is an explanation about how to share data between an Arduino sketch and a script running in the Linux side. Actually, the document uses an example between an Arduino sketch and a NodeJS script. You might find it interesting: IoT - Data sharing between programming environments on Intel® Edison | Intel® Developer Zone


          Another option would be to write what the NodeJS script does in the Arduino sketch. That way you would have all the code in one place. If the NodeJS script is used to upload data to the Internet, then one of the WiFi examples in the Arduino IDE might help you to write an Arduino sketch that does the same thing.




          • 2. Re: Compatibility between Intel XDK and Arduino IDE

            Thank you for your recommendation. After trying many ways, I realized that (for me) the easiest way to communicate between Arduino IDE and Linux environment is using temporary files. Something like txt file that both Arduino IDE and Linux can read and write over them.

            I wish one day there were a language which could replace all present languages. All in one ^_^