In this Instructable we demonstrate how to unbox an ADRC Shield and run the 'ledonoff' app that comes pre-installed on it. Your pack will contain one or more shields (depending on which one you ordered) and a hub. You should be aware that it does not contain an Arduino board. You will have to source one of these separately.
The ADRC Shield is one of the development boards available for the ADRC platform. This system has three main parts:
- The DeB app for your smartphone
- The shield (and library)
- The hub
The DeB app is currently available for Android and Linux. It is expected to be be available for iOS devices by September 2015.
The shield has two radios that serve different purposes. The first is an NFC (Near Field Communication) radio that makes it possible to tap your phone to it (must have NFC). This tap pairs the shield (and your project) to the hub so that it can be controlled from the phone. The second is an 802.15.4 radio which is similar to Bluetooth but is has longer range than Bluetooth and uses less power than Wi-Fi; so it is great for battery powered applications.
The hub translates between the Wi-Fi on your phone and the 802.15.4 radio on the shield. It also runs an advanced device server that makes the communications between multiple devices and the DeB phone app reliable. It also provides caching services to make network usage as efficient as possible. For advanced users, it provides a TCP/IP network interface that allows networked applications to be developed for it.
To make developing the Arduino code for communicating with the shield really easy, we developed an Arduino library that you can download. The library comes with a few example apps that demonstrate how to use it.
Developing a user interface for for your projects is done using the RML language which is a device description language based on XML. We developed the Equinox IDE that makes it easy to write, debug and test RML.You develop the RML using the IDE and once you are happy with it, you can upload the resulting RML file to the shield from the IDE. The file is sent over the radio and stored in the filesystem on the shield. Once this happens, the DeB app on the phone can control your project.
We are making another Instructable to help you to setup and use Equinox to modify a user interface.
Step 1: Parts List and Software Downloads
The parts list:
- ADRC Shield and Hub
- Arduino Uno/Due or compatible
- Ethernet cable and micro-USB cable
You will also need to have an NFC equipped Android smartphone with OS 4.2 or higher and a Wi-Fi router.
The downloads list:
- DeB app .apk file
- ADRC Shield library .zip file
- Equinox IDE (Linux and Windows)
The above downloads are available from the Xped website
Step 2: Setting Up the Hub
Setting up the ADRC Hub is easy. Simply connect the hub using the supplied USB cable to a power source.
Once this is done you will see the red power LED light up and the green light might blink for around minute whilst the hub is booting up for the first time. Subsequent booting will be faster.
Now connect the hub to your Wi-Fi router using the supplied Ethernet cable. Your router should have one or more Ethernet ports on the rear.
Normally that is all the set up required for the hub.
For advanced users:
The hub has a web based configuration page which you can get to using a web browser and typing the IP address of the hub into the address bar. Most Wi-Fi routers are setup for dynamic IP addressing using DHCP. In this case you need to be able to find out which IP address has been given to the hub. The hub advertises its services using Zero Configuration Networking AKA Bonjour or AVAHI.
You can use the Equinox IDE to find the address of the hub. When you start Equinox, it automatically finds the hub and displays the IP address in the lower statusbar.
On Android phones there is a Zeroconf browser app.
On Linux systems you can use AVAHI to find the address. There is a command line utility 'avahi-browse' and a Gnome utility that will show you the IP address and other information for the hub service named 'adrchub'.
On Windows systems there is a Bonjour client.
Step 3: Assemble the Arduino Hardware
Assemble the ADRC Shield on to the Arduino board.
You can now safely connect the Arduino to your computer using a USB cable. This will power up the Arduino and the ADRC Shield and you will see the green LED on the shield light up.
Step 4: Installing the DeB App on Your Phone
This step is for Android phones that have NFC. At the present time phones without NFC cannot be used.
The attached YouTube video explains how to install the DeB app from an .apk file.
At some point the DeB app will be available from the Google Play Store which will make this step easier.
Once you have DeB installed on your phone you need to:
- Turn on the Wi-Fi on your phone (Settings > Wi-Fi (switch to on))
- Connect to your Wi-Fi access point if you haven't already
- Turn on NFC (Settings > (More) > NFC (switch to on))
- Start up DeB
Once DeB starts it will automatically find the hub and display all the devices that are paired with it. If this is the first time you have done this, then there will be no paired devices and the DeB main screen will be empty.
Step 5: Pairing the Shield With the Hub
Now for the fun bit...
For this step to work you must first make sure that NFC is turned on on your phone. This is done from the phone Settings app.
For some unknown reason, phones do not show you where the NFC sweet spot is so you will have to find it by trial and error the first few times. Once you have found it, tapping is really easy. One way to find the NFC sweet spot is to gently rest the back cover of the phone on the hexagonal NFC antenna on the shield and then move it around slowly until you hear the tell-tale NFC sound.
With the DeB app running, tap and hold your phone on to the hexagonal NFC antenna on top of the shield. You will hear a sound and then the after about 1 second the proximity dialog will pop up. The proximity dialog will display information about the shield such as its manufacturer, model and type. Since this is the first time the shield has been used, the shield type will show as 'ADRC shield'.
On the the proximity dialog, you can change the nickname for the shield to be what you want. Once you have done this, then click the 'Add device' button and the Hub will pair with the shield. Once the is complete you will see a confirmation message.
Now click the 'back' button at the top right of the DeB status bar until you get back to the main screen. Here you will see an icon for the shield with the nickname you gave to it.
Step 6: Installing the 'ledonoff' App to the Arduino
In this step it is assumed that you are familiar with Arduino and how to develop code for it.
- Download the ADRC library .zip file from the Xped website
- Install the library as you would any other library
- Make sure the Arduino is connected to your computer via its USB cable
- Start the Arduino IDE
- The library is named ADRC
The library comes with a few examples. Use the IDE to open the 'ledonoff' example which is part of the ADRC library.
With the 'ledonoff' sketch open, compile it; you should not see any errors if the library was installed correctly.
IMPORTANT: for Arduino boards that only have one UART, such as the Uno, you have have to disconnect the ADRC Shield UART pins before you can download the program as they share the same UART as the Uno uses to connect to the computer via USB.
To disconnect the shield UART you use the row of switches on the shield [see above photo]. For the Uno the UART is on pins 0 and 1. So set the switches for these two pins to their center positions to disconnect them.
Now you can use the Arduino IDE to download the sketch to the Arduino board.
Once this is done, you need to set the switches back to their original positions which are pin-0 to RX and pin-1 to TX. The TX and RX positions are marked on the PCB to the right of the switches.
Step 7: Now It's Time to Have Fun!
Now that the 'ledonoff' code has been programmed into the Arduino you are ready to go.
On the phone, click the icon for the shield and you will see the user interface appear. There is only one toggle button which you use to turn the red LED on the shield on and off.
If you contact us we can add you our mailing list we will keep you up to date on new instructables and other documentation that will help you to create the best projects ever. Web contact
That's it... have fun!