Documentation
  • Quick Start Guide
  • Techspecs
  • Data Visualization
  • API Documentation
  • Interfacing Controllers
  • Python Library
  • Bolt App

Technical Specs






Parameters Details
Connectivity and Processing Module ESP8266 with custom firmware
MCU 32-bit RISC CPU: Tensilica Xtensa LX106
Power 5V/1A DC via Micro-USB port or 5V and GND pins
Operating Voltage 3.3V
CPU Clock Frequency 80 MHz
MCU Internal Memory 64 KB of instruction RAM; 96KB of data RAM
MCU External Memory 4 MB Flash memory [QSPI]
GPIO pins 5 Digital pins [3.3V logic]
ADC 1 pin 10 bit ADC [0-1V input]
PWM All 5 Digital pins capable of PWM [Software PWM]
Connectivity
WiFi 802.11 b/g/n
Automatic AP mode if not connected to WiFi
WEP/WPA/WPA2 authentication
UART 8-N-1 3.3V TTL UART [using TX, RX, GND pins]
[9600 baudrate]
Cloud Default: Bolt Cloud (https://cloud.boltiot.com)
Optional: Custom cloud using Bolt APIs
LED indicators
WiFi LED - WiFi connectivity 1) Slow blinking: Trying to find and connect to WiFi network
2) Fast blinking: User has connected via Bolt IoT app for setup
3) Stable: Connected to WiFi
Cloud LED – Bolt Cloud connectivity 1) Stable: Connected to Bolt Cloud
2) Off: Not connected to Bolt Cloud
3) Dim: Insufficient power/ incorrect boot
Dimensions 35mm x 35mm
Boot Time less than 1 second






Line Graph

A line graph is a graphical display of information that changes continuously over time. A line graph may also be referred to a line chart. Within a line graph, there are points connecting the data to show a continuous change. The lines in a line graph can descend and ascend based on the data. We can use a line graph to compare different events, situations, and information.



Sample Code

setChartLibrary('google-chart');
  setChartTitle('Your Graph Title');
  setChartType('lineGraph');
  setAxisName('X-Axis Name','Y-axis Name');
  plotChart('time_stamp','your_variable_name');

Output

Code Format


Syntax Parameter(s) Description
setChartLibrary('google-chart'); Library Name Set the chart library to be used. Bolt Cloud uses 'google-chart' to visualize the data.
setChartTitle('Your Graph Title'); Graph Name Set the title of the graph according to your choice.
setChartType('lineGraph'); Graph type Set the type of chart to be plotted. Bolt Cloud offers 8 different types of charts to be plotted i.e Line Graph, Bar Graph, Scatter Graph, Area Graph, Table Graph, Stepped Graph, Histogram Graph, and Gauge.
setAxisName('X-Axis Name','Y-axis Name'); Axis Name Set the display name for each of the graph axis.
plotChart('time_stamp','your_variable_name'); Variable Names Display the graph on the screen for the given variables. The first parameter is always 'time_stamp' and the second parameter is the variable name that you have given during hardware configuration of the product.
setNumberFormatter('format type') Format type Describes how numeric columns should be formatted. setNumberFormatter() function supports the following options as parameter - 'decimal', 'scientific', 'percentage', 'currencyInDollar', 'currencyInRupees'. This function should be called before the plotChart() function.
setAnimation(boolean) Boolean type This function describes how to animate modifications made to a chart, instead of applying them instantly. setAnimation() function supports the following options as parameter- true, false. It is enabled (true) by default and this function should be called before the plotChart() function.
setCrosshair(boolean) Boolean type Crosshairs are thin vertical and horizontal lines centered on a data point in a chart. When you, as a chart creator, enable crosshairs in your charts, your users will then be able to target a single element. setCrosshair() function supports the following options as parameter- true, false. It is disabled (false) by default and this function should be called before the plotChart() function.
setDateFormatter('date format') Date Format Formats the x-axis date value in a variety of ways. setDateFormatter() function supports the following options as parameter- 'mm/dd/yyyy', 'dd/mm/yyyy'. This function should be called before the plotChart() function.




Bar Graph

A bar chart is a pictorial representation of grouped data with rectangular bars with lengths proportional to the values that they represent. The bars can be plotted vertically or horizontally.



Sample Code

setChartLibrary('google-chart');
setChartTitle('Your Graph Title');
setChartType('barGraph');
setAxisName('X-Axis Name','Y-axis Name');
plotChart('time_stamp','your_variable_name');

Output

Code Format


