Skip to content

Instantly share code, notes, and snippets.

/*
* Temperature Reading
*
* Reads sensor value and publishes through MQTT.
* MQTT Arduino PubSubClient http://knolleary.net/arduino-client-for-mqtt/
*
*/
#include <SPI.h>
#include <PubSubClient.h>
@justx1
justx1 / mosquitto.conf
Created October 2, 2013 08:19
Addition to mosquitto.conf for bridging MQTT brokers http://e.verything.co/post/62163759361/bridging-two-mqtt-brokers
connection cloudmqtt
try_private false
address broker.cloudmqtt.com:<port>
start_type automatic
username <your_username_here>
password <your_password_here>
clientid <any_clientid_here>
notifications true
@justx1
justx1 / MQTT2TempoDB.rb
Last active December 24, 2015 11:19
"Streaming" MQTT Sensor Data into TempoDB
require 'tempodb'
require 'mqtt'
# CloudMQTT connection parameters
# Creates a hash with the connection parameters from the cloudmqtt URL in .env, else from the localhost URL
uri = URI.parse ENV['CLOUDMQTT_URL'] || 'mqtt://localhost:1883'
mqtt_conn_opts = {
remote_host: uri.host,
remote_port: uri.port,
username: uri.user,