Click here to Skip to main content
13,260,181 members (46,560 online)
Click here to Skip to main content
Add your own
alternative version

Stats

2.4K views
Posted 10 Nov 2017

Getting Started with Arduino Create for Intel-based Platforms

, 10 Nov 2017
This document contains steps to get started programming and working with IoT projects using the Arduino Create Web Editor.

Editorial Note

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.

This document contains steps to get started programming and working with IoT projects using the Arduino Create* Web Editor. The steps in this guide focus on Intel®-based target platforms, including:

  • Intel® IoT Gateways
  • Any Intel-based x86 64-bit computer with a Intel® Core™, Intel Atom®, or Intel® Xeon® processor. This computer should be running Ubuntu* 16.04

For steps to get started with an UP²* Grove IoT Development Kit, see https://software.intel.com/en-us/upsquared-grove-getting-started-guide.

In this guide you’ll go through the following steps to connect your board to Arduino Create and begin developing code:

You’ll walk through the following basic steps:

  1. Set up the Plugin
    Sign in to your Arduino Create account and verify the web editor plugin installation on your host computer.
  2. Connect to your target platform
    Use SSH to let Arduino Create access your device, or manually enter the setup commands.
  3. Create your first project
    Run a sample application to open the serial terminal and see your messages returned as bytes.

Before you begin

You’ll need the following to complete this guide:

  • Target platform running Ubuntu 16.04

    Note: If you want to install an operating system on your target platform, you'll need a bootable USB drive containing the OS you want to install. A USB drive with 4-8 GB should be sufficient.

    You can let Arduino Create help you install the OS, or do it yourself. If you would like to install the OS image as part of this setup process, you’ll get to a point later on where you can make that choice, so keep your USB drive handy. If you'd like to install the OS yourself, you'll need to download the image from the appropriate location listed below, then write the image to your USB drive using your file writing program of choice:

  • A host computer with an internet connection and web browser. Arduino recommends the Chrome* browser, but you can also use Mozilla Firefox*, Apple Safari*, and Microsoft Edge*.

Step 1: Set up the Plugin

In this step, you will:

  • Install the Arduino plugin on your host computer
  • Verify the plugin installation

Set up the Plugin

  1. On your host computer, go to https://create.arduino.cc/getting-started/plugin. If this is your first time using Arduino Create, you’ll be asked to install the Arduino plugin. Follow the onscreen instructions to install the plugin.

  2. Once you receive a message that the plugin was installed correctly, you’re ready for the next step.

Note: If you get an error message saying "We are not able to detect the installed plugin", try locating the Arduino Plugin icon in your system tray, right-click, then select Open plugin. If you’re still having issues trying posting on the forum https://forum.arduino.cc/index.php?board=101.0

Step 2: Connect to your Target Platform

In this step, you will:

  • Sign up for Arduino Create*
  • Upload the Arduino connector to your board
  • Name your board

Configure the UP2* Board

  1. On your host computer, go to https://create.arduino.cc/getting-started/intel-platforms.

    Note: If you don’t already have an Arduino Create account, follow the onscreen instructions to sign up. You'll need to activate your account and log into the site using your new account.

  2. In order to connect to your target platform, select one of the following:
  • A: I KNOW THE IP ADDRESS OF MY DEVICE To connect using your target platform's IP address, select Option A, and type the IP address of your target platform in the IP field. If you don't know the IP address, you can use a tool like Angry IP Scanner* to find it.

    Click Next, then continue to provide any login or device name information.

    Note: for Option A to work, both your host computer and your target platform need to be on the same network because Arduino Create is using SSH to login to your target platform from your host in order to configure the Arduino Connector. Make sure that OpenSSH* server is also installed, if you haven't already. You can do this from the command line using:

    sudo apt-get install openssh-server

    Once it is installed, the SSH server should start automatically.

  • B: I HAVE A SCREEN AND KEYBOARD AVAILABLE If you don't know the IP address but do have a monitor, USB mouse, and USB keyboard to attach to your target platform, connect these peripherals to the target platform and select Option B.

    On your target platform, access the command line or open a Terminal window and enter each of the commands provided by Arduino Create. This installs an Arduino connector on your target platform.

    Note: For Option B to work, your host and device do not need to be on the same network.

    When finished running the commands, return to the Arduino Create interface and click Next.