Syntax Parameter(s) Description
setChartLibrary('google-chart'); Library Name Set the chart library to be used. Bolt Cloud uses 'google-chart' to visualize the data.
setChartTitle('Your Graph Title'); Graph Name Set the title of the graph according to your choice.
setChartType('barGraph'); Graph type Set the type of chart to be plotted. Bolt Cloud offers 8 different types of charts to be plotted i.e Line Graph, Bar Graph, Scatter Graph, Area Graph, Table Graph, Stepped Graph, Histogram Graph, and Gauge.
setAxisName('X-Axis Name','Y-axis Name'); Axis Name Set the display name for each of the graph axis.
plotChart('time_stamp','your_variable_name'); Variable Names Display the graph on the screen for the given variables. The first parameter is always 'time_stamp' and the second parameter is the variable name that you have given during hardware configuration of the product.
setNumberFormatter('format type') Format type Describes how numeric columns should be formatted. setNumberFormatter() function supports the following options as parameter - 'decimal', 'scientific', 'percentage', 'currencyInDollar', 'currencyInRupees'. This function should be called before the plotChart() function.
setAnimation(boolean) Boolean type This function describes how to animate modifications made to a chart, instead of applying them instantly. setAnimation() function supports the following options as parameter- true, false. It is enabled (true) by default and this function should be called before the plotChart() function.
setDateFormatter('date format') Date Format Formats the x-axis date value in a variety of ways. setDateFormatter() function supports the following options as parameter- 'mm/dd/yyyy', 'dd/mm/yyyy'. This function should be called before the plotChart() function.




Scatter Graph

Scatter charts are used to plot data points on a horizontal and a vertical axis in the attempt to show how much one variable is affected by another. Each row in the data table is represented by a marker whose position depends on its values in the columns set on the X and Y axes.



Sample Code

setChartLibrary('google-chart');
setChartTitle('Your Graph Title');
setChartType('scatterGraph');
setAxisName('X-Axis Name','Y-axis Name');
plotChart('time_stamp','your_variable_name');

Output

Code Format


Syntax Parameter(s) Description
setChartLibrary('google-chart'); Library Name Set the chart library to be used. Bolt Cloud uses 'google-chart' to visualize the data.
setChartTitle('Your Graph Title'); Graph Name Set the title of the graph according to your choice.
setChartType('scatterGraph'); Graph type Set the type of chart to be plotted. Bolt Cloud offers 8 different types of charts to be plotted i.e Line Graph, Bar Graph, Scatter Graph, Area Graph, Table Graph, Stepped Graph, Histogram Graph and Gauge.
setAxisName('X-Axis Name','Y-axis Name'); Axis Name Set the display name for each of the graph axis.
plotChart('time_stamp','your_variable_name'); Variable Names Display the graph on the screen for the given variables.First parameter is always 'time_stamp' and second parameter is the variable name that you have given during hardware configuration of the product.
setNumberFormatter('format type') Format type Describes how numeric columns should be formatted. setNumberFormatter() function supports the following options as parameter - 'decimal', 'scientific', 'percentage', 'currencyInDollar', 'currencyInRupees'. This function should be called before the plotChart() function.
setAnimation(boolean) Boolean type This function describes how to animate modifications made to a chart, instead of applying them instantly. setAnimation() function supports the following options as parameter- true, false. It is enabled (true) by default and this function should be called before the plotChart() function.
setCrosshair(boolean) Boolean type Crosshairs are thin vertical and horizontal lines centered on a data point in a chart. When you, as a chart creator, enable crosshairs in your charts, your users will then be able to target a single element. setCrosshair() function supports the following options as parameter- true, false. It is disabled (false) by default and this function should be called before the plotChart() function.
setDateFormatter('date format') Date Format Formats the x-axis date value in a variety of ways. setDateFormatter() function supports the following options as parameter- 'mm/dd/yyyy', 'dd/mm/yyyy'. This function should be called before the plotChart() function.




Area Graph

An area chart or area graph displays graphically quantitative data. It is based on the line chart. The area between axis and line are commonly emphasized with colors, textures, and hatchings.



Sample Code

setChartLibrary('google-chart');
setChartTitle('Your Graph Title');
setChartType('areaGraph');
setAxisName('X-Axis Name','Y-axis Name');
plotChart('time_stamp','your_variable_name');

Output

Code Format


