Access your Arduino CC3000 from the Web

Make your Arduino accessible from anywhere via the Yaler relay.

Prerequisites

Setting up your device requires a relay domain. Please sign up to get one.

Setting up the hardware

This tutorial works with any Arduino setup supporting the Adafruit CC3000 library, e.g. the Adafruit or SparkFun breakout.

Using another setup? See how to access your Arduino WiFi, the Arduino WiFi101, the Arduino Ethernet or the Arduino Yún.

Installing the library

Follow these steps to add the Yaler_CC3000_Server library to your Arduino IDE.

  1. Download the library
    Yaler_CC3000_Server.zip
  2. On Windows extract the ZIP to
    C:\Users\USER_NAME\Documents\Arduino\Libraries\Yaler_CC3000_Server
    On Mac OS X extract the ZIP to
    ~/Documents/Arduino/libraries/Yaler_CC3000_Server
  3. Close and re-open your Arduino IDE.

Trying a quick example

  1. Open the Arduino IDE and select the menu
    File > Examples > Yaler_CC3000_Server > YalerWebService
  2. Replace RELAY_DOMAIN with your relay domain, e.g. for the relay domain gsiot-ffmq-ttd5 that would be
    Yaler_CC3000_Server server("try.yaler.io", 80, "gsiot-ffmq-ttd5");
  3. Upload the example code to your Arduino
  4. Done. Now, see how to access your device from a Web browser or with Curl (and resolve errors).

Converting an existing Web service

How to adapt an existing Arduino Web service to make it accessible from the Web.

  1. Add the line
    #include <Yaler_CC3000_Server.h>
  2. Replace the line
    Adafruit_CC3000_Server server(80);
    
    with the line
    Yaler_CC3000_Server server("try.yaler.io", 80, "RELAY_DOMAIN"); // Use YOUR relay domain
  3. Those changes together look something like this (all else remains the same)
    #include <Adafruit_CC3000.h>
    #include <Yaler_CC3000_Server.h>
    ...
    
    //Adafruit_CC3000_Server server(80);
    Yaler_CC3000_Server server("try.yaler.io", 80, "RELAY_DOMAIN"); // Use YOUR relay domain
    
    void setup() {
      ...
    }
    
    void loop() {
      ...
    }
  4. Done. Now, access your device from a Web browser or with Curl or from iOS or from Android (and resolve errors).

This library is still in beta. Found a bug or design issue? Let us know.


Creative Commons License This work by Yaler GmbH is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.