6 Replies Latest reply on May 10, 2016 9:45 AM by Intel Corporation

    How to creat files to write serial data to Edison's drive?

    Lane_Lee

      Hi,I saw there was about 776MB space in Edison's own drive (flash), I wonder how I can write data into that drive, especially with Arduino IDE? Is there any relevant code? Sorry for the naive question, since this is really out of my field.

      Thanks in advance

        • 1. Re: How to creat files to write serial data to Edison's drive?
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi Lane_Lee,
           
          That space cannot be used to store files. It was used before to copy the Yocto image files and then flash the Edison module with it. Now this flashing method is no longer used, and that space is not used anymore. Now we use the Flash Tool Lite to flash the Edison module.
           
          Anyhow, writing files into the Edison's memory is possible. You can access the Edison's console and navigate through the file system. You can create, edit or delete files. The following guide will show you how to access the Edison's console: https://software.intel.com/en-us/setting-up-serial-terminal-on-system-with-windows
           
          You can create and edit files from the Edison's console using the Vi editor. You can find many guides about how to use this editor on the web, for example: http://www.howtogeek.com/102468/a-beginners-guide-to-editing-text-files-with-vi
           
          On the other hand, if you want to create and edit files from the Arduino IDE, you can use the SD library. This library is normally used to create files in the SD memory, however, it can be used to create files in the Edison's memory too. You would have to do a little change in the SD library though:

          1. Open the file SD.cpp. It's located in C:\[Arduino IDE directory]\hardware\intel\i686\libraries\SD\src\SD.cpp
          2. Comment the line 37. This line is the following: const char* SD_MOUNT_PATH = "/media/sdcard"; and it defines where the files will be created.
          3. Write the following line to define the new location where the files will be created: const char* SD_MOUNT_PATH = "/home";
          4. Save the file
           
          Now you can use the examples that use the SD library to create files. Those files will be created in the Edison's memory. If you access the Edison's console, you can go to the directory /home and confirm that the files you are creating through the Arduino IDE are actually there.
           
          Regards,
          Diego
          • 2. Re: How to creat files to write serial data to Edison's drive?
            Lane_Lee

            Hi Diego,

            Thanks very much for your detailed info. Now I only want to know  how much space can I use in Edison's memory? And can I write data to files in Edison's memory infinite times?

            Thanks,

            Lane

            • 3. Re: How to creat files to write serial data to Edison's drive?
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi Lane_Lee,

              You can run the following command in the Edison's console to check how much space you can use: df -h | grep home. In my case, I'm using the image version 146 and I can use 1.3GB. I haven't tested if that space change between the different image versions, however you can test it by yourself by running the command above and be sure on how much space you can use. If you want to know which image version you have, you can run one of the following commands: configure_edison --version or cat /etc/version

              Regarding to your last question, what do you mean by writing data infinite times? 

              Regards,
              Diego

              • 4. Re: How to creat files to write serial data to Edison's drive?
                Lane_Lee

                Hi Diego,

                Thanks for your reply, I have the same image version and space as you do. And following your methods, I have successfullycreated files and written data inside just now.

                Many thanks.

                Best,

                Lane

                • 5. Re: How to creat files to write serial data to Edison's drive?
                  Bill.

                  Hi Diego,

                   

                  Regarding the following from the Correct Answer:

                  "That space cannot be used to store files. ...  that space is not used anymore."

                   

                  I presume the space on Edison is the /media/storage filesystem (Yocto 201603141535).

                   

                  Question: Since the space cannot be used to STORE files and the Flash process doesn't use it, is it ONLY used by me to pass files from a Linux/PC host to Edison?

                   

                  Question: What needs to be done so that the space CAN be used to store files?

                   

                  Regards,

                  Bill Fosbury

                  • 6. Re: How to creat files to write serial data to Edison's drive?
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    Hi Bill.,

                    I recommend you to check the following thread where there is a method posted by another user on how to use this space to store files: https://communities.intel.com/thread/55510. I haven't tested it, but there are some users that apparently have tested it successfully.  I believe you will find it useful.

                    Regards,
                    Diego