View Dockerfile
FROM ubuntu:16.04
MAINTAINER Ben Hardill <hardillb@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
USER root
RUN apt-get update && apt-get install -y \
pkg-config \
View Notes
Basic MQTT bridge can be found here:
https://github.com/hardillb/TRADFRI2MQTT
Bridge adds a mDNS entry for a COAP sever:
Service Type: _coap._udp
Service Name: gw:b0-72-bf-25-bf-59
Domain Name: local
Interface: wlan0 IPv4
View bridge.js
var http = require('http');
var util = require('util');
var postbodyheader = [
'<?xml version="1.0" encoding="utf-8"?>',
'<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">',
'<s:Body>'].join('\n');
var postbodyfooter = ['</s:Body>',
View ConvertedXML.xml
<?xml version="1.0" encoding="UTF-8"?>
<CreateGroup>
<GroupID>1489757700</GroupID>
<GroupName>Lighting Group</GroupName>
<DeviceIDList>94103EA2B278030F,94103EA2B27803ED</DeviceIDList>
<GroupCapabilityIDs>10008,10006,30008,30009,3000A</GroupCapabilityIDs>
<GroupCapabilityValues>255:0,0,,,</GroupCapabilityValues>
</CreateGroup>
View bridgeservice.xml
<?xml version="1.0"?>
<scpd xmlns="urn:Belkin:service-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<actionList>
<action>
<name>OpenNetwork</name>
<argumentList>
View SendMessage.html
<html>
<head>
<title>Push button, send message</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.js" type="text/javascript"></script>
</head>
<body>
<button onclick="sendMessage();">Push Me</button>
<script type="text/javascript">
var clientID = "ID-" + Math.round(Math.random() * 1000);
var client = new Paho.MQTT.Client(location.hostname, Number(location.port), clientID);
View gist:116e6b9c7d95021e2fdb
Verifying that +hardillb is my blockchain ID. https://onename.com/hardillb
View Wemo-Osram Lights capabilities
{ CapabilityProfileList:
{ CapabilityProfile:
[ { CapabilityID: [ '10006' ],
CapabilitySpec: [ 'ZigBee' ],
CapabilityProfileName: [ 'OnOff' ],
CapabilityAttrName: [ 'OnOff' ],
CapabilityDataType: [ 'IntegerSet' ],
CapabilityNameValue: [ '{Off:0,On:1,Toggle:2}' ],
CapabilityControl: [ 'RW' ] },
{ CapabilityID: [ '10008' ],
View wemo-control.js
var wemo = require('wemo-js');
var http = require('http');
var util = require('util');
var xml2js = require('xml2js');
var postbodyheader = [
'<?xml version="1.0" encoding="utf-8"?>',
'<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">',
'<s:Body>'].join('\n');
View MainActivity.java
package com.example.blemqtttest;
import java.io.UnsupportedEncodingException;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import com.example.blefuelmeter.R;
import android.app.Activity;