Programming the Intel Edison: Beyond the Arduino
IDECONTRIBUTORS:SFUPTOWNMAKERFAVORITE1SHAREShare on TwitterShare on
FacebookPin ItIntroductionThe majority of content in the wild for
the Intel Edison seems to be focused on using the Edison while it
is attached to the Arduino-compatible development board. With the
release of theSparkFun Block line for the Edison, it becomes
practical to use far less hardware to access the resources of the
Edison.
This tutorial will show you how to write C++ code for the
Edisonwithoutusing the Arduino IDE or making the assumption that
the Edison is mounted to an Arduino development board.Components
UsedWere going to do this fairly minimally; were going to
demonstrate the Edisons most basic functionality without involving
any fancy hardware. Youll find more examples involving hardware in
tutorials for individual blocks. Intel Edison Starter Pack- Youll
need theConsole Blockat a minimum to get your Edison onto your
local WiFi network. Intel Edison Base Block(optional) - You may
find that the latency of your WiFi network is unacceptable; in that
case, you can connect to the OTG port on the Base Block to access
the Edison via a USB RNDIS network interface. This is a highly
recommended upgrade, however, as it will allow you to upgrade the
flash image on the Edison to the latest version. Edison Hardware
Kit- One will be enough to make the Edison/Console/GPIO
stack.Recommended ReadingWriting code for the Edison without using
the Arduino IDE is an advanced topic; were going to assume that
youre conversant in at least basic Linux command line syntax and
C++ syntax. Getting Started with the Edison- Getting the Edison
powered up, connected to your network, and getting to the command
line. Also updating the firmware, which is recommended before
proceeding but not mandatory. General Edison Block Guide- Just what
it says. This will give you some help understanding how to put the
stack together and avoid inter-block conflicts. Console Block
Hookup Guide- More information on the Console Block.Toolchain:
EclipseThere are two approaches to writing C++ code on the Edison:
Using the Eclipse IDE that Intel provides or going barebones using
GCC and a command line directly on the Edison.Using the Eclipse
EnvironmentIntel has produced guides for installing the Eclipse IDE
forMacintosh,Linux, andWindows.Once youve installed it and launched
it, come back here and well walk through connecting the Edison to
the IDE and loading an example program.The instructions there are
incomplete and without additional work, you wont be able to run
programs on the Edison.Connecting to the EdisonIn order to connect
to the Edison, you need to have some sort of open TCP/IP channel to
it. This can be either through the USB-OTG port on the Edison or
over your local WiFi network. Youll need to know what the IP
address of the Edison is; you can find more information on that on
the Edison Getting Started tutorial.Once youve discovered the IP
address of the Edison in question, heres how to connect:
As in the picture above, click on the Remote System Explorer
button in the upper right corner.
The IDE window should look like this. On the left side, theres a
frame called Remote Systems with two entries: Local and galileo.
Delete the galileo entry (just click on it and hit the delete
key).
Now well create a new entry. Click on the Define a connection to
a remote system button.
Choose SSH Only, and click next.
Enter the information for your device, as seen above as well.
Click Finish (not Next). The window will close, and a new item will
appear in the list.
Select the Edison connection you just created, you should see a
list of options in the lower left that should look mostly like the
above. In the Default user name field, you can put in root;
otherwise, itll ask for a user name when you connect and use that
for future connections.
Use the Connect option in the contextual menu (right click on PC
and Linux, CMD click on Mac). That will bring up this window
Make sure the IP address here looks right, then put in your
password (if you have one). If youve never logged into your Edison
and set it up, the default can be made root and the password can be
left blank.Check and make sure that the properties window in the
lower left says Some subsystems connected under connection status.
You may need to click the Refresh information of selected system
button, at the top, before that will show up.Youre now ready to
write and run some code with the Eclipse IDE!