Skip to content

Instantly share code, notes, and snippets.

View m2mIO-gister's full-sized avatar

Github User m2mIO-gister

View GitHub Profile
@m2mIO-gister
m2mIO-gister / kc_to_den_fast.json
Created January 8, 2015 23:15
ThingFabric Simulator File (less points, quicker trip)
[
{
"nms": 1420757530345,
"location": "39.09972,-94.57853",
"geoJSON": {
"type": "Point",
"coordinates": [
-94.57853,
39.09972
]
{
"title": "dunkforce",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
{
"title": "KCtoDEN",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
@m2mIO-gister
m2mIO-gister / kc_to_den.json
Last active August 29, 2015 14:07
ThingFabric Simulator File - KC to DEN
[
{
"nms": 1412638168724,
"location": "39.09972,-94.57853",
"geoJSON": {
"type": "Point",
"coordinates": [
-94.57853,
39.09972
]
@m2mIO-gister
m2mIO-gister / RangeFinder2lemetry.ino
Created November 12, 2013 05:15
Arduino Example - Rangefinder
#include <SPI.h>
#include <PubSubClient.h> // from http://knolleary.net/arduino-client-for-mqtt/
#include <Ethernet.h>
#include "Timer.h"
#define M2MIO_USERNAME "<username on 2lemetry platform>"
#define M2MIO_PASSWORD "<MD5 hash of password (32 characters)>"
#define M2MIO_DOMAIN "<domain on 2lemetry platform (found in developer portal)>"
#define M2MIO_STUFF "rangefinders"
#define M2MIO_DEVICE_ID "device1"
@m2mIO-gister
m2mIO-gister / MaKeyMaKeyMQTT.ino
Created September 26, 2013 22:38
Arduino sketch for reading MaKey MaKey digital output pins and sending them via MQTT.
#include <SPI.h>
#include <PubSubClient.h>
#include <WiFi.h>
#include <Timer.h>
#define M2MIO_USERNAME "<2lemetry platform username>"
#define M2MIO_PASSWORD "<MD5 hash of 2lemetry password>"
#define M2MIO_DOMAIN "<domain on 2lemetry platform>"
#define M2MIO_STUFF "arduino"
#define M2MIO_DEVICE_ID "teslamqtt"
@m2mIO-gister
m2mIO-gister / MessagePrinter.java
Created May 17, 2013 16:44
MqttClient With Message Queue
package io.m2m.simplemqttclient;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.eclipse.paho.client.mqttv3.MqttMessage;
public class MessagePrinter implements Runnable {
ConcurrentLinkedQueue<MqttMessage> myQ;
MessagePrinter(ConcurrentLinkedQueue<MqttMessage> q) {
myQ = q;
@m2mIO-gister
m2mIO-gister / license.js
Created April 11, 2013 17:45
m2m.io License
var text = '<br/><br/>Copyright © 2013 2lemetry, LLC<br/><br/>All rights reserved.<br/><br/>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:<br/><br/>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.<br/><br/>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.<br/><br/>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT O
@m2mIO-gister
m2mIO-gister / SimpleMqttClient.java
Last active June 3, 2022 05:40
Example MQTT Messaging in Java
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.MqttTopic;
public class SimpleMqttClient implements MqttCallback {
@m2mIO-gister
m2mIO-gister / Main.c
Last active July 23, 2018 18:34
2lemetry RTX Application
/****************************************************************************
* Program/file: Main.c
*
* Copyright (C) by RTX A/S, Denmark.
* These computer program listings and specifications, are the property of
* RTX A/S, Denmark and shall not be reproduced or copied or used in
* whole or in part without written permission from RTX A/S, Denmark.
*
* DESCRIPTION: Co-Located Application (COLA).
*