Skip to content

Instantly share code, notes, and snippets.

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)
# -------------- #
#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
#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
@andreareginato
andreareginato / mqtt.cpp
Last active August 29, 2015 14:07 — forked from bugduino/mqtt.cpp
// 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;
// yo
{
"id": "526c4ff4d9464da9f800ff7f",
"contract": "rent", // rent | sale
"category": "residential", // residential
"typology": "apartment", // apartment | house
"sub_typology": [ // loft, attic, studio
"loft",
"attic"
],