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:
- Set up the Plugin
Sign in to your Arduino Create account and verify the web editor plugin installation on your host computer. - Connect to your target platform
Use SSH to let Arduino Create access your device, or manually enter the setup commands. - 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
- 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.
- 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
- 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.
- 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
- 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:
Creating your first project
-
If it's not open already, open the Arduino Web Editor.
-
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.
-
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*
- Choose your board, "via Cloud".
- 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.
- 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.
- 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:
- Initialize in the setup() method, using a baud of 115200:
DebugSerial.begin(115200);
- To print messages from the board, use either:
DebugSerial.println("message");
- Or:
DebugSerial.print("message);
- 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
- 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.
- 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.
- 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.
- 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.
- On the Secret Tab, provide the required secret information for your AWS IoT account.
- 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
- 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.
- Expand the Examples category to see example projects using this library. For this example, click ClientMqtt to open the example project. The sketch opens.
- 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.
- 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.
- On the Secret Tab, provide the required secret information for your Microsoft Azure account.
- 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.
-
In the web editor, open the sketch you want to export.
-
Next to the board selection drop-down list, click the menu icon (...). From the menu, select Export CMake file.
-
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*
- If it isn't already, connect your target platform to its power supply and turn it on.
- On your host computer, go to https://create-intel.arduino.cc/. Click Getting Started.
- Click Set up a generic Intel® IoT Platform.
- 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
- Click I'm unsure if an OS is currently installed.
- 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.
- When finished, click Next to continue with the setup.
- 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.
- 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.
- 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.
- 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.
- When instructed, remove the USB drive from your target platform.
Arduino Create will automatically try to connect to your target platform.
- 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.
- 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:
- Take a bootable USB drive with the Ubuntu OS image on it and plug it in to a USB port on the target platform.
- Connect your target platform to power and turn it on.
- 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.