Skip to content

00. Getting Started with Corstone for Arduino

Sandeep Mistry edited this page Mar 21, 2022 · 10 revisions

Requirements

Creating Arm Virtual Hardware (AVH) instance on AWS EC2

You can register for Free AWS EC2 CPU Credits to try out Arm Virtual Hardware on AWS.

  1. Open AWS Marketplace and search for Arm Virtual Hardware.
  2. Click on Arm Virtual Hardware to open the product page.

    GettingStarted-AWS-Marketplace

  3. Click the Continue to Subscribe button to activate the product.

    GettingStarted-Continue-to-Subscribe

  4. Read the Terms and Conditions.

    GettingStarted-Terms-and-Conditions

  5. If you agree with the Terms and Conditions, click the Accept Terms button.

    GettingStarted-Accept-Terms

  6. Click the Continue to Configuration button

    GettingStarted-Continure-to-Configuration

  7. Click the Continue to Launch button.
    1. Note: We recommend using at least a c5.large instance type.

      GettingStarted-Continue-to-Launch

  8. In the Key Pair Settings settings, select an existing or create a new key pair.
    1. Note: The EC2 key pair will be used late to securely access the AWS EC2 instance over SSH.
    2. Note: If you create and download a new key pair, you will have to make the file read-only using chmod 400 <path/your/pair/key.pem>
  9. Click the Launch button to start the EC2 instance.

    GettingStarted-Launch

Note: AWS will charge you by the hour while the EC2 instance is running. You can stop the EC2 instance by visiting the EC2 Console, selecting the instance, click the Instance State dropdown menu -> Stop instance menu entry.

Connecting to the AVH EC2 Instance

Using SSH

  1. Go to your EC2 Console to access the instance.
  2. Using the checkbox, select the EC2 instance you wish to access.

    GettingStarted-SelectInstance

  3. You can also give the instance a name by clicking the - and typing a name.

    GettingStarted-Name-Instance

  4. Then copy the "Public IPv4 DNS" value for the instance. This value will be used to SSH into the instance in the next step.

    GettingStared-Public-IPv4-DNS

  5. SSH into the instance from a terminal on your computer.
ssh  -i <path/your/pair/key.pem> ubuntu@<Public IPv4 DNS>
  • ubuntu is the username to use for the connection
  • <Public IPv4 DNS> is the value from the previous step
  • <path/your/pair/key.pem> is the path to key pair the EC2 instance was setup with.

Using SSH + VNC

  1. Go to your EC2 Console to access the instance.
  2. Using the checkbox, select the EC2 instance you wish to access.

    GettingStarted-SelectInstance

  3. Then copy the "Public IPv4 DNS" value for the instance. This value will be used to SSH into the instance in the next step.

    GettingStared-Public-IPv4-DNS

  4. SSH into the instance from a terminal on your computer
ssh  -i <path/your/pair/key.pem> -L 5901:localhost:5901 ubuntu@<Public IPv4 DNS>
  • ubuntu is the username to use for the connection
  • <Public IPv4 DNS> is the value from the previous step
  • <path/your/pair/key.pem> is the path to key pair the EC2 instance was setup with.
  1. Configure a VNC password using vncpasswd
    1. The "view-only password" does not need to be configured.
  2. Enable the VNC server: sudo systemctl enable [email protected]
  3. Start the VNC server: sudo systemctl start [email protected]
  4. Using a VNC client connect to localhost:5901
    1. Note: the VNC server on the AVH instance is accessed via an SSH tunnel.

Setting up "Corstone for Arduino" on the AVH Instance

  1. SSH into the AVH instance from a terminal on your computer
ssh  -i <path/your/pair/key.pem> -L 5901:localhost:5901 ubuntu@<Public IPv4 DNS>
  1. Run: git clone https://github.com/ArmDeveloperEcosystem/Corstone-for-Arduino.git
  2. Run: cd Corstone-for-Arduino
  3. Run: ./setup.sh to:
    1. Install the Arduino IDE
    2. Install the arduino-cli
    3. Download and compile the Open IoT SDK
    4. Configure Corstone for Arduino

Note: the previous step will take a few minutes to complete.

Examples

  1. Blink Virtual LED example
  2. Virtual Switch example
  3. NTP Client example
  4. TensorFlow Lite Hello World example

Additional Resources