Syntax Parameter(s) Description
setChartLibrary('google-chart'); Library Name Set the chart library to be used. Bolt Cloud uses 'google-chart' to visualize the data.
setChartTitle('Your Graph Title'); Graph Name Set the title of the graph according to your choice.
setChartType('areaGraph'); Graph type Set the type of chart to be plotted. Bolt Cloud offers 8 different types of charts to be plotted i.e Line Graph, Bar Graph, Scatter Graph, Area Graph, Table Graph, Stepped Graph, Histogram Graph, and Gauge.
setAxisName('X-Axis Name','Y-axis Name'); Axis Name Set the display name for each of the graph axis.
plotChart('time_stamp','your_variable_name'); Variable Names Display the graph on the screen for the given variables.The first parameter is always 'time_stamp' and the second parameter is the variable name that you have given during hardware configuration of the product.
setNumberFormatter('format type') Format type Describes how numeric columns should be formatted. setNumberFormatter() function supports the following options as parameter - 'decimal', 'scientific', 'percentage', 'currencyInDollar', 'currencyInRupees'. This function should be called before the plotChart() function.
setAnimation(boolean) Boolean type This function describes how to animate modifications made to a chart, instead of applying them instantly. setAnimation() function supports the following options as parameter- true, false. It is enabled (true) by default and this function should be called before the plotChart() function.
setCrosshair(boolean) Boolean type Crosshairs are thin vertical and horizontal lines centered on a data point in a chart. When you, as a chart creator, enable crosshairs in your charts, your users will then be able to target a single element. setCrosshair() function supports the following options as parameter- true, false. It is disabled (false) by default and this function should be called before the plotChart() function.
setDateFormatter('date format') Date Format Formats the x-axis date value in a variety of ways. setDateFormatter() function supports the following options as parameter- 'mm/dd/yyyy', 'dd/mm/yyyy'. This function should be called before the plotChart() function.




Table Chart

For a simple tabular representation, you can choose table chart.



Sample Code

setChartLibrary('google-chart');
setChartTitle('Your Graph Title');
setChartType('tableGraph');
setAxisName('X-Axis Name','Y-axis Name');
plotChart('time_stamp','your_variable_name');

Output

Code Format


Syntax Parameter(s) Description
setChartLibrary('google-chart'); Library Name Set the chart library to be used. Bolt Cloud uses 'google-chart' to visualize the data.
setChartTitle('Your Graph Title'); Graph Name Set the title of the graph according to your choice.
setChartType('tableGraph'); Graph type Set the type of chart to be plotted. Bolt Cloud offers 8 different types of charts to be plotted i.e Line Graph, Bar Graph, Scatter Graph, Area Graph, Table Graph, Stepped Graph, Histogram Graph and Gauge.
setAxisName('X-Axis Name','Y-axis Name'); Axis Name Set the display name for each of the graph axis.
plotChart('time_stamp','your_variable_name'); Variable Names Display the graph on the screen for the given variables.First parameter is always 'time_stamp' and second parameter is the variable name that you have given during hardware configuration of the product.
setNumberFormatter('format type') Format type Describes how numeric columns should be formatted. setNumberFormatter() function supports the following options as parameter - 'decimal', 'scientific', 'percentage', 'currencyInDollar', 'currencyInRupees'. This function should be called before the plotChart() function.
setDateFormatter('date format') Date Format Formats the x-axis date value in a variety of ways. setDateFormatter() function supports the following options as parameter- 'mm/dd/yyyy', 'dd/mm/yyyy'. This function should be called before the plotChart() function.




Stepped Graph

A Step chart is a Line chart that does not use the shortest distance to connect two data points. Instead, it uses vertical and horizontal lines to connect the data points in a series forming a step-like progression. The vertical parts of a Step chart denote changes in the data and their magnitude. The horizontal parts of a Step chart denote the constancy of the data.



Sample Code

setChartLibrary('google-chart');
setChartTitle('Your Graph Title');
setChartType('steppedGraph');
setAxisName('time_stamp','light_data','temp');
plotChart('time_stamp','light_data','temp');

Output

Code Format


Syntax Parameter(s) Description
setChartLibrary('google-chart'); Library Name Set the chart library to be used. Bolt Cloud uses 'google-chart' to visualize the data.
setChartTitle('Your Graph Title'); Graph Name Set the title of the graph according to your choice.
setChartType('steppedGraph'); Graph type Set the type of chart to be plotted. Bolt Cloud offers 8 different types of charts to be plotted i.e Line Graph, Bar Graph, Scatter Graph, Area Graph, Table Graph, Stepped Graph, Histogram Graph and Gauge.
setAxisName('time_stamp','first_variable_name','second_variable_name'); Name Set the display name to differentiate between two different data sets.
plotChart('time_stamp','first_variable_name','second_variable_name'); Variable Names Display the graph on the screen for the given variables.First parameter is always 'time_stamp' and other parameter is the variable names that you have given during hardware configuration of the product.
setNumberFormatter('format type') Format type Describes how numeric columns should be formatted. setNumberFormatter() function supports the following options as parameter - 'decimal', 'scientific', 'percentage', 'currencyInDollar', 'currencyInRupees'. This function should be called before the plotChart() function.
setDateFormatter('date format') Date Format Formats the x-axis date value in a variety of ways. setDateFormatter() function supports the following options as parameter- 'mm/dd/yyyy', 'dd/mm/yyyy'. This function should be called before the plotChart() function.




