Setup the Boltduino 2
Make your Arduino Projects IoT ready. Make them on Boltduino.
The Boltduino can be used in the same manner as the Arduino, without any extra setup.
This setup procedure is required to use the Boltduino as a Boltduino. This page details how to set up the Arduino IDE to allow you to wirelessly update the firmware on the Boltduino using the Bolt Cloud. The process of updating the firmware of a device over the Internet is called OTA update (short for Over The Air update).
We have also included steps to set up the BoltIoT-Arduino-Helper library, which will make it easier to build IoT ready projects on the Boltduino using the Bolt.
Prerequisite
- Internet connection with 256kBps speed or better.
- A computer with 32 bit/64 bit Windows, Linux (Ubuntu preferred) or Mac os. Arm based computers are not supported.
- Arduino IDE 1.8.4 or later. Click here to get the latest Arduino IDE.
- Bolt Cloud account.
- Bolt unit with Firmware version 1.2.0 or higher. Click here to find out how to update your Bolt unit Firmware.
- Boltduino with power supply.
Development Environment Setup
- Open Arduino IDE
- Go to Arduino>Preferences on mac, and File>Preferences on Windows and Linux.
- Copy the following link and paste it into the Additional Boards Manager URLs field, and click on Ok.
http://boltiot.com/public/Boltduino/package_boltiot_index.json
- Navigate to Tools>Boards: "Arduino/Genuino Uno">Boards Manager.
- Wait for the Boards manager to download the package lists.
- Type in BoltIoT in the search box. The search box is not case sensitive.
- Click on the BoltIoT AVR Boards by BoltIoT in the list. An 'install' button will show up. Click the 'install' button.
- Once the installation is complete click on close
- Go to Tools>Boards: "<Arduino/Genuino Uno>" and select Boltduino.
Your Development Environment Setup is now complete.
Setup Global API_KEY and DEVICE_ID (Optional)
The following steps help you specify a global API_KEY and DEVICE_ID which you can use with all your Boltduino projects, by just including the file 'BoltDeviceCredentials.h' in your code in the following manner.
#include <BoltDeviceCredentials.h>
- Download the BoltIoT-Arduino-Helper library by clicking here.
NOTE: Click yes if your browser asks whether you want to save the file.
- Go to the Arduino IDE, navigate to "Sketch>Include Library>Add .ZIP Library"
- In the popup, navigate to the zip file you downloaded earlier, and click the 'Choose' button.
- Now, go to "~/Documents/Arduino/libraries/boltiot-arduino-helper-master/src" folder ("My Documents/Arduino/libraries/boltiot-arduino-helper-master/src" folder for Windows).
NOTE: You can use any text editor you are comfortable with. We will be using sublime text.
- open the file 'BoltDeviceCredentials.h' in a text editor.
- Get your API Key from the API tab on the Cloud dashboard by clicking here. View the image below to copy the API key.
- Get the device id from the Devices tab on the Cloud dashboard, by clicking here.
- Uncomment the API_KEY and DEVICE_ID macros and add the data you copied in the earlier steps for the macros as shown in the images.
- Save the file (In the menus file>save) and close the text editor.
The Global API key and Device ID has not been set up for OTA update.
Hardware Setup
- Connect the Bolt unit to the Boltduino.
- Power up the Boltduino using any one of the following methods.
- If you have not already done so, configure your Bolt unit to connect to the Bolt Cloud. Click here for instructions on how to connect the Bolt unit to the Bolt Cloud.
The Hardware setup is not complete.
Usage
- Write your Arduino code. For this example, we will use the blink code from examples>01.Basic>Blink
- If you did not set up the global API_KEY and DEVICE_ID, you can add a local API_KEY and DEVICE_ID to the code by using the following code.
#define API_KEY "xxxxxx-xxxx-xxxx-xxxxxx"
#define DEVICE_ID "BOLTxxxxxxxx"
NOTE : IF you do not set up the global API_KEY and DEVICE_ID, you will have to set up a local API_KEY and DEVICE_ID for each of your Arduino Codes
- If you have defined the global API_KEY and DEVICE_ID, include the following code into the Arduino code to use it
#include <BoltDeviceCredentials.h>
- Verify the code by clicking on the verify button (Tick mark) as highlighted in the image.
- Click on Upload button (Right arrow) as highlighted in the image below.
IMPORTANT: Before uploading, ensure that the Bolt unit is mounted on the Boltduino, the Boltduino is powered up, and the Bolt unit is connected to the Bolt Cloud.
- Wait for the code to be uploaded to the Boltduino. The speed of upload depends on the size of the code, and the speed of your internet connection. It generally takes between 2 to 20 seconds to upload the code.
- Enjoy the convenience of wirelessly reprogramming your Boltduino from anywhere in the world.
Kickstarter Campaign.
We are launching the Boltduino on Kickstarter soon. Click here to check out our campaign.
Updated 4 days ago