Skip to content

Instantly share code, notes, and snippets.

// This #include statement was automatically added by the Particle IDE.
#include "Adafruit_DHT/Adafruit_DHT.h"
// This example is to save multiple variables to the Ubidots API with TCP method
#include "Ubidots/Ubidots.h"
#define TOKEN "xxxxxxxxx" // Put here your Ubidots TOKEN
[{"id":"e7d65ffe.dc95b","type":"tcp out","host":"translate.ubidots.com","port":"9010","beserver":"client","base64":false,"end":true,"name":"","x":692,"y":304,"z":"7ee6d1fa.eba47","wires":[]},{"id":"5373d534.c169dc","type":"debug","name":"","active":true,"console":"false","complete":"true","x":716,"y":213,"z":"7ee6d1fa.eba47","wires":[]},{"id":"5cd55ff8.a58da","type":"function","name":"Function Ubidots","func":"var TOKEN = \"Your_Token_Here\";\nvar USER_AGENT = \"mDot/1.0\";\nvar dsTag = msg.eui.split(\":\");\nvar DATA_SOURCE_TAG = \"\";\nfor (var j = 0; j < dsTag.length; j++) {\n DATA_SOURCE_TAG += dsTag[j];\n}\nvar data = {};\n\n// Header\ndata.payload = USER_AGENT+\"|POST|\"+TOKEN+\"|\"+DATA_SOURCE_TAG+\"=>\";\n\n// Body\ndata.payload = data.payload + msg.payload;\n\n// Footer\ndata.payload = data.payload + \"|end\";\nreturn data;","outputs":1,"noerr":0,"x":448,"y":212,"z":"7ee6d1fa.eba47","wires":[["e7d65ffe.dc95b","5373d534.c169dc"]]},{"id":"276173d.05dd28c","type":"lora in","name":"","datatype":"utf8"
@ubi-gists
ubi-gists / Send-data.js
Created June 21, 2016 21:00
How to send data to MultiTech MultiConnect Conduit
// Single value
"Variable_Name:Variable_value"
// Multiple values
"Variable_Name_1:Variable_value_1,Variable_Name_2:Variable_value_2,Variable_Name_3:Variable_value_3"
#include <SODAQMdot.h>
// Put here your SSID of lora gateway
#define GATEWAY_SSID "Your_Lora_Gateway_SSID"
// Put here your PASS of lora gateway
#define GATEWAY_PASS "Your_Lora_Gateway_PASS"
// Put here your frequenci sub-band of lora gateway
#define GATEWAY_SUB_BAND "1"
Ubidots loraClient;
// This example allow send data using UDP protocol
#include "Ubidots/Ubidots.h"
#define TOKEN "CCN8FrVulRYGulPTkbxxxxxxxxxxxxx" // Put here your Ubidots TOKEN
#define LED D0
#define VARIABLE_NAME "DUST"
#define DATA_SOURCE_LABEL "waveshare-dust-sensor"
#define DATA_SOURCE_NAME "Waveshare Dust Sensor"
/*
* The sample code requires the ESP8266 v.2.0.0 library for proper operation.
* (https://github.com/ubidots/ubidots-esp8266/releases/tag/2.0.0)
* However, is strongly recommended to migrate the code to the latest library version.
* (https://github.com/ubidots/ubidots-esp8266)
*/
#include "UbidotsMicroESP8266.h"
#include "DHT.h"
#include <Wprogram.h>
#include <Wire.h>
#include <WiFiShieldOrPmodWiFi_G.h>
#include <DNETcK.h>
#include <DWIFIcK.h>
#include <LedControl.h>
//------------------------------End Librarys----------------------------------
#define GREEN 0
#define RED 1
/*
Ejemplo para Dispensador de comidas para mascotas
Este codigo es para controlar el servo
del dispensador de alimentos para mascotas
Arduino pins:
5V --> cable rojo del servo
GND --> cable negro del servo
// MPU-6050 Short Example Sketch
// By Arduino User JohnChi
// Modified by Mateo Vélez - Metavix
#include <ubidots_arduinoYUN.h>
#include <Process.h>
#include<Wire.h>
const int MPU=0x68; //dirección I2C del MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;

Send data to Ubidots using RN131

Communicate with the RN131 module through the serial port. Plug your device to your computer and open a serial terminal.

The speed must be 9,600 bauds, then enter the following commands in the serial terminal. You should type the string “$$$” before each set of commands to enter the command mode:

Command set #1: