7 Replies Latest reply on Nov 26, 2015 10:32 AM by PabloM_Intel

    Intel Galileo Rev 2 Arduino IDE File Operations

    Keith023

      Is there a listing of the file operations and their functions for the arduino IDE?  Currently I know it supports fopen, fprintf, fgetc but I wanted to know what capabilities the galileo had for file I/O.  I'm using it currently for passing information back and forth from the arduino application to python applications and knowing what capabilities exist would help.  Mainly I'm looking for the best approach to scan a text file line by line, typically would use a built in operator like fscanf but that doesn't seem to work the way I expect.

        • 1. Re: Intel Galileo Rev 2 Arduino IDE File Operations
          PabloM_Intel

          Hi Keith023,

           

          I’m not sure if there’s a list of file operations for the Arduino IDE. But I believe that using the Eclipse IDE would be more suitable for this kind of project. Have you considered using it? Is it an option for you?

           

          Regards,

          PabloM_Intel

          1 of 1 people found this helpful
          • 2. Re: Intel Galileo Rev 2 Arduino IDE File Operations
            Keith023

            I have not.  I currently have it running in the Arduino IDE.  What steps would I have to take to transition to the Eclipse IDE?  I currently have a python environment setup on the SD Card with Arduino used as the 'start-up' application.

            • 3. Re: Intel Galileo Rev 2 Arduino IDE File Operations
              PabloM_Intel

              Hi Keith023,

               

              If you want to use Eclipse, you can write your code using C/C++ (you can also use Java if that’s your choice), so I believe you won’t much troubles adjusting the code that you’re currently using in the Arduino IDE. However, if you’re using an Arduino-exclusive library you’ll have to add that library to Eclipse. You can check this guide about using Eclipse with the Intel boards.

               

              IoT - Installing the Eclipse* IDE | Intel® Developer Zone

               

              Regards,

              PabloM_Intel

              • 4. Re: Intel Galileo Rev 2 Arduino IDE File Operations
                CMata_Intel

                Hi Keith023,

                 

                Have you been able to port your project into the Eclipse environment? Have you been able to use more file operations?

                 

                Regards,

                Charlie

                • 5. Re: Intel Galileo Rev 2 Arduino IDE File Operations
                  Keith023

                  Since I already have it setup using the arudino method (usnig sketch.elf at runtime to invoke system calls to the linux system), I decided not to try out the eclipse IDE.  Even more so due to a few libraries I am using to communicate to OLED displays.

                   

                  One thing I have noticed is the sketch.elf will periodically (though rarely) stop running.  Do you know what could cause this and a good way to restart it?  I could write a script to look for the status of sketch.elf and if not-running restart it.

                  • 6. Re: Intel Galileo Rev 2 Arduino IDE File Operations
                    FGT

                    Keith023 wrote:

                     

                    Is there a listing of the file operations and their functions for the arduino IDE?  Currently I know it supports fopen, fprintf, fgetc but I wanted to know what capabilities the galileo had for file I/O.  I'm using it currently for passing information back and forth from the arduino application to python applications and knowing what capabilities exist would help.  Mainly I'm looking for the best approach to scan a text file line by line, typically would use a built in operator like fscanf but that doesn't seem to work the way I expect.

                     

                    Hi,

                     

                    I've used several file operations as in a Linux environment (in which I think they are actually run).

                     

                    I did not use fscanf in particular... but I've trouble to use it in Linux (beyond Galileo, of course) either way... so I expect I would not be of much help on it anyway.

                     

                    I did use fgets and it did work as (I) expected (I didn't have to look for many things in a single line...)

                     

                    My suggestion is that you try some Linux-like functions combination, most I've tried worked for me. And my main documentation source has been the simple "man pages".

                     

                    My application was similar to yours in which I had a python web server with CGI and some CGI programs exchanged some (very simple) data with an Arduino sketch.

                     

                    I was not able to maintain that set up, however, since the python server took too much time to reply some simple web requests.

                     

                    HTH,

                     

                    Fernando.

                    • 7. Re: Intel Galileo Rev 2 Arduino IDE File Operations
                      PabloM_Intel

                      Hi Keith023,

                       

                      It might be possible that somehow the Galileo enters a suspend mode and just ceases to run the sketch randomly, but this is just a theory. Did you already try with your idea? Writing a script that controls the status of the Arduino sketch? I believe that should solve the issue, that’s a great workaround by the way.

                      Also, what FGT suggests is also very helpful. Given that he was using Python and you’re using the Arduino IDE it’s possible that not all works the same, but you can give a try.

                       

                      Regards,

                      PabloM_Intel