Improve this doc

Getting Started with the Intel Edison

What you will need

Note: If you're not experienced with git, check out the excellent Try Git course at Code School.

If you already have a resin.io account and just want to get started with an Edison then skip ahead to Creating Your First Application.

Signing Up

Enter your details on the sign up page. There are a couple of restrictions:-

  • The username can only contain letters and numbers.
  • The password has to be at least 8 characters long.

SSH Key

SSH keys use the power of public-key cryptography to secure your connection when sending your code to us. In order to secure your git connection, we need your public SSH Key (you must never share your private key with anyone.)

Once generated, SSH keys are easy to use. In fact you generally don't have to think about it at all, once you're set up just git push your code to us and it's taken care of automatically.

In order to generate a key pair for your platform we recommend you take a look at Github's excellent documentation on the subject.

Import From GitHub

For convenience we provide the ability to import your public SSH key from GitHub - just click on the Octocat icon in the bottom right-hand corner (we use GitHub's public APIs to retrieve this data.)

You will then have to enter your github username:

Start a new application

The two key components you will interact with in resin.io are applications and devices - applications represent the code you want to run on your devices, and devices the actual hardware itself.

You can have as many devices connected to an application as you like - when you push code it deploys to every device that application owns.

Okay, lets get started...

First things first, we need to start a new resin.io application. Choose a fancy name for your new Intel Edison project. In this example, we were super creative and called it myFleet.

Next make sure you select Intel Edison from the device type drop down menu and click the big yellow create button. You should now be magically redirected to your new creatively named myFleet and will see a couple of tabs and a notice saying "No devices are connected to this application", that isn't very exciting, so lets change that by adding a new device...

To connect a device to our newly created application, we need to first get the resinOS on the device. This involves downloading the new device image, burning it onto the device memory.

Adding Your First Edison Device

Download Resin OS Image

To get the resin operating system (resinOS) you need to click on the "Download Device OS" button. You should then be directed to add your wifi network name (aka SSID) and your networks password (aka passphrase) .

Note: It is not possible to provision an Edison without adding your wifi credentials as the device needs this to connect to the internet.

Once the download completes, you should have a .zip file in your downloads folder with a name that looks something like this: resin-myFleet-0.1.0-0.0.14.zip. Use an unzipping utility like 7-zip to extract the download to a folder.

Burn the Resin OS onto the Edison

In order to use resin to deploy code on the Edison it is necessary to flash new firmware (the resin OS) onto the device.

Note: This will erase your current yocto OS system on your Edison and any data or configurations you have on it, but trust us, it's for the best ;) If for some terrible reason you have to revert to the old way of doing things, you can restore your Edison to it's factory default firmware by following the instructions in our restore original Edison firmware guide.

There are two ways of burning the firmware to the Edison.

Install Intel Flash Tool Lite

First you will need the firmware flashing tool provided by Intel. So head over to this link and get it set up on your computer.

Warning: There is a known issue with the flash tool and OSX 10.11 - El Captitan, so we recommend using the flashall scripts and dfu-util to flash the OS in this case.

Flash the Resin Firmware onto the Edison

Note: Before you start this step, ensure that your Edison is not plugged into your Computer.

On your computer open the newly installed Flash Tool Lite. Select the blue browse button in the top right hand corner and browse to the folder where you had previously extracted the resin OS. This folder should be called something like resin-myFleet-0.1.0-0.0.14. In this folder you should be able to find and select a file called FlashEdison.json.

browse to resin OS folder

The flash tool will auto-detect the configurations for flashing, so you do not need to adjust any of the drop down menus. Your flash tool panel should look something like this:

flash tool configurations

Once you are satisfied you have selected the correct FlashEdison.json file from the correct folder, you can click the Start to Flash button in the bottom left of the flash tool. The flash tool will now try and detect if the Edison is plugged in.

At this point, plug your Edison into your computer using the micro usb cable.

Note: It is important that your Edison is connected via the OTG-USB port on the base board. If you are unsure of which micro usb port this is, have a look at this image.

Edison Boards with OTG

Once your Edison is connected to the computer, the flash tool should auto-detect it. A device will appear in the central pane of the flash tool and you should see the progress of your Edison Firmware flashing.

Edison flash progress

Note: If you get stuck at this point or your device never shows up on the resin dashboard, please let us know over here or over at forums.resin.io.

Once your Edison has reached 100% on the progress bar, the flashing process has completed, but the device still needs to reboot. Let your Edison sit for about 2 minutes.

After a successful firmware flash, you may get a warning pop-up. You can safely click ignore.

Edison reboot warning

Check your Resin.io Dashboard

After about a couple of minutes your freshly provisioned Edison should show up online on your dashboard. We can now start pushing code to this little chap using git.

So lets get on it!!!

Running Code On Your Device

git pushing

A good little project to get you started is the led blink example written in node.js. It will allow you to blink the onboard led on the Intel Edison Arduino base board. To clone it, run the following in a terminal:-

$ git clone https://github.com/shaunmulligan/edison-blink-node.git

Once the repo is cloned, change directory into the newly created edison-blink-node directory and add the resin git endpoint by running the git remote add command shown in the top-right corner of the application page:

$ cd edison-blink-node
$ git remote add resin <USERNAME>@git.resin.io:<USERNAME>/<APPNAME>.git

Now you can simply run git push resin master and push code to that remote, where it will get built and packaged. Then the final packaged up container will get downloaded to the Edison.

You'll know your code has been successfully built and uploaded to our build server when you see our friendly unicorn mascot:-

git pushing

Once the code has built and uploaded, you should see the status of your Edison on the resin dashboard change from Idle to Downloading. It should take a few minutes for the first update to download. Don't worry the first push is always the hardest. After the device has finished updating, you should see a happily blinking green led on your board.

Note: Only the Intel Edison Arduino base board has a built in Led, for other boards you will need to connect up an external Led to mraa pin 13.

At this point you should have an Edison that you can remotely update.. Woohoo!!

If node.js isn't your thing, then don't worry, you can use any language you like. Have a look at how to use Dockerfiles and play around with our python example over here to get your feet wet.

Further Reading

Feedback

If you find any issues with the application, please let us know over here or over at forums.resin.io. We are always open to feedback and respond to any issues as soon as we can.

Alternative Method of Flashing Edison firmware

Note: These methods are not recommended as there are peculiarities and instances where they are unreliable. We strongly recommend using the Intel Flash Tool Lite.

install dfu-util

In order to put the new resinOS firmware on the Edison we need a special tool called dfu-util. This is basically a utility to download and upload firmware to/from devices connected over USB.

dfu-util on Mac OSX

For this step you will need MacPorts to install dfu-util, coreutils, and gnu-getopt

sudo port install dfu-util gnu-getopt coreutils

Note: DO NOT install DFU-util with Homebrew as there is a known issue with the DFU-util version which Homebrew installs.

dfu-util on Windows

Note: the dfu-util is bundled with the resinOS download, but you will still need to install the drivers for the Edison.

If you have not previously installed Intel’s Edison drivers for Windows, you will need to do that first.

  • Navigate to https://communities.intel.com/docs/DOC-23242
  • Scroll down and download the “Windows Driver setup” file
  • Double-click on the downloaded .exe and follow the command prompts (accepting all defaults) to install the drivers
dfu-util on Linux

Simply install using apt-get: sudo apt-get install dfu-util

Flashing the OS to the device

Before starting the flashing process, make sure you unplug the Edison from your computer.

Using Mac OSX

Extract the .zip and from your terminal cd into the into the newly extracted folder cd resin-myFleet-0.1.0-0.0.9 Run the flashall script. sudo ./flashall.sh You should see an output like this:

Using U-Boot target: edison-defaultcdc
Now waiting for dfu device 8087:0a99
Please plug and reboot the board

At this point you can connect your Edison to your computer.

Note: Make sure you connect it to the USB-OTG port and NOT the USB-CONSOLE port.

You should now see the flashing process happen and output something like this:

dfu-util: Device has DFU interface, but has no DFU functional descriptor
Flashing IFWI
dfu-util: Device has DFU interface, but has no DFU functional descriptor
Download    [=========================] 100%      4194304 bytes
Flashing U-Boot
Download    [=========================] 100%       245760 bytes
Flashing U-Boot Environment
Download    [=========================] 100%        65536 bytes
Flashing U-Boot Environment Backup
Download    [=========================] 100%        65536 bytes
Rebooting to apply partition changes
Now waiting for dfu device 8087:0a99
dfu-util: Device has DFU interface, but has no DFU functional descriptor
Flashing boot partition (kernel)
Flashing data_disk, (it can take up to 5 minutes... Please be patient)
Flashing rootfs, (it can take up to 5 minutes... Please be patient)
Rebooting
U-boot & Kernel System Flash Success...
Using Windows

Before starting the flashing process, make sure you unplug the Edison from your computer.

Unzip the resin-myFleet-0.1.0-0.0.9.zip file that you downloaded and open the folder. In the folder, find the flashall.bat file and double-click it.

Note: You need administrative privileges to successfully execute flashall.bat.

You should now see the following:

Using U-Boot target: edison-defaultcdc
Now waiting for dfu device 8087:0a99
Please plug and reboot the board

At this point you can connect your Edison to your computer.

Note: Make sure you connect it to the USB-OTG port and NOT the USB-CONSOLE port.

You should now see the flashing process happen and outout something like this:

dfu-util: Device has DFU interface, but has no DFU functional descriptor
Flashing IFWI
dfu-util: Device has DFU interface, but has no DFU functional descriptor
Download    [=========================] 100%      4194304 bytes
Flashing U-Boot
Download    [=========================] 100%       245760 bytes
Flashing U-Boot Environment
Download    [=========================] 100%        65536 bytes
Flashing U-Boot Environment Backup
Download    [=========================] 100%        65536 bytes
Rebooting to apply partition changes
Now waiting for dfu device 8087:0a99
dfu-util: Device has DFU interface, but has no DFU functional descriptor
Flashing boot partition (kernel)
Flashing data_disk, (it can take up to 5 minutes... Please be patient)
Flashing rootfs, (it can take up to 5 minutes... Please be patient)
Rebooting
U-boot & Kernel System Flash Success...
Using Linux

Before starting the flashing process, make sure you unplug the Edison from your computer.

Extract the previously downloaded .zip file , open a terminal and cd into the newly created folder. cd resin-myFleet-0.1.0-0.0.9 From there execute the flashall script buy running sudo ./flashall.sh You should now see the following output in your terminal:

Using U-Boot target: edison-defaultcdc
Now waiting for dfu device 8087:0a99
Please plug and reboot the board

At this point plug your Edison into the USB port of your computer.

Note: Make sure you connect it to the USB-OTG port and NOT the USB-CONSOLE port.

Once your computer detects the Edison you should see the flashing process happen and the following output:

Using U-Boot target: edison-default
Now waiting for dfu device 8087:0a99
Please plug and reboot the board
Flashing IFWI
##################################################] finished!
##################################################] finished!
Flashing U-Boot
##################################################] finished!
Flashing U-Boot Environment
##################################################] finished!
Flashing U-Boot Environment Backup
#########################################] finished!
Flashing boot partition (kernel)
##################################################] finished!
Flashing rootfs, (it can take up to 5 minutes... Please be patient)
##################################################] finished!
Rebooting
U-boot & Kernel System Flash Success...

Leave your Edison plug in to your computer. It can take a while to completely flash the OS and dfu-util gives very little feedback.

Once you have burned the new firmware with this method you can carry on from the Check your dashboard step.