Name your board

  1. Give your board a name, such as up2.

Now you’re ready for the next step, running your first program.

Note: Your board connects to the Arduino Create development environment over the Internet. If you disconnect your board and move it to another location, it should reconnect to the Arduino Create environment. If you are using proxy settings, you will need to go through this setup process again if move your board to a network that doesn’t have a proxy.

Step 3: Creating your First Project

In this step you will:

  • Learn how to set up a serial monitor, which uses built-in functions to set up and transmit data over a serial connection

Creating your first project

  1. If it's not open already, open the Arduino Web Editor.

  2. Open the DebugSerial sketch included in the UP Squared Grove IoT Development Kit examples. You can find it in Examples > FROM LIBRARIES > UP SQUARED GROVE IOT DEV KIT > Serial > DebugSerial.

    Note: While you may have a different board than what’s in the UP Squared Grove IoT Development kit, all of the examples created for that kit will work, with the exception of the GroveLCD and GroveRotaryAngle.

  3. Before you upload the example sketch to your board, make sure to open the Monitor in Arduino Create. The Monitor in Arduino Create can be used to receive or send messages to and from your board.

Upload your Sketch Using Arduino Create*

  1. Choose your board, "via Cloud".

  2. Click the Upload icon to upload and run the sketch.

Note: When you click Upload button , you're uploading and running the sketch on your target device. To compile your sketch without uploading and running it, click the Verify button to the left of the Upload icon.

Your sketch is running!

You can confirm that your sketch is running because the log at the bottom of the screen gives you a Process ID (PID). For example:

Congratulations, you've compiled and built your first sketch!

If you enter hello into the Monitor after uploading the sketch, you will see the following:

Stopping and Starting Sketches

Now that your sketch is running, we’ll show you how to stop it.

  1. Go to the My Devices page by clicking the menu icon in the upper left and clicking My Devices. Alternatively, you can go to https://create.arduino.cc/devices.
  2. Click ‘1 SKETCHES RUNNING’.

You should now see the name of the sketch that you ran to blink the LED, for example ‘Blink’. Click on ‘RUNNING’.

You should now see ‘STOPPED’.

You are not limited to running one sketch at a time and can run multiple sketches, given they don’t conflict with each other.

How it works