Histogram Graph

A histogram is a graphical representation of continuous numerical data in form of bars where the x-axis displays ranges of data sets and the y-axis represent frequency.



Sample Code

setChartLibrary('google-chart');
setChartTitle('Your Graph Title');
setChartType('histogramGraph');
setAxisName('X-Axis Name','Y-axis Name');
plotChart('time_stamp','your_variable_name');

Output

Code Format


Syntax Parameter(s) Description
setChartLibrary('google-chart'); Library Name Set the chart library to be used. Bolt Cloud uses 'google-chart' to visualize the data.
setChartTitle('Your Graph Title'); Graph Name Set the title of the graph according to your choice.
setChartType('histogramGraph'); Graph type Set the type of chart to be plotted. Bolt Cloud offers 8 different types of charts to be plotted i.e Line Graph, Bar Graph, Scatter Graph, Area Graph, Table Graph, Stepped Graph, Histogram Graph, and Gauge.
setAxisName('X-Axis Name','Y-axis Name'); Axis Name Set the display name for each of the graph axis.
plotChart('time_stamp','your_variable_name'); Variable Names Display the graph on the screen for the given variables.First parameter is always 'time_stamp' and second parameter is the variable name that you have given during hardware configuration of the product.
setNumberFormatter('format type') Format type Describes how numeric columns should be formatted. setNumberFormatter() function supports the following options as parameter - 'decimal', 'scientific', 'percentage', 'currencyInDollar', 'currencyInRupees'. This function should be called before the plotChart() function.
setDateFormatter('date format') Date Format Formats the x-axis date value in a variety of ways. setDateFormatter() function supports the following options as parameter- 'mm/dd/yyyy', 'dd/mm/yyyy'. This function should be called before the plotChart() function.




Gauge

Gauge chart (also known as dial chart or speedometer chart) uses a single needle to show information as a reading on a dial. On the gauge chart, the value for the needle is read on a colored data range. This chart type is often used in executive dashboard reports to show key business indicators. It’s a great tool to help visualize percentages, as well as other fixed-range amounts for end users.



Sample Code

setChartLibrary("google-chart")
setChartTitle('Gauge Chart')
setChartType('gauge'); 
setAxisName('light_Data'); 
setDimensions(400,400);
setMaxValue(1023);
setYellow(501,725);
setRed(726,1023);
setGreen(250,500);
plotChart('light_data');

Output

Code Format


Syntax Parameter(s) Description
setChartLibrary('google-chart'); Library Name Set the chart library to be used. Bolt Cloud uses 'google-chart' to visualize the data.
setChartTitle('Your Graph Title'); Graph Name Set the title of the graph according to your choice.
setChartType('gauge'); Graph type Set the type of chart to be plotted. Bolt Cloud offers 8 different types of charts to be plotted i.e Line Graph, Bar Graph, Scatter Graph, Area Graph, Table Graph, Stepped Graph, Histogram Graph and Gauge.
setAxisName('your_variable_name'); Axis Name In Gauge there is no axis. But you can put a name inside the gauge, it should be same as your variable name.
plotChart('your_variable_name'); Variable Name Display the graph on the screen for the given variables.In Gauge, there is only one parameter i.e the variable name that you have given during hardware configuration of the product.
setDimensions(width,height); Dimension This syntax helps to resize your gauge. Pass the height and width as the parameter.
setMaxValue(max_value); Max Value Set the max value for the gauge.
setRed(min,max); Interval Range Set the Red color between the given interval range.
setYellow(min,max) Interval Range Set the Yellow color between the given interval range.
setGreen(min,max) Interval Range Set the Green color between the given interval range.






Multiple Graph (Beta)

The Bolt Cloud now supports multiple graphs. This is a beta feature and currently only supports multiple line graphs. We shall add support for more graphs soon, you can vote for the graph that you think should be added earliest by voting on this poll on our forum.



Sample Code

var lineGraph1 = new boltGraph();
lineGraph1.setChartType("lineGraph");
lineGraph1.setAxisName('X-Axis Name','Y-axis Name');
lineGraph1.plotChart('time_stamp','your_variable_name_1');
var lineGraph2 = new boltGraph();
lineGraph2.setChartType("lineGraph");
lineGraph2.setAxisName('X-Axis Name','Y-axis Name');
lineGraph2.plotChart('time_stamp','your_variable_name_2');

Output

Code Format


Syntax Parameter(s) Description
var graphObj = new boltGraph(); None Create a new graph object. You can give any name to object.
graphObj.setChartType("lineGraph"); Graph type Set the type of chart to be plotted. Currently only lineGraph option is available.
graphObj.setAxisName('X-Axis Name','Y-axis Name'); Axis Name Set the display name for each of the graph axis of the graph object.
graphObj.plotChart('time_stamp','your_variable_name'); Variable Name Display the graph on the screen for the given graph object i.e. graphObj. First parameter is always 'time_stamp' and second parameter is the variable name that you have given during hardware configuration of the product.








