Enginursday: Developing on the Edison

How will you be developing code for the Edison? Here are a few methods we're exploring!

Favorited Favorite 0

You might have noticed we've been going crazy over the Edison lately. We can't help it. We're pretty enamored with the power this tiny, modular computer holds.

Edison and Washington

While I was at IDF a few weeks ago, showing off our Blocks, the most common question I got was: "OK, I understand this thing is awesome...how do I do anything with it?" It's a fair question. The Edison is unlike any microcontroller development platform we're used to -- there's no USB connector, pin break outs, or really any interface we're used to. And it's nothing like a Raspberry Pi, BeagleBone, or pcDuino -- there's no keyboard/mouse/monitor trio for developing on it as if it were a computer terminal.

The Edison is something wholly new to our little maker universe, but it turns out the development options aren't all that dissimilar from what we're used to. In this blog post, I want to highlight some of the routes you can take when you're developing on the Edison -- everything from remaining in the cozy confines of Arduino to cross compiling C/C++ to quick Python or node.js scripts.

Arduino -- Training Wheels, Rapid Prototyping

The Edison comes with nearly full Arduino support, as everything seems to require it these days. You'll have to download the Edison version of Arduino, but, beyond that, things should begin to look familiar.

Arduino screenshot

All of the function calls, and the rest of the API is just like what you're used to with standard Arduinos. Plus, if you use an Arduino Breakout Board, the pin-out is even shield-compatible. I see that familiarity coming in handy for two main markets: educators and rapid prototypers. Educators have the field-proven simplicity of the Arduino interface. Seasoned tinkerers, many of whom just need to get something working as a proof of concept, have a wealth of example sketches and libraries to depend on. Regardless of how ugly it may be under the hood, Arduino can get stuff done quickly. Speaking from experience, I used Edison's Arduino interface -- with a few modifications to the core code's pin multiplexing -- to prove out the OLED Block, so we can quickly move it along to production.

Edison OLED Block lit up

Excuse the phone pic. I'm in an airport waiting to go to Rome.

Of course, what's going on behind the single-window IDE is wholly different from the Arduino we're used to. The libraries -- everything from digitalWrite to WiFi -- have all been re-written to work within the Edison's Linux kernel. To load code onto your Edison, the Arduino IDE compiles it locally, then uses lsz to transfer the executable over to the Edison. The "Arduino sketch" is actually just one of many processes being managed by the operating system.

The familiarity you might have with Arduino makes it great, but as a development environment -- especially on the Edison -- it can become very limiting, very quickly. Still, if you're just getting into Edison development, I'd recommend giving the Arduino interface a quick try. What I've really benefited from is digging through the libraries and core code, seeing how the file system is manipulated to manage everything from pin-toggling to UART-printing. Investigating that source code can be especially helpful as you transition to the next step...

C/C++ (gcc/g++)

If you know your way around gcc, g++, linkers, makefiles, and the like, you may want to jump off the Arduino boat and dive into a more general C/C++ development environment. The Edison's default Yocto Linux install includes both gcc and g++ for all of your compiling needs.

The hard part with this approach is getting your files onto the Edison in the first place. It does come with vi, so if you're some kind of masochist you can write and re-write everything directly on the Edison through a console. There are better options, though.

Since the Edison has built-in WiFi, you can connect it to the same network as your development box, then use SSH to upload new files to it. With programs like WinSCP (Windows) or Cyberduck (Mac), you can even use a file browser to manage the files.

An even better approach, which I think we'll see become the most popular one, is using a personal computer to cross-compile all of the Edison's code. Then, after your computer quickly compiles, just transfer the executable over to the Edison (via SSH or USB) and execute. Intel offers an SDK on their downloads page, which has just about everything you'll need to cross-compile. You can set up an environment in Eclipse, or just use a little makefile-fu to call the cross-compiler (MinGW on Windows) to build your program. Hopefully there'll be more documentation on this approach as the community grows around it (whoops...sounds like volunteer talk).

Python and/or node.js

If interpreted languages are more your thing, the Edison includes support for both Python and node.js. These tools are great because they already have tons of support and examples behind them -- and in a lot of cases they're platform agnostic. Want to post to Twitter? There's undoubtedly a Python script for that. Need to check the score of the baseball game? There's a node.js package for that. One of the Edison's main targets is IoT applications, and Python/node.js have become very popular in that realm.

Building on that, if you're really interested in IoT and node, check out the Intel XDK IoT Edition. A lot of the XDK seems like it's centered around smartphone app development, but there is a section geared around "Internet of Things with Node.js Projects."

Intel XDK

I know next to nothing about node.js, but the simplicity of this environment really has me itching to learn more. Following along with their examples, I was able to remotely upload a node application to blink LEDs. This has a lot of potential to be the "Arduino" of node.js on the Edison.

As the Edison's a brand new platform, most of the development schemes are just taking their baby steps. It'll be fun to see how the community grows around Edison development. Have you had a chance to develop on the Edison yet? What works best for you? What kind of example code would you like to see when we release the Blocks?

Comments 16 comments

  • egradman / about 8 years ago / 3

    At Two Bit Circus we're having great success with the Edison board. I write code in vim on my Mac and use this Makefile to sync the code to the Edison, compile it with the Edison's included gcc, and run it. This cuts the develop-test-debug cycle down to nothing!

    This is a work in progress, so pull requests are welcome!


    • Butterwaffle / about 8 years ago / 1

      Great idea! Instead of sshpass, you might consider using ssh-agent and ssh-add. Then the makefile would not store the password at all, which would be much more secure.

      Mac login sessions run ssh-agent by default, so simply running ssh-add on a key whose public counterpart is in your edison's .ssh/authorized_keys file should make ssh commands in your Mac login session work without requiring a password.

  • rwaldron / about 8 years ago / 1

    To get started with Node.js programming on the Edison, check out Johnny-Five with the Edison-IO or Galileo-IO plugin modules.

  • luftburen / about 8 years ago / 1

    I haven't got a hold on an Edison yet, but when I do I'll try some Java coding on it. I do believe you can install Java SE Embedded for Linux with no hassle. Seeing the Edison, all kinds of fun ideas come to mind!

  • tmassey / about 8 years ago / 1

    I am extremely excited about the edison. I love the simplicity of the arduino. What I am very curious about is if it is possible from the arduino code to call in and start processes on the Linux Side. I realize I could probably make some sorta com link between the two but what would be really awesome for instance have the arduino style code running and managing say a robot and use the power of the atom processor to do the heavy lifting for applications like image processing. or even have the ability from the linux side to call in say an interupt. Like I'm done processing this image and the results are you have a huge cliff your about to fall over. I realize I am over simplifying this and I would need to build neural networks on the linux side to handle that processing. which Wouldn't be hard as long as there is an easy link between the two sides to call and execute processes.

    • Member #595100 / about 8 years ago / 1

      Couldn't you use the arduino System() call to send commands to the linux side?

      • tmassey / about 8 years ago / 1

        I guess my question is there something Similar to the Bridge Library for Arduino Yún on the Edison. I dont know what the System() call is where is the Doc on that?

  • Member #595100 / about 8 years ago / 1

    Intel has also released a C/C++ development toolkit using Eclipse. It is available on the software.intel.com/iot site under downloads.

  • Member #15195 / about 8 years ago / 1

    would love to share my experiences - but still waiting for a board! :) Looks like a good 'un

  • Butterwaffle / about 8 years ago / 1

    I am curious whether the Edison version of the Arduino app includes support for interrupt service routines (ISRs); some of my code uses them to acquire samples at 20-40kHz and I would love to try it on the Edison (when mine arrives).

  • Miskatonic / about 8 years ago / 1

    Great post Jim, have fun in Rome!

  • tankapotamus / about 8 years ago / 1

    I love that they mention the most common question is about how it hooks up, but NEVER TELL HOW TO HOOK IT UP!

    • denbo68 / about 8 years ago / 1

      You need to buy a breakout board. Sparkfun made ones will have a variety to chose from but right now they are mostly on pre-order. There are two Intel break out boards you could get today: the Arduino breakout board and the Mini breakout board. I bought the Arduino breakout board from Makershed and the mini breakout board from Mouser (though I just discovered it is still on backorder).

      If you don't have the Edison yet then order the whole thing from Makershed or Mouser. Mouser has the whole kit (break out with Edison) in stock.

  • kabram / about 8 years ago / 1

    Anyone know if Edison supports Rust?

    • Member #595100 / about 8 years ago / 1

      Do you mean use Rust on the board? Or run a program compiled by Rust?

  • denbo68 / about 8 years ago / 1

    I've set up the Eclipse environment under Windows 7 and it works but there are issues. In particular the remote debugging. It started out alright but now it refuses to show me any variable values and often times it just simply refuses to allow me to step through the code. Not at the board at the moment so can't remember the error it returns.

Related Posts

Recent Posts

Essential Sensors

Meet Mariah!


All Tags