The DebugSerial method behaves like Serial https://www.arduino.cc/en/Reference/Serial. In general, here is how to use it:

  1. Initialize in the setup() method, using a baud of 115200:

    DebugSerial.begin(115200);

  2. To print messages from the board, use either:

    DebugSerial.println("message");

  3. Or:

    DebugSerial.print("message);

  4. To listen to messages:

    DebugSerial.read()

Next Steps

Visit the Projects and Tutorials section to see examples of computer vision, cloud connectivity, as well as other useful functions, like making system calls from within your code.

Connecting to Amazon Web Services

This section contains steps to get started with the AWS IoT* Device SDK library examples in the Web Editor. These examples demonstrate how you can connect and send data to Amazon Web Services* using a sketch in Arduino Create*.

Requirement

  • Your target platform should already be set up and connected to Arduino Create.
  • You have an AWS IoT account and have:
    • Registered your IoT device (target platform) as a Thing
    • Created and activated a device certificate for your Thing
    • Created and attached an AWS IoT Policy to the device certificate
    • Attached the device certificate to your Thing.
  • You'll also need to know any secret information needed to connect to AWS IoT: the endpoint, root CA, client certificate, and client key, as described in the steps below. All of the steps required to set up your AWS IoT account, Thing, and find the secret information are covered in the Getting Started with AWS IoT guide.

Using the examples in the AWS IoT* Device SDK library

  1. To view the libraries, click Libraries in the left-hand side of the editor. On the Default tab, find the AWS IoT Device SDK entry.

  2. Expand the Examples category to see example projects using this library. For this example, click PubSub to open the example project. This project sends data from your target platform to AWS IoT, which you will then be able to view in your AWS IoT dashboard. The sketch opens.


     
  3. To save your own copy of the PubSub example to your own Arduino Create sketchbook, make a minor change to the code and save it.

  4. Before you can communicate with AWS IoT, you'll need to provide any secret information -- this includes endpoint information, client key, and more. Click the Secret tab.
  5. On the Secret Tab, provide the required secret information for your AWS IoT account.

  6. Verify your code and Upload it to your Intel® IoT Platform as you would with any other Arduino sketch.



    Once your project is running, you can visit your dashboard in AWS IoT to see the data you sent!

Connecting to Microsoft Azure*

This section contains steps to get started with the IoT Device SDK library examples for Microsoft Azure*. These examples demonstrate how you can connect and send data to Microsoft Azure using a sketch in Arduino Create*.

Requirement

  • Your target platform should already be set up and connected to Arduino Create.
  • You have a Microsoft Azure account.
  • You'll also need to know any secret information needed to connect toMicrosoft Azure: the endpoint, root CA, client certificate, and client key, as described in the steps below.

Using the examples in the Azure IoT Device SDK library

  1. To view the libraries, click Libraries in the left-hand side of the editor. On the Default tab, find the Azure IoT Device SDK entry.

  2. Expand the Examples category to see example projects using this library. For this example, click ClientMqtt to open the example project. The sketch opens.

  3. To save your own copy of the ClientMqtt example to your own Arduino Create sketchbook, make a minor change to the code and save it.

  4. Before you can communicate with Microsoft Azure, you'll need to provide any secret information -- this includes endpoint information, client key, and more. Click the Secret tab.
  5. On the Secret Tab, provide the required secret information for your Microsoft Azure account.

  6. Verify your code and Upload it to your Intel® IoT Platform as you would with any other Arduino sketch.



    Once your project is running, you can visit your dashboard in Microsoft Azure to see the data you sent!

Working with Libraries in Arduino Create

The Arduino Create* Web Editor comes with a host of libraries. You can take advantage of library functions in your sketches. For information on using Intel-created libraries, see Using Intel® Libraries in Arduino Create*.

To view the libraries, click Libraries in the left-hand side of the editor.

The default libraries are listed on the Default tab. You can click More info next to a library to view the documentation for each library.

Hovering over a library name lets you click the Include button, which adds a reference to the library in your currently open sketch.

Additionally, many libraries have code examples included. Expand the Examples category and click the name of a sample project to open it.

Exporting Projects to Intel® System Studio

You can export a project you create in Arduino Create* as a CMake file, then import that file into Intel® System Studio for further development work.

  1. In the web editor, open the sketch you want to export.

  2. Next to the board selection drop-down list, click the menu icon (...). From the menu, select Export CMake file.

  3. Your sketch is exported as a .zip file, as shown below.

Next Steps

For steps to import your sketch into Intel System Studio, see Transfer Your Project from Arduino Create* to Intel® System Studio 2018 Beta.

Viewing your Devices

You can view a list of your connected devices at any time from the Arduino Create Web Editor. Click the nine-dot menu icon in the top left corner, then select My Devices. Here, you can see a list of each of your devices, their status, and whether they currently have a sketch running.

Installing an OS with Arduino Create*

This section contains steps to install an OS on your target platform using Arduino Create*.

Connecting to your device using Arduino Create*

  1. If it isn't already, connect your target platform to its power supply and turn it on.
  2. On your host computer, go to https://create-intel.arduino.cc/. Click Getting Started.


     
  3. Click Set up a generic Intel® IoT Platform.


     
  4. A notice reminding you to have your target platform powered and connected to the Internet via Ethernet cable is displayed. Click My Device is Ready.

Installing the OS

  1. Click I'm unsure if an OS is currently installed.

  2. Enter a new user name and password to use to log in to your target platform.



    If you need to specify proxy settings, click Set it up here and provide any required proxy information. Click Done.

  3. When finished, click Next to continue with the setup.
  4. Select Ubuntu to install on your target platform, then click Download OS. The OS image, arduino-connector.img, is downloaded to your host computer.

    Note that the OSes available for installation may be different based on which platform you're setting up. The UP²* board, for instance, has different options.

  5. Next, make sure you have your USB drive connected to your host computer. Follow the onscreen instructions to download Etcher, and use it to flash the OS image onto your USB drive. When finished, click Next in Arduino Create.


     
  6. Plug the USB drive in to your target platform. Reboot the target platform from the USB drive. Click Next.

    On your target platform, you may need to manually select the USB drive to boot from (for example, during the boot process, you can press F10 for the Intel® NUC to bring up the boot menu). On the monitor connected to your target platform, be sure to select the option to run the Arduino OS Installer, if it is displayed.


  7. As the operating system is installed on your target platform, progress messages are displayed in Arduino Create. Wait several minutes until instructed to remove the USB drive from your target platform. The installation process may take as long as 30 minutes.

  8. When instructed, remove the USB drive from your target platform.



    Arduino Create will automatically try to connect to your target platform.

  1. If and when prompted, set up a new username and password to use to log in to your target platform. If you need to specify proxy settings, click Advanced and provide any required proxy information.



  2. Click Done. If you are successful in connecting to your target platform, you will be prompted to provide a Device Name for your target platform. Click Save.

Congratulations, you have connected to your target platform!

Installing Ubuntu*

This section contains steps to install Ubuntu* 16.04 LTS on your target platform and ensure you have any required dependencies.

Requirements

  • You should have your target platform connected to a monitor, USB mouse, and USB keyboard.
  • Connect your target platform to your router using an Ethernet cable.
  • You should have a bootable USB drive with the Ubuntu OS image on it:

Installing Ubuntu

  1. Take a bootable USB drive with the Ubuntu OS image on it and plug it in to a USB port on the target platform.
  2. Connect your target platform to power and turn it on.
  3. Install your OS as follows:
  • On your target platform, open a Terminal window or access the command line.
  • To find the IP address of your target platform, enter the command:

    ifconfig

    Make a note of this IP address for later, as you'll use it to connect Arduino Create to your target platform.

  • Next, you'll need to be sure to have an SSH server available listening on the standard 22 port. This is so Arduino Create can connect to your target platform. To install openssh-server, enter the command:

    sudo apt-get install openssh-server

If your network uses a proxy server, you'll need to specify your proxy settings before you can install openssh-server. You can specify your proxy settings by using the export command. For example:

export http_proxy=http://www.proxyaddress.com:123
export https_proxy=http://www.proxyaddress.com:234
export ftp_proxy=http://www.proxyaddress.com:123
export socks_proxy=http://www.proxyaddress.com:1234
export no_proxy=proxyaddress.com,.proxyaddress.com,localhost,127.0.0.1

Be sure to provide your own network's proxy information.

If you try to run sudo apt-get install openssh-server and get only a "0% [Connecting to us.archive.ubuntu.com" message, you may need to provide proxy settings in the /etc/apt/apt.conf file. Create or modify the /etc/apt/apt.conf file to add a line like the following, supplying your own proxy address and port number:

Aquire::http::Proxy "http://www.proxyaddress.com:portnumber";

Congratulations! You've powered your target platform and installed Ubuntu.

Get Help

Help tutorials, links, and more are available from the Arduino Create menu bar. Click Help to access these resources.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Intel Corporation
United States United States
You may know us for our processors. But we do so much more. Intel invents at the boundaries of technology to make amazing experiences possible for business and society, and for every person on Earth.

Harnessing the capability of the cloud, the ubiquity of the Internet of Things, the latest advances in memory and programmable solutions, and the promise of always-on 5G connectivity, Intel is disrupting industries and solving global challenges. Leading on policy, diversity, inclusion, education and sustainability, we create value for our stockholders, customers and society.
Group type: Organisation

44 members


You may also be interested in...

Pro
Pro

Comments and Discussions

 
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171114.1 | Last Updated 10 Nov 2017
Article Copyright 2017 by Intel Corporation
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid