Skip to content

Instantly share code, notes, and snippets.

@AgustinPelaez
AgustinPelaez / get_product_mercadolibre.py
Created March 30, 2014 04:42
Get product list for a specific search query in MercadoLibre.com, post the number of new items to the Ubidots Cloud
#!/usr/bin/python
"""
Get product list for a specific search query in MercadoLibre.com, post the number of new items to the Ubidots Cloud
"""
__author__ = "Agustin Pelaez"
from sys import argv
import ubidots
@AgustinPelaez
AgustinPelaez / wifly_http_test.ino
Created July 21, 2014 21:58
This script is based on the original wifly_http example contained in the library: https://github.com/Seeed-Studio/WiFi_Shield - It should send the value "1" to a variable in Ubidots, using the "Short Token" created in Ubidots' "My Profile" Section
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <WiFly.h>
#include "HTTPClient.h"
#define SSID "SEEED-MKT"
#define KEY "depot0510"
// WIFLY_AUTH_OPEN / WIFLY_AUTH_WPA1 / WIFLY_AUTH_WPA1_2 / WIFLY_AUTH_WPA2_PSK
#define AUTH WIFLY_AUTH_WPA2_PSK
@AgustinPelaez
AgustinPelaez / get_users.py
Created October 3, 2014 14:04
A custom script to pull data from Hubspot and send it to Ubidots
#!/usr/bin/python
"""
Get number of REAL users from Hubspot API, then post this data to Ubidots
"""
__author__ = "Agustin Pelaez"
from sys import argv
import ubidots
@AgustinPelaez
AgustinPelaez / post.ino
Created December 22, 2014 16:51
A people counter using Spark Core, Ubidots, and a manual DNS resolution (as some Spark Cores have a known issue when resolving DNS).
// This #include statement was automatically added by the Spark IDE.
#include "dnsclient/dnsclient.h"
// This #include statement was automatically added by the Spark IDE.
#include "HttpClient/HttpClient.h"
HttpClient http;
#define VARIABLE_ID "544e4a8f7625426e332bxxxx"
#define TOKEN "pSZJt9W7v5W3fpUsxxxxiDMgJ770NK"
int people = 0;
@AgustinPelaez
AgustinPelaez / CC3000_Ubidots.ino
Last active August 29, 2015 14:14
This code was made by Charles McClelland as an improvement for the Ubidots example for the CC3000 Breakout Board (http://ubidots.com/docs/devices/cc3000.html)
/* Chip McClelland - CC3000 Data Logger
BSD license, Please keep my name and credits in any redistribution
Requirements:
- Account on Ubidots. http://www.ubidots.com
- Sparkfun CC3000 Breakout Board - https://www.sparkfun.com/products/12072
- I used a 3.3V 8MHz Sparkfun Pro Micro - https://www.sparkfun.com/products/12587
Credits:
- Sparkfun Library and Example code from Shawn Hymel: https://github.com/sparkfun/SFE_CC3000_Library
- Ubidots Demo Code from: Mateo Velez for Ubidots,Inc. Modified 15 Nov 2014
@AgustinPelaez
AgustinPelaez / ubi-provisioning-example.ino
Last active August 29, 2015 14:19
This script gets your Spark Core's ID and creates a Ubidots data source with name = SparkID, so it can be later recognized. It's useful to provision hundreds or thousands of devices, without having to flash a different firmware to each device.
/*
This script gets the Spark Core's ID and creates a Ubidots data source with name = SparkID, so it can be later recognized.
Depending on the application, this code may be extended to:
- Create variables within the data source and get its IDs to post data to them later:
- Use the function "get_id" to get the Ubidots ID inside an API response
- See "Create a variable within a Data source" http://ubidots.com/docs/api/v1_6/data/post_datasources_id_variables.html
- Add the code inside the loop() function to read sensor data, send it to Ubidots, etc.
@AgustinPelaez
AgustinPelaez / wifly_http_ubi.ino
Created May 7, 2015 19:17
This is a test of the HTTP client code of the Seeedstudio Library for the RN171 Arduino Shield: https://github.com/Seeed-Studio/WiFi_Shield/tree/master/Examples/wifly_http
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <WiFly.h>
#include "HTTPClient.h"
#define SSID "SEEED-MKT"
#define KEY "depot0510"
// WIFLY_AUTH_OPEN / WIFLY_AUTH_WPA1 / WIFLY_AUTH_WPA1_2 / WIFLY_AUTH_WPA2_PSK
@AgustinPelaez
AgustinPelaez / webclient_ubidots.ino
Last active August 29, 2015 14:23
A test code for the Adafruit CC3000 breakout, based on their "WebClient.ino" example at: https://github.com/adafruit/Adafruit_CC3000_Library
/***************************************************
This is an example for the Adafruit CC3000 Wifi Breakout & Shield
Designed specifically to work with the Adafruit WiFi products:
----> https://www.adafruit.com/products/1469
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
<?xml version="1.0" encoding="utf-8" ?>
<Driver xmlns="http://code.google.com/p/open-zwave/" version="3" home_id="0x0184e19a" node_id="1" api_capabilities="8" controller_capabilities="8" poll_interval="30000" poll_interval_between="false">
<Node id="1" name="Hello name" location="Hello location" basic="2" generic="2" specific="1" type="Static PC Controller" listening="true" frequentListening="false" beaming="true" routing="false" max_baud_rate="40000" version="3" query_stage="Complete">
<Manufacturer id="0086" name="Aeon Labs">
<Product type="0002" id="0001" name="Z-Stick S2" />
</Manufacturer>
<CommandClasses>
<CommandClass id="32" name="COMMAND_CLASS_BASIC" version="1" after_mark="true">
<Instance index="1" />
<Value type="byte" genre="basic" instance="1" index="0" label="Basic" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
@AgustinPelaez
AgustinPelaez / post3vales.ino
Created July 16, 2015 23:06
Código WiDo - Mariano
/***************************************************
* This is an example for the DFRobot Wido - Wifi Integrated IoT lite sensor and control node
* Product Page & More info: http://www.dfrobot.com/index.php?route=product/product&product_id=1159
* Designed specifically to work with the DFRobot Wido products:
*
* The library is forked from Adafruit
*
* Contributed by James
* BSD license, all text above must be included in any redistribution
* Modified by Agustin Pelaez for Ubidots, Inc.