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

Choosing and integrating different languages when starting a project on Intel IoT dev

Jump to solution

Hi,

I am starting a project using the Intel Edison board, XBee and Eclipse IoT dev kit.

I already have some code in C for managing databases from a previous project, also found the Digi Java XBee libraries very well documented and would like to use Java as I am more familiar with it. On the other hand Im considering implementing some machine learning using Python.

As I am new on this Intel platform and IoT dev kit, my question is how to integrate different programming languages into the same project. Thank you

Tags (2)
1 Solution
TTony5
New Contributor I
111 Views

Thank you for the answers, it is very helpful. I actually will rewrite the database code I have to Java but If I am not mistaken I will still need to use C for the mraa and upm libraries since I hace to include RFID readers over I2C and UART communication.

View solution in original post

4 Replies
Diego_V_Intel
Employee
111 Views

Hi TonyMontes,

You could write different scripts for different tasks and then, make them to share data and communicate to each other. Check the following guide; it explains how to share data between environments using text files: https://software.intel.com/en-us/blogs/2015/05/05/efficient-data-sharing-using-interrupts-on-intel-e... IoT - Data sharing between programming environments on Intel® Edison | Intel® Developer Zone

You could, for example, write a script in Python and save the results in a text file, then in a JavaScript (Java, C/C++) script, you can open that text file and access the information, or save new information.

Hope that helps you.

Regards,

Diego

VIvan7
New Contributor III
111 Views

If programs should run always, you create daemons with while(1) loops and write init scripts for the daemons. It doesn't matter what languages you'll use for them.

While writing daemons, you have to be very careful. You must catch errors and free memory correctly.

Interprocess communication can be done by different means. Unix sockets are the easiest to implement.

Why would you use C code to connect to databases when Java also has libraries for databases?

Database <-> C-code proxy <-> Java program? The C-code proxy adds complications.

TTony5
New Contributor I
112 Views

Thank you for the answers, it is very helpful. I actually will rewrite the database code I have to Java but If I am not mistaken I will still need to use C for the mraa and upm libraries since I hace to include RFID readers over I2C and UART communication.

View solution in original post

VIvan7
New Contributor III
111 Views

There are Java I²C libraries for the Raspberry. There are not as many resources for the Edison. But you can try to steal parts of that Raspberry code.

Your Java code may initialize GPIO pins by writing into /sys/kernel/debug/gpio_debug/gpioN/

Reply