programming the intel edinson

8
 P r o g r a mming t h e I n t e E di so n : B eyo nd the A rduino I D E CONTRIBUTORS: SFUPTOWNMAKER  FAVORITE 1  SHARE Share on T wit terShare on FacebookPin It I ntr o d u c t i o n T h e m a jority o f co n t e n t in t h e wi l d f or t h e I n t e l E d i so n se e m s to b e f o cu se d o n u sing t h e E d i so n w h i l e i t i s a tt ac h e d to t h e A r d uin o - co mpati b l e d ev el o p m e n t b o ar d . Wit h t he r e l e a se o f t h e S p a r kF u n B l o ck l i n e f o r t h e E d i so n , it b e co m e s p r a ct i ca l to u se f a r l e ss h a r d w a re t o ac cess t h e res o ur ce s o f t he E d i so n.

Upload: serfary

Post on 05-Oct-2015

16 views

Category:

Documents


0 download

DESCRIPTION

ntel's Edison module goes beyond being just another Arduino clone. Check this tutorial for advice on how to get the most out of your Edison by writing code in C++!

TRANSCRIPT

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!