This file contains hidden or 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 paho.mqtt.client as paho | |
import RPi.GPIO as GPIO | |
import json, time | |
# device credentials | |
device_id = '<DEVICE_ID>' # * set your device id (will be the MQTT client username) | |
device_secret = '<DEVICE_SECRET>' # * set your device secret (will be the MQTT client password) | |
random_client_id = '<CLIENT_ID>' # * set a random client_id (max 23 char) | |
# -------------- # |
This file contains hidden or 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 <Adafruit_CC3000.h> | |
#include <ccspi.h> | |
#include <SPI.h> | |
#include <cc3000_PubSubClient.h> | |
// These are the interrupt and control pins | |
#define ADAFRUIT_CC3000_IRQ 3 | |
// These can be any two pins | |
#define ADAFRUIT_CC3000_VBAT 9 | |
#define ADAFRUIT_CC3000_CS 10 |
This file contains hidden or 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 <Adafruit_CC3000.h> | |
#include <ccspi.h> | |
#include <SPI.h> | |
#include <cc3000_PubSubClient.h> | |
// These are the interrupt and control pins | |
#define ADAFRUIT_CC3000_IRQ 2 | |
#define ADAFRUIT_CC3000_VBAT A3 | |
#define ADAFRUIT_CC3000_CS 8 | |
This file contains hidden or 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
// This #include statement was automatically added by the Spark IDE. | |
#include "mqtt.h" | |
PubSubClient::PubSubClient() { | |
this->_client = NULL; | |
} | |
PubSubClient::PubSubClient(uint8_t *ip, uint16_t port, void (*callback)(char*,uint8_t*,unsigned int), TCPClient& client) { // CH 14Jan2014 - Changed Client& to TCPClient& | |
this->_client = &client; |
This file contains hidden or 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
// yo | |
{ | |
"id": "526c4ff4d9464da9f800ff7f", | |
"contract": "rent", // rent | sale | |
"category": "residential", // residential | |
"typology": "apartment", // apartment | house | |
"sub_typology": [ // loft, attic, studio | |
"loft", | |
"attic" | |
], |