Introduction

Welcome to the S2C.io docs. Here you’ll learn about all the resources in the current version of our Platform (0.9.0). S2C.io is a platform for building scalable internet of things applications. The platform consists on a number of tools that are designed to make it easy get to production application with minimal ramp-up time.The Platform consists on:

- Device Manager
- Application Manager
- Template Manager
- Alert Manager
- User Manager
- IDE

Requirements

There is no software download required. The platform is browser-based, we recommend using Chrome, Firefox, Internet Explorer 11+ or Safari.

Security

All HTTP requests to S2C.io should be done over SSL. SSL is the industry standard for securing HTTP traffic. Our website defaults to HTTPS and we do not allow non-SSL (HTTP) traffic to our Platform. SSL secures everything in the HTTP payload, which includes potentially sensitive information (like your project ID), and definitely sensitive information (like your Platform Key). Connections to s2c.io is encrypted and authenticated using AES_128_GCM and uses ECDHE_RSA as the exchange mechanism.

Authentication

Embedded devices require an authentication key in order to get access to S2C.io . Each Device is assigned a unique key during registration.

Quotas

DescriptionFreePro
Devices 3 Unlimited
Channels 15 Unlimited
Requests 2880/24hours
(2 requests/min)
Unlimited
Applications 10 Unlimited
Users 3 Unlimited
Email Alerts 60 Unlimited
SMS Alerts 30 Unlimited

The Internet of things is a network of connected things. In practice, the network is used for monitoring and controlling things. The added value is the ability to monitor and control remote assets in order to gain valuable information.
At Sensors2Cloud, we have built our platform around the following building blocks: Asset,channel,sensorand gateway

Asset

This is the entity that we need to monitor and/or control

Example:
Fridge, Compactor, Tank, etc...
			    

Channel

This a physical quantity that can be measured.

Example:
Temperature, pressure, distance, voltage, etc...
				

Sensor

This is a piece of hardware that allow us to measure one or more channels

Example:
Thermometer, ultrasonic sensor, pressure sensor, etc ...
			

Gateway

This is a piece of hardware that collects channel data from one or more sensors and send it over the network to the cloud

Example:
Modem, M2M Gateway, RTU, etc...			

The Internet of things is a network of connected things. In practice, the network is used for monitoring and controlling things. The added value is the ability to monitor and control remote assets in order to gain valuable information.
At Sensors2Cloud, we have built our platform around the following building blocks: Asset,channel,sensorand gateway

Architecture

Data Format

The Data Format used to represent the data is JSON.
The Gateway is represented as follows:

{"macaddr":"123456","api_version":"1.0.1","uptime":"0","sensorList":[]} 
where:
FieldDescription
macaddrMac Address of the Gateway. This can be the macaddr of the ethernet chip, wifi chip or the IMEI of the cellular modem
api_versionThe current S2C.io API version is 1.0.1
uptimeThe number of seconds since the last reboot of the gateway
sensorListList of sensors that are part of the gateway

The Sensor is represented as follows:
{"name":"sensor name","type":"sensortype","id":"unique_id","channels":[ ... ]} 
where:
FieldDescription
nameUnique name of the sensor
typeThe type of sensor. This is description of the architecture of the sensor.
idUnique identifier for this sensor. this id must be unique as it is used to identify the sensor. it is the responsibility of the user to ensure the id is unique. if the id are repeated the data will be rejected!
channelsList of channels that are part of the sensor

The Channel is represented as follows:
{"name":"channel_name","value":"54","unit":"V","time":"2016-01-01T00:11:14Z"} 
where:
FieldDescription
nameUnique name of the channel
valueValue of the data as integer, float or string
unitThe unit of the data
timeTimestamp of when the data was sampled

Data Push

Data is pushed to S2C.io using an HTTP POST request as follows:


payload: {"macaddr":"gateway macaddr here","api_version":"1.0.1","uptime":"0","sensorList":[ ... ]} 
url: developer.sensors2cloud.com (for free accounts), private(for paid accounts)
protocol: HTTP (for free accounts), HTTPS(for paid accounts)
request Type: POST
path: "/arduino" (for free accounts), private(for paid accounts)
Headers:
	"securekey": api key for gateway
	"macaddr": macaddr of gateway
	"Host": url
	"Content-type": "text/xml; charset=\"UTF-8\""
	"Content-length": length of payload
	   
			  

