Build your first IoT Application

Whether you are a Startup, Maker or a hobbyist you can use our API's to build IoT products on Embedded Devices.

This is a high level overview of Shunya Interfaces features. Click to interact with the image (it has direct links to our documentation).

Oops!, No Image to display.

Step 1: Select Sensors, Actuators and Insight tools

Use the basic structure as a start point and Paste code accordingly.

/*Include this header file into your program */
#include <shunyaInterfaces.h>
/* Main Function */
int main(void) {
/* Initialize the Library*/
initLib();
/*####################################
* PASTE CODE BELOW
*####################################*/
return 0;
}

Choose Sensors (Gather data)

  1. Voltage
  2. Distance
  3. Light Intensity
  4. Current
  5. Liquid Flow
  6. Gas (coming soon)
  7. Pressure (coming soon)
  8. Humidity (coming soon)
  9. Motion (coming soon)
  10. Temperature (coming soon)

Choose Insight tools

  1. Send Data to Cloud (AWS)
  2. Send Data to Dashboard (coming soon)

Choose to send Alerts

  1. Send Alerts via Mail (coming soon)
  2. Send Alerts via Messages (coming soon)
  3. Send Alerts via WhatsApp messages (coming soon)

Choose Actuators (Hardware Actions)

  1. LED's
  2. Relay
  3. Pumps(coming soon)
  4. Fan(coming soon)

Step 2: Connect peripherals & Configure Shunya Interfaces

Choose a dev Board

Shunya Interfaces supports these development boards, you can choose any one of them to work with.

  1. RockPi-S-V10
  2. Raspberry Pi 4
  3. Raspberry Pi 3
  4. OrangePi 2G IOT

Connect peripherals

Connect all your hardware peripherals to the board.

To help you with the connections use the links in the excel to easily find pinouts for the development boards.

  1. Dev Board pinouts

Configure Shunya Interfaces

Tell Shunya Interfaces your hardware connections.

You can configure by running command.

$ sudo vi /etc/shunya/interfaces/config.yaml

Sensor ID's and Connection ID's

You tell all your Hardware connections to Shunya Interfaces via Sensor ID's and Connection ID's.

Each Sensor is given a special ID which the Shunya Interfaces library recognizes. And each Hardware pin on the Sensor is given a Connection ID.

So when we write pin 1: 1.1 Shunya Interfaces understands it as <Sensor 1>.<Sensor pin 1> connected to pin 1 of Raspberry Pi.

For Example : Let's say that, we have connected 2 devices to the Raspberry Pi (BME280 and PCF8591) to pin 3 (SDA) & pin 5 (SCL) respectively.

Our Config file will look like.

pin 3: [1.1, 6.1]
pin 4: null
pin 5: [1.2, 6.2]

Make sure to save your changes to the config file.

Step 3: Install Shunya OS

Shunya Interfaces is built on top of Shunya OS and comes pre-installed with Shunya Interfaces. Shunya OS is an linux-based OS that runs on your hardware, it light-weight and configurable.

What will you need.

  1. Chosen board and its peripherals
  2. microSD card Reader/Adapter and microSD card
  3. Laptop/PC

Install Etcher

Etcher allows you to Flash Shunya OS on the micro-SD card.

For Ubuntu 16.04

Installing Etcher is Simple, just run few commands in the terminal

$ sudo apt update
$ sudo apt install balena-etcher-electron

Flash Shunya OS

  1. Download Shunya OS
  2. Right click on the downloaded zip file.
  3. Click Extract here.
  4. Open Etcher.
  5. Click Select Image.
  6. You will find the Shunya OS .img file in the folder that we had extracted earlier.
  7. Select shunya-aaaa-image-xxxx.img file.
  8. Insert SD card.
  9. Click on Flash.
install-shunya-os-gif

This will load the micro-SD card with Shunya OS.

Booting Up with Shunya OS

  1. Insert the micro-SD card into the board.
  2. Connect peripherals like Keyboard, Mouse and HDMI monitor.
  3. Connect Power Supply.

The board should boot up with Shunya OS.

Login to Shunya

Login with these credentials:

  • Username : shunya
  • Password : shunya

Step 4: Run your program

Compile code and Run the program.

$ gcc -o myapp program.c -lshunyaInterfaces_user -lshunyaInterfaces_core
$ sudo ./myapp