Introduction
The Bolt Cloud API provides an interface for communication between the Bolt devices and any 3rd party system e.g. mobile application, web server, python programs etc. The API contains very intuitive control, monitoring, communication and utility functions for the Bolt Devices connected to your account. The Bolt Cloud API uses HTTP protocol for the communication and uses the HTTP GET and HTTP POST methods. Hence users can execute actions and retrieve information from Bolt devices programmatically using conventional HTTP requests.

Here are a few use cases of the API:
  1. Use the API in native apps on iOS and Android to control and monitor Bolt devices over the Internet.
  2. Pull collect sensor data connect to Bolt device, to any other cloud to run your custom AI algorithms and analytics
  3. Connect Bolt Cloud to any VPS (Virtual Private Server) and run your code in any language of your choice. Refer sample codes.
  4. Remote Operating System: Using the API, Bolt devices can work like a board with an OS i.e. similar to Raspberry Pi or Beagle Bone, with the exception of the OS, which in this case, will reside on a remote VPS (Virtual Private Server). The Bolt will receive data from the sensors and push to the VPS with a Linux OS. The processing will take place on the VPS and it will push the commands to control motors, LEDs, and actuators to the Bolt device. You can use all the features of a Linux OS in this kind of a system.
Note: In case you wish to use a VPS (Virtual private Server) then you can create an account on DIgital Ocean using this link: https://m.do.co/c/679338b50344 .The link will give you $10 free credit.


API request syntax
This is a simple syntax for making an API request. In this request, the first parameter is the API key and the second parameter is the command that we want to execute and the last parameter is ID of Bolt device. The general syntax for the API request is:

/remote/your_api_key/command?&param1=...&param2=...&deviceName=BOLTXXXXX

The below example typically shows how to "restart" a Bolt device having device name as BOLT916154:

/remote/44b2de6b-7e68-40e7-a27f-814b58afe008/restart?&deviceName=BOLT9161541



GPIO Commands API
  1. Write digital output
    • (a) cmd: digitalWrite
    • (b) parameters:
      • pin: It is the Bolt GPIO you want to control. It can take any of the following values 0, 1, 2, 3, 4, A0.
      • state: It is the output voltage to be provided on the GPIO. It can take value HIGH(5V) or LOW(0V).
      • deviceName: The name of the Bolt device you want to control.
    • (c) Example:
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/digitalWrite?pin=0&state=HIGH&deviceName=BOLT13819450
        • this command will give 3.3 volts on pin 0
        • browser output: {"success": "1", "value": "1"}
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/digitalWrite?pin=0&state=LOW&deviceName=BOLT13819450
        • this command will give 0 volts on pin 0
        • browser output: {"success": "1", "value": "0"}
  2. Read digital input
    • (a) cmd: digitalRead
    • (b) parameters:
      • pin: It is the Bolt GPIO you want to control. It can take any of the following values 0, 1, 2, 3, 4, A0.
      • deviceName: The name of the Bolt device you want to control.
    • (c) Example:
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/digitalRead?pin=0&deviceName=BOLT13819450
        • {"success": "1", "value": "1"} or
        • {"success": "1", "value": "0"}
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/digitalRead?pin=A0&deviceName=BOLT13819450
        • browser output: {"success":"1","value":"1"} or
        • browser output: {"success": "1", "value": "0"}
  3. Read analog input
    • (a) cmd: analogRead
    • (b) parameters:
      • pin: It is the Bolt GPIO you want to control. It can take value A0.
      • deviceName: The name of the Bolt device you want to control.
    • (c) Example:
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/analogRead?pin=A0&deviceName=BOLT1257632
        • browser output for 0 volts:
          {"success":"1","value":"0"} or
        • browser output for 2.5 volts:
          {"success": "1", "value": "245"}
  4. Write analog output (PWM)
    • (a) cmd: analogWrite
    • (b) parameters:
      • pin: It is the Bolt GPIO you want to control. It can take any of the following values 0, 1, 2, 3, 4, A0.
      • value: It is the analog output voltage to be provided on the GPIO. It can take value between 0-255.
      • deviceName: The name of the Bolt device you want to control.
    • (c) Example:
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/analogWrite?pin=1&value=0&deviceName=BOLT1257632
        • browser output for 0 volts:
          {"success":"1","value":"0"} or
        • browser output for 2.5 volts:
          {"success":"1","value":"245"}