Example

Let's say we have one Gateway with a macaddr: DD:40:9D:CC:20:95. During registration with S2C.io, the gateway was assigned the API KEY: "XYZ". The Gateway is collecting data from two sensors: sensor0 and sensor1. sensor0 of type 'BCD' is composed of three channels: battery,distanceandcurrent. sensor1 of type 'PV' is composed of two channels: pressure,voltage

The sensors names must be unique. It is very important to sort the sensors by name and to sort channels by name. From Device Manager, under ToolBox, you could see how JSON data should look like.
The block diagram translates into the following JSON:
{"macaddr":"DD:40:9D:CC:20:95","api_version":"1.0.1","uptime":"0",
"sensorList":[{"name":"sensor0","type":"BCD","id":"aX55021","channels":
	[
		{"name":"battery","value":"5.15","unit":"V","time":"1970-01-01T00:11:14Z"},
		{"name":"current","value":"57","unit":"A","time":"1970-01-01T00:11:14Z"},
		{"name":"distance","value":"12.01","unit":"in","time":"1970-01-01T00:11:14Z"},
	]
},
{"name":"sensor1",,"type":"PV","id":"aX55022","channels":
	[
		{"name":"pressure","value":"5.15","unit":"PSI","time":"1970-01-01T00:11:14Z"},
		{"name":"voltage","value":"57","unit":"V","time":"1970-01-01T00:11:14Z"},
	]
}
]}
			  
			
The complete request is then as follows:

payload = "{"macaddr":"DD:40:9D:CC:20:95","api_version":"1.0.1","uptime":"0","sensorList":[
{"name":"sensor0","id":"aX55021","channels":
	[
		{"name":"battery","value":"5.15","unit":"V","time":"1970-01-01T00:11:14Z"},
		{"name":"distance","value":"12.01","unit":"in","time":"1970-01-01T00:11:14Z"},
		{"name":"current","value":"57","unit":"A","time":"1970-01-01T00:11:14Z"}
	]
},{"name":"sensor1","id":"aX55022","channels":
	[
		{"name":"pressure","value":"5.15","unit":"PSI","time":"1970-01-01T00:11:14Z"},
		{"name":"voltage","value":"57","unit":"V","time":"1970-01-01T00:11:14Z"}
	]
}]}"                         
protocol: HTTP
request Type: POST
path: "/arduino"
Headers:
	"securekey": 'XYZ'
	"macaddr": 'DD:40:9D:CC:20:95'
	"Host": 'developer.sensors2cloud.com'
	"Content-type": "text/xml; charset=\"UTF-8\""
	"Content-length": 552
           
The complete request in Python
url = "developer.sensors2cloud.com"
macaddr = "DD:40:9D:CC:20:95"
securekey = "aglzfm15czJjaW9yNQsSB0dhdGV3YXkiKHNsaW1Ac2VuA6MDA6NTUM"
payload = "{"macaddr":"DD:40:9D:CC:20:95","api_version":"1.0.1","uptime":"0","sensorList":[
{"name":"sensor0","id":"aX55021","channels":
	[
		{"name":"battery","value":"5.15","unit":"V","time":"1970-01-01T00:11:14Z"},
		{"name":"current","value":"57","unit":"A","time":"1970-01-01T00:11:14Z"},
		{"name":"distance","value":"12.01","unit":"in","time":"1970-01-01T00:11:14Z"}
	]
},
{"name":"sensor1","id":"aX55022","channels":
	[
		{"name":"pressure","value":"5.15","unit":"PSI","time":"1970-01-01T00:11:14Z"},
		{"name":"voltage","value":"57","unit":"V","time":"1970-01-01T00:11:14Z"}
	]
}]}"                         
webservice = httplib.HTTP(url,80)
webservice.putrequest("POST", "/arduino")
webservice.putheader("Content-type", "text/xml; charset=\"UTF-8\"")
webservice.putheader("Content-Length", len(payload))
webservice.putheader("Host", url)
webservice.putheader("securekey",securekey)
webservice.putheader("macaddr",macaddr)
webservice.endheaders()
webservice.send(payload)
# get the response
statuscode, statusmessage, header = webservice.getreply()
response_body = webservice.getfile().read()
# print the output to standard out
print (statuscode, statusmessage)

