After several days of working with an Intel Edison and Ardunio breakout board, the Ardunio programming development environment became unable to successfully transfer compiled sketches to the Edison. A message declaring "Transfer Incomplete" was the only clue that something had gone awry. This instructable will describe how to restore your Edison to a state ready to accept sketch transfers, and provide one method to avoid the problem in the future.
The starting assumption is that you have assembled and configured your Intel Edison with Ardunio breakout board so that it communicates with the computer you are developing the sketches on. See this other instructable for a beginners guide to performing that initial setup and configuration. Once you have gone through the setup, you should happily be able to use the familiar Arduino Development Environment to develop, compile, and transfer sketches to your Edison.
After a few days of working with the Arduino programming interface the compiled sketches were suddenly no longer being successfully transferred to the Edison. The message "Transfer Incomplete" would display in the status window of the programming dialog. Through the use of web searches of the Intel forums and my familiarity with Linux, I was able to resolve the problem using the following steps.
Step 1: Step 1: Access the Edison Linux File System
The first step is to access the Linux command line of the Edison. A terminal emulator is required to log into the Edison. I chose to use the PUTTY program recommended in the original Edison configuration instructions. I have saved a profile in the PUTTY application to make logging into the Edison easier. It has the Connection Type set to Serial, the Serial Line set to the COM Port my Edison is connected to, and the communication speed set to 115200. Your Com port may differ from mine. You can find your Edison's COM Port on a Windows machine by using Device Manager to inspect the Ports selection for the value of the USB Serial Port.
Open the Connection, enter the user name of "root", and specify the password you created during your initial Edison configuration session.
Step 2: Step 2: Determine the Amount of Log Files Present
The debugging tip from the Intel developer forums was that the /dev/root, /, partition on the Linux installation was full. To verify that is the case, use the linux command
On the screen image included here, the percentage of space used for the /dev/root, '/', partition shows 78% on the top line. When the transfer problems were occurring, that percentage displayed as 100%.
The next debugging tip was to see how much space was being taken up by various log files. To do that, use the following Linux commands.
The number of log directories present on my 78% full system is shown in the screen shot. Each of those long file names is a directory, under which a system log file is stored.
Step 3: Step 3: Clean Up the Log Files
The next step is to remove the log directories and files to free up space on the /dev/root file system.
Be very careful executing the following "remove", rm, command. It includes options to recursively delete everything under each subdirectory in the current directory. You must be in the /var/log/journal subdirectory before issuing the command that deletes everything inside that directory. If you issue the aggressive rm command from any other directory, you may remove critical system files from the Edison Linux installation. That would require a rebuild of the Linux installation as detailed in the original Edison configuration instructions
rm -r *
After issuing the recursive remove command against all subdirectories of the /var/log/journal directory there will once again be free space for transferring sketches to the Edison.
Step 4: Step 4: Reducing the Number of Log Files in the Future
After freeing the file space by deleting the logs, you should once again be able to transfer sketches to the Edison board. The fix will only be temporary, as a new log file will be generated everytime the Edison board is powered up or rebooted.
To make a more permanent fix to the problem of too many log files you can reconfigure the specifications for the Linux journaling system.
A basic file editor, vi, is included in the Linux installation on the Edison.
The vi editor is generally considered the lowest common denominator for text editors. It's available on every Linux installation and simple enough to function on the simplest of terminal emulators, such as provided by PUTTY.
The following commands will modify the journaling system to reduce the amount of space the log files can consume.
This will bring up the text editor for the configuration file.
The cursor will be at the top of the file. Down arrow the cursor until it is on the comment marker, '#', at the beginning for the SystemMaxFileSize line.
Press 'x' key to delete the comment marker, #.
Right cursor to the end of the SystemMaxFileSize= line and press 'i' key to enter insert mode.
Type 1M after the = sign
The file in the editor should look like the one in the screenshot shown here.
To save and exit the vi editor do the following key strokes
'Esc' key followed by colon, :, w and q keys
That will write the updated configuration file and exit the editor. Now your Edison journaling system will only allow a maximum of 1 megabyte of journal files to be stored. The oldest journals will be deleted once the 1M limit is reached and a new journal is needed.
That concludes this short instructable for keeping your Edison ready for accepting sketch transfers.