UART Commands API
  1. Initialize serial communication
    • (a) cmd: serialBegin
    • (b) parameters:
      • baud: It is the baud rate to be set for Bolt. It can take value 9600.
      • deviceName: The name of the Bolt device you want to control.
    • (c) Example:
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/serialBegin?baud=9600&deviceName=BOLT13819450
        • to set baudrate to 9600.
        • Browser output:
          {"success":"1","value":"serialBegin successful"}
  2. Send serial data output
    • (a) cmd: serialWrite
    • (b) parameters:
      • data: dataString where String will be transmitted as ASCII characters
      • deviceName: The name of the Bolt device you want to control.
    • (c) Example:
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/serialWrite?data=Hello&deviceName=BOLT8795377
        • to send string “Hello” over the Tx line.
        • Browser output:
          {"success":"1","value":"serialWrite successful"}
  3. Read incoming serial data
    • (a) cmd: serialRead
    • (b) parameters:
      • till: Read the data upto the specified 'till' value from the incoming UART data to Bolt. It takes ASCII value of the character from 0-127.
      • deviceName: The name of the Bolt device you want to control.
    • (c) Example:
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/serialRead?till=10&deviceName=BOLT8795377
        • if you want to read till a newline char '\n' the ascii value corresponding to '\n' is 10, the above command is given. Note: till is an optional parameter.
        • Browser output:
          {"success": "1", "value": "inventrom"}


Utility Commands API
  1. Get Bolt device version
    • (a) cmd: version
    • (b) parameters:
      • deviceName: The name of the Bolt device you want to control.
    • (c) Example:
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/version?&deviceName=BOLT8795377
        • will return the version of your Bolt.
        • Browser output:
          {"success": "1", "value": "{\"Bolt Version\":\"1.3\",\"Firmware Version\":\"2.0(168)\"}"}
  2. Restart Bolt device
    • (a) cmd: restart
    • (b) parameters:
      • deviceName: The name of the Bolt device you want to control.
    • (c) Example:
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/restart?&deviceName=BOLT8795377
        • to restart the Bolt device.
        • Browser output:
          {"success": "1", "value": "Restarted"}
  3. Get Bolt device status (dead or alive)
    • (a) cmd: isAlive
    • (b) parameters:
      • deviceName: The name of the Bolt device you want to control.
    • (c) Example:
      • /remote/44b2de6b-7e68-40e7-a27f-814b58afe008/isAlive?&deviceName=BOLT8795377
        • will return the device status.
        • Browser output:
          {"success": "1", "value": "alive"} or
          {"success": "1", "value": "dead"}