Introduction

Admin console is the main page you see once you login. As shown in screenshot below, the admin console is composed of a number of tools that are used to build internet of things applications. The tools are called "Managers". We will go in details through the various manager blocks.


				
			    

Device Manager

Device Manager handles the following:
- Add Gateway - Edit Gateway - ToolBox - Reboot - Get Data - Refresh - Remove Gateway - Help

Template Manager

Template Manager handles the following:
- Add Template - Edit Template - Run Template - Help

Application Manager

Application Manager handles the following:
- Add Application - Configuration - Upload your Company Logo - Edit Application - Run Application - Remove Application - Help

User Manager

User Manager handles the following:
- Add User - Edit User - Remove User - Help

IDE

IDE handles the following:
- Add Sensor - Add Asset - Edit Asset/Sensor - Delete Asset/Sensor - Refresh - Link Asset - Help

Add Gateway

To Add a new Gateway to your device list, click "Add Gateway".

After you click, you will have the choice of one following gateways:
- Digi Gateway: ConnectPort X is a family of gateways from Digi International
- Digi CTank: CTank is a level sensor from Digi International
- Embedded: This a virtual gateway that can be defined using API. see example 
- Arduino: The famous open source Hardware 
- Beaglebone
- Particle Core

After you select you gateway, you need to input:
- macaddr: the unique id of the gateway
- name: the unique of the gateway
- group: optional. used to group multiple gateways into logical groups

For example, let's add an Embedded called Test with a macaddr: 123456 
			    

Edit Gateway

To view information on a gateway, click "Edit Gateway". you can change the name and group at anytime. The rest of the information cannot be changed.


				

ToolBox

ToolBox is a set of tools that allow you change the configuration of your gateway. For version 1.0.1, there is only a sensors tool that allow you to manage sensors connected to your gateway.

click ToolBox, then click sensors: Sensors Manager will display and is composed of:
- Add Sensor: Add a new sensor to the selected gateway
- Edit Sensor: edit the sensor name and the sensor serial number
- Delete Sensor: remove the sensor from the list of sensors
- Refresh: refresh the List of sensors
- Asset Settings: Optional. change the settings of the asset linked with the sensor
- Link Asset: Optional. link an asset with the sensor
			

Reboot

reboot gateway if applicable.
			

Get Data

Get most recent channel data from the gateway.
			

Refresh

Refresh the list of gateways
			

Remove Gateway

remove the gateway 
			

Help

Help button gives a brief description of Device Manager
			
Templates allow you to build a web dashboard to visualize data collected from multiple gateways. Templates are the starting point for creating applications.

Add Template

click Add Template, then fill out:

Name: Unique name of the template
Description: Optional. Brief description of the template
Field: Optional. Market vertical			
			    

Edit Template

click edit template to modify the content of the template



Widgets

The List of widgets is as follows:

Display
Gauge
Line chart
Zoom chart
Table
History Table
Map
Image
			

Display

To Change the style, click style button:
To bind a Widget to a channel, click bind button:

Gauge


			

Line chart

The List of widgets is as follows:


			

Zoom chart

The List of widgets is as follows:


			

Table

The List of widgets is as follows:


			

History Table

The List of widgets is as follows:


			

Map

Coming Soon

Image

The List of widgets is as follows:


			

Run Template

API description, remarks


			

Help

API description, remarks


			

Add Application

API description, remarks


			    

Configuration

API description, remarks


			    

Upload Logo

API description, remarks


			    

Edit Application

API description, remarks


			    

Run Application

API description, remarks


				

Remove Application

API description, remarks


			

Help

API description, remarks


			

Add Alert

API description, remarks


			    

Add Timer

API description, remarks


			    

Edit Alert

API description, remarks


			    

Reset Alert

API description, remarks


			    

Acknowledge Alert

API description, remarks


			    

Refresh Alert

API description, remarks


				

Delete Alert

API description, remarks


			

Help

API description, remarks


			

Add User

API description, remarks


			    

Edit User

API description, remarks


				

Remove User

API description, remarks


			

Help

API description, remarks