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
#!/usr/bin/env python | |
import logging | |
import ubidots | |
import sys, os | |
logging.basicConfig(level=logging.INFO) | |
logger = logging.getLogger('openzwave') |
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
#!usr/bin/env lua | |
-- Loading main configuration | |
local config = require "config" | |
-- Library to read command output | |
local io = require "io" | |
-- Load the http module | |
local http = require "socket.http" |
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
// MQTT-Ubidots example using Grove Temperature Sensor v1.2 in A0 and Grove Relay on D6 (pin 12) | |
#include <PubSubClient.h> | |
#include <ESP8266WiFi.h> | |
#include <ESP8266WiFiMulti.h> | |
#define WIFISSID "wifi-ssid" | |
#define PASSWORD "IOT2016" | |
#define TOPIC1 "/v1.6/devices/motor/relay/lv" | |
#define TOPIC2 "/v1.6/devices/motor/temp" |
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
#!/usr/bin/env python | |
from geopy.geocoders import Nominatim | |
import sys | |
import json | |
def main(): | |
geolocator = Nominatim() | |
params = json.loads(sys.argv[1]) | |
location = geolocator.reverse((params['lat'],params['lng'])) |
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
from ubidots import ApiClient | |
import requests,time | |
from math import * | |
#Connect to Ubidots | |
api = ApiClient('a21ebaf64e14d195c0044fcxxb9f6dab9d653af3') | |
#Instantiate local variable from Ubidots |
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
import urllib2 | |
response = urllib2.urlopen('http://things.ubidots.com/api/v1.6/datasources?token=9xtbvHL8hFKxfkmlXUW3qNoUpOEZAtp0qkkwPqffbn6DiR3ElRJ4B5m1$ | |
data = response.read() | |
print data |
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
#!/usr/bin/env python | |
import time # Library for delays | |
import RPi.GPIO as GPIO # Library for using the GPIO ports | |
from math import log1p,exp,log10 # Library for math functions. No need for it if you'll get the raw data from the sensors | |
from ubidots import ApiClient # Ubidots Library | |
import Adafruit_DHT # Library from Adafruit to simplify the use of DHT sensor. | |
# Set up the SPI interface pins. Through SPI we can connect to the ADC MCP3008 | |
SPICLK = 18 |
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
#include <LWiFi.h> | |
#include <LWiFiClient.h> | |
#include <PubSubClient.h> | |
// These are the variables you will want to change based on your IOT data streaming account / provider | |
#define TOPIC "/v1.6/devices/YOUR-DEVICE-LABEL" | |
#define TOKEN "YOUR-UBIDOTS-TOKEN | |
#define WIFI_AP "UBIWIFI" | |
#define WIFI_PASSWORD "clave123456789ubi" |
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
/* | |
Web client | |
This sketch connects to a website through GPRS on LinkIt platform. | |
Specifically, | |
this example downloads the URL "http://arduino.cc/asciilogo.txt" and | |
prints it to the Serial monitor. | |
created 8 Mar 2012 | |
by Tom Igoe |
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
#!/usr/bin/python | |
""" | |
Get number of RSVPs for #Iot Day and send them to Ubidots | |
""" | |
__author__ = "Agustin Pelaez" | |
from sys import argv | |
import ubidots |
NewerOlder