Sample Code
  • Python
    import requests 
    r =requests.get('https://cloud.boltiot.com/remote/eee61832-c0de-414c-8ac9-4db633ae2979/digitalWrite?pin=0&state=HIGH&deviceName=BOLT13819450') 
    r.text
    
  • PHP
    $service_url = 'https://cloud.boltiot.com/remote/63b45fb2-cac0-455b-afa4-a8c34df8c193/digitalWrite?pin=0&state=HIGH&deviceName=BOLT13819450'; 
    $curl = curl_init($service_url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $curl_response = curl_exec($curl);
    if ($curl_response === false) {
    $info = curl_getinfo($curl);
    curl_close($curl);
    die('error occured during curl exec. Additioanl info: ' . var_export($info));
    }
    curl_close($curl);
    if (isset($decoded->response->status) && $decoded->response->status == 'ERROR') {
    die('error occured: ' . $decoded->response->errormessage);
    }
    echo $curl_response;
    ?>
    

Arduino Library

The BoltIoT-Arduino-Helper library helps you to quickly interface Bolt with Arduino. The library supports both hardware serial and software serial UART which is provided by Arduino. We recommend you to choose hardware serial over software serial since it's more robust than software serial. The library makes it possible to push data to Bolt Cloud by abstracting the setup and interface layer between Bolt and Arduino. You can always checkout the underlying code here.




How to include the library in Arduino IDE?

Please follow the steps given below to include the Bolt library into the Arduino IDE.
  • Go to the Github link https://github.com/Inventrom/boltiot-arduino-helper.
  • Click on clone or download button and download the zip.
  • Open Arduino IDE ( In case you don't have Arduino installed, click here to find out how to install it.)
  • Click on Sketch -> Include Library -> Add .Zip library.
  • Navigate to the folder containing boltiot-arduino-helper.zip and select boltiot-arduino-helper.zip.
  • Press ok and the library is loaded.
  • Write the Arduino code. Examples are given below for reference.

  • Note: We recommend you to choose hardware serial over software serial.

    Interfacing via Hardware Serial Port



    Sample Code

    #include <BoltIot-Arduino-Helper.h>
      void setup() {
        boltiot.Begin(Serial); //Initialize the Bolt interface over serial uart. Serial could be replaced with Serial0 or Serial1 on Arduino mega boards.
             //In this example Tx pin of Bolt is connected to Rx pin of Arduino Serial Port
             //and Rx pin of Bolt is connected to tx pin of arduino Serial Port
        pinMode(2,INPUT); //Set pin 2 as input. We will send this pin's state as the data to the Bolt Cloud
      }
      void loop() {
        boltiot.CheckPoll(digitalRead(2)); //Send data to the Bolt Cloud, when the Bolt polls the Arduino for data.
      //This function needs to be called regularly. Calling the CheckPoll function once every seconds is required
      }
    

    Note: While uploading the code, the Bolt needs to be disconnected from the Arduino.

    Interfacing via Software Serial Port



    Sample Code

    #include <BoltIot-Arduino-Helper.h>
    void setup() {
      boltiot.Begin(3,4); //Initialize the Bolt interface over software serial uart.
           //In this example Tx pin of Bolt is connected to pin 3 of Arduino
           //and Rx pin of Bolt is connected to pin 4 of Arduino
      pinMode(2,INPUT); //Set pin 2 as input. We will send this pin's state as the data to the Bolt Cloud
    }
    void loop() {
      boltiot.CheckPoll(digitalRead(2)); //Send data to the Bolt Cloud, when the Bolt polls the Arduino for data.
    //This function needs to be called regularly. Calling the CheckPoll function once every seconds is required
    }
    

  • Upload the code to Arduino.
  • Create a product and link it to the device. Refer the below gif for this step.


  • Connect your Bolt to the Arduino as shown in the interfacing diagram given above. Now you should be able to view the data collected by Bolt by clicking on view device icon in the Devices tab on the dashboard.

  • Python Library

    The Bolt python library provides an easy to use interface of the Bolt Cloud API's.

    How to use the Bolt Python library in your code?

    Follow the steps given below to use the Bolt python library in your code.
  • Install boltiot library first by running below command on terminal / command line.

  • sudo pip install boltiot
    
  • Create your python file which will use the Bolt API library.

  • touch file_name.py
    
  • Import the library in your python code.

  • from boltiot import Bolt
    api_key = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    device_id  = "BOLT1234"
    mybolt = Bolt(api_key, device_id)
    


    Code Format
    Syntax Parameter(s) Description
    from boltiot import Bolt None Import the Bolt Class from the boltiot library.
    api_key = "ACXXXXXXXXXXXXXXXXXXXXXX" Api Key Assign the Bolt Cloud api key to api_key variable
    device_id = "BOLT1234" Device Id Assign the device id to device_id variable
    mybolt = Bolt(api_key, device_id) Api key, Device id Create an object of type Bolt and initialize the api key and device id.


    Commands
    1. GPIO Functions

    a) digitalWrite Command - Write digital output.

    response = mybolt.digitalWrite('0', 'HIGH')
    


    b) digitalRead Command - Read digital input.

    response = mybolt.digitalRead('0')
    


    c) analogRead Command - Read analog input.

    response = mybolt.analogRead('A0')
    


    d) analogWrite Command - Write analog output.

    response = mybolt.analogWrite('0', '100')
    

    2. UART Functions

    a) serialBegin Command - Initialize serial communication.

    response = mybolt.serialBegin('9600')
    


    b) serialWrite Command - Send serial data output.

    response = mybolt.serialWrite('Hello')
    


    c) serialRead Command - Read incoming serial data.

    response = mybolt.serialRead()
    

    3. Utility Functions

    a) isAlive Command - Get Bolt device status.

    response = mybolt.isAlive()
    


    b) restart Command - Restart Bolt device.

    response = mybolt.restart()
    


    c) version Command - Get Bolt device version.

    response = mybolt.version()
    


    4. Alert Notification

    The Bolt python library provides an easy interface to send Email and SMS alerts using Mailgun and Twilio third-party services respectively.

    a) Sending SMS

    Twilio is a popular third-party SMS functionality provider. Twilio allows software developers to programmatically make and send and receive text messages using its web service APIs.

    Creating an account on Twilio

    Step 1: Create an account on https://www.twilio.com/try-twilio

    Step 2: After successfully creating the account, click on the home icon on the leftmost bar as shown in image below. This screen will have your SID and Auth token which we will use later during coding. Copy both and save them in a text file.


    Step 3: Sender number is a special number which is provided by Twilio. To generate the sender number for your twilio account click on Get Started button. Click on Get a number button.

    Step 4: A popup will appear. Click on Choose this number button.

    Step 5: Then you will get a number starting with '+' e.g +7192345678. Copy this number and save to text editor for future references.

    That's it. Now you have your SID, auth token and sender number. We will use Bolt Python library and these Twilio values to create our own SMS Alert system.

    Code Format
    Syntax Parameter(s) Description
    from boltiot import Sms None Import the Sms Class from the boltiot library.
    sms = Sms(SID, AUTH_TOKEN, TO_NUMBER, FROM_NUMBER) SID, AUTH_TOKEN, TO_NUMBER, FROM_NUMBER Create a sms object and pass all the credentials as a parameter.
    sms.send_sms("Write your message here.") Message Content Message content to be sent in the SMS.

    Sample Code
    from boltiot import Sms # Import SMS class from boltiot library
    # Credentials required to send SMS
    SID = 'You can find SID in your Twilio Dashboard' 
    AUTH_TOKEN = 'You can find  on your Twilio Dashboard' 
    FROM_NUMBER = 'This is the no. generated by Twilio. You can find this on your Twilio Dashboard'
    TO_NUMBER = 'This is your number. Make sure you are adding +91 in beginning'
    sms = Sms(SID, AUTH_TOKEN, TO_NUMBER, FROM_NUMBER) # Create object to send SMS
    sms.send_sms("Write your message here.") # Call function to send SMS!'
    

    b) Sending Email

    Mailgun is an Email automation service. It has a very powerful set of inbuilt API functions for sending emails. Developers can send emails programmatically with the help of Mailgun API.

    Creating an account on Mailgun

    Step 1: Create an account on https://signup.mailgun.com/new/signup

    Step 2: After successfully creating the account, scroll down to Sandbox Domain section. Click on Add Recipient button.

    Step 3: Click on Invite New Recipient button. Enter the Recipient Email ID. In this case enter your Email ID.

    Step 4: After adding Email ID a new sandbox will be generated. Click on the ID of the newly generated sandbox. The new screen will have all the necessary credentials that you need for sending an email. Copy the Sandbox URL and the API key and save them in the text file.


    That's it. Now you have your API key, sandbox URL and sender email. We will use Bolt Python library and Mailgun values to create our own Email Alert system.

    Code Format
    Syntax Parameter(s) Description
    from boltiot import Email None Import the Email Class from the boltiot library.
    mailer = Email(MAILGUN_API_KEY, SANDBOX_URL, SENDER_EMAIL, RECIPIENT_EMAIL) MAILGUN_API_KEY, SANDBOX_URL, SENDER_EMAIL, RECIPIENT_EMAIL Create a mailer object and pass all the credentials as a parameter.
    mailer.send_email("Subject", "Email Body Content") Subject, Email Body Content Call the send_email function to send the email.

    Sample Code
    from boltiot import Email # Import Email class from boltiot library
    # Credentials required to send Email
    MAILGUN_API_KEY = 'This is the private API key which you can find on your Mailgun Dashboard' 
    SANDBOX_URL= 'You can find this on your Mailgun Dashboard' 
    SENDER_EMAIL = 'This would be test@your SANDBOX_URL'
    RECIPIENT_EMAIL = 'Enter your Email ID Here'
    mailer = Email(MAILGUN_API_KEY, SANDBOX_URL, SENDER_EMAIL, RECIPIENT_EMAIL) # Create object to send Email
    mailer.send_email("Subject", "Email Body Content") # Call function to send Email
    

    mobile
    Install Bolt IoT App
    Download the mobile app and register your device
    google playstore appstore

    Technical Specs






    Parameters Details
    Connectivity and Processing Module ESP8266 with custom firmware
    MCU 32-bit RISC CPU: Tensilica Xtensa LX106
    Power 5V/1A DC via Micro-USB port or 5V and GND pins
    Operating Voltage 3.3V
    CPU Clock Frequency 80 MHz
    MCU Internal Memory 64 KB of instruction RAM; 96KB of data RAM
    MCU External Memory 4 MB Flash memory [QSPI]
    GPIO pins 5 Digital pins [3.3V logic]
    ADC 1 pin 10 bit ADC [0-1V input]
    PWM All 5 Digital pins capable of PWM [Software PWM]
    Connectivity
    WiFi 802.11 b/g/n
    Automatic AP mode if not connected to WiFi
    WEP/WPA/WPA2 authentication
    UART 8-N-1 3.3V TTL UART [using TX, RX, GND pins]
    [9600 baudrate]
    Cloud Default: Bolt Cloud (https://cloud.boltiot.com)
    Optional: Custom cloud using Bolt APIs
    LED indicators
    WiFi LED - WiFi connectivity 1) Slow blinking: Trying to find and connect to WiFi network
    2) Fast blinking: User has connected via Bolt IoT app for setup
    3) Stable: Connected to WiFi
    Cloud LED – Bolt Cloud connectivity 1) Stable: Connected to Bolt Cloud
    2) Off: Not connected to Bolt Cloud
    3) Dim: Insufficient power/ incorrect boot
    Dimensions 35mm x 35mm
    Boot Time less than 1 second