This is the most basic flow. An inject node publishing to a debug node.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sts = require('../stsplatform'); | |
// Create a Client. | |
var client = new sts.Client(); | |
// Create a sensor object, referencing the client/ | |
var sensor = new sts.Sensors(client, 'calderonroberto.demo'); | |
// Get the sensor information (print the response code) | |
sensor.get().then(function(response){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sts = require('../stsplatform'); | |
// Create a Client. | |
var client = new sts.Client(); | |
// Create a sensor object, referencing the client/ | |
var sensor = new sts.Sensors(client, 'calderonroberto.demo'); | |
// Get the sensor information (print the response code) | |
sensor.get(null, function(error,response){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Require the stsplatform gem. Make sure to install it | |
# To install from source run: "bundle exec rake install" | |
# to install from RubyGems run : "gem install stsplatform" | |
require 'stsplatform' | |
# A sensor to use for this example. We will use | |
SENSOR_NAME = 'calderonroberto.demo' | |
# First, create a client that will handle all the REST calls | |
c = STSPlatform::Client.new() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import random | |
import stsplatform.client as sts | |
# You will need your credentials configured here. Read more here: | |
# http://wotkit.readthedocs.org/en/latest/api_v1/api_authentication.html#keys-and-basic-authentication | |
KEY_ID = '' | |
KEY_PASSWORD = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import stsplatform.client as sts | |
SENSOR_NAME = 'mike.yvr-arrive' | |
def main(): | |
conf = { | |
"url":"http://wotkit.sensetecnic.com/api", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Return an error if data is empty. | |
if (msg.payload.length === 0){ | |
msg.payload = {"error":"no data found"}; | |
return msg; | |
} | |
// Get the values as an array | |
var values = [] | |
var sensors = [] | |
msg.payload.map(function(element){ |
A public API endpoint using WoTKit data to compute average sensor values.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import httplib, urllib, base64, json | |
import pandas as pd | |
#TODO: ADD YOUR SENSOR NAME AND CREDENTIALS | |
SENSOR_NAME = 'mike.yvr-arrive' | |
USERNAME = 'YOURWOTKITUSERNAME' | |
PASSWORD = 'YOUROWOTKITPASSWORD' | |
HOST = 'wotkit.sensetecnic.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import httplib, urllib, base64, json | |
#TODO: ADD YOUR SENSOR NAME AND CREDENTIALS | |
SENSOR_NAME = 'mike.yvr-arrive' | |
USERNAME = 'YOURUSERNAME' | |
PASSWORD = 'YOURPASSWORD' | |
HOST = 'wotkit.sensetecnic.com' | |
auth = base64.encodestring('%s:%s' % (USERNAME, PASSWORD)).replace('\n', '') |