Skip to content

Instantly share code, notes, and snippets.

View IOT-123's full-sized avatar

IOT123 IOT-123

View GitHub Profile
@IOT-123
IOT-123 / assim-device.html
Created August 3, 2018 01:47
AssimilateCrouton WebComponent
<link rel="import" href="../static/common/bower/polymer/polymer.html" />
<link rel="import" href="crouton-card.html" />
<dom-module id="assim-device">
<template>
<link rel="stylesheet" href="../css/assim-device.css"/>
<link rel="import" href="../static/common/bower/paper-listbox/paper-listbox.html" />
<link rel="import" href="../static/common/bower/paper-item/paper-item.html" />
<!-- <link rel="import" href="../static/common/bower/iron-signals/iron-signals.html"> -->
<iron-signals on-iron-signal-hidecardsignal="_listenHideCardSignal"></iron-signals>
<link rel="import" href=".x./static/common/bower/paper-listbox/paper-listbox.html" onerror="corsLinkOnError(this.href)" />
<link rel="import" href=".x./static/common/bower/polymer/polymer.html" onerror="corsLinkOnError(this.href)" />
<link rel="import" href="crouton-card.htmxl" onerror="corsLinkOnError(this.href)" />
<link rel="import" href=".x./static/common/bower/paper-item/paper-item.html" onerror="corsLinkOnError(this.href)" />
<dom-module id="assim-weekview">
<template>
<link rel="stylesheet" href="assim-weekview.css" />
<crouton-card color="{{endPointJson.color}}">
<div class="dragger">
<div class="listbox_header">MON</div>
/*
*
*THE BUSINESS RULES FOR YOUR DEVICE ARE EXPECTED TO BE CONTROLLED VIA MQTT - NOT HARD BAKED INTO THIS FIRMWARE
*
* Other than setup and loop in this file
* the important moving parts are
* on_bus_received and on_bus_complete in static_i2c_callbacks.ino
* and
* mqtt_publish and mqtt_callback in static_mqtt.ino
*
@IOT-123
IOT-123 / deviceInfo.json
Created August 3, 2018 01:06
An example of the deviceInfo packet used for AssimilateCrouton: https://github.com/IOT-123/AssimilateCrouton
{
"deviceInfo": {
"endPoints": {
"CC_device": {
"device_name": "ash_mezz_A3",
"card-type": "assim-device",
"ssid": "Corelines_2",
"ip_addr": "192.168.8.104",
"endpoints": [
{
@IOT-123
IOT-123 / uno_i2c_command_input.ino
Created May 26, 2018 11:18
I2C BRICK adhoc commands for slaves from UNO master.
#include <Wire.h>
const byte _num_chars = 32;
char _received_chars[_num_chars]; // an array to store the received data
boolean _has_new_data = false;
void setup() {
Serial.begin(9600);
Serial.println();
Serial.println("ASSIMILATE IOT ACTOR/SENSOR EEPROM EDITOR");
@IOT-123
IOT-123 / assimilate_bus.cpp
Last active May 24, 2018 04:12
Collects data dumped from ASSIMILATE SENSORS and publihes to MQTT server.
/*
assimilate_bus.cpp - Library for i2c communication for assimilate iot network (via esp8266)
Created by Nic Roche, May 23, 2018.
Released into the public domain.
*/
#include <Wire.h>
#include "assimilate_bus.h"
AssimilateBus::Slave _defaultSlave = { 0, "SLAVE_DEFAULTS", AssimilateBus::ACTOR, "", 40000 };
@IOT-123
IOT-123 / attiny_i2c_mq2.ino
Last active May 23, 2018 03:07
IOT123 ATTINY85 I2C SLAVE AUTO-JOIN LAYER FOR SENSOR: MQ2
/*
*
* IOT123 ATTINY85 I2C SLAVE AUTO-JOIN LAYER FOR SENSOR: MQ2
*
* Take readings on MQ2 and send across wire on request via I2C in 3 segment 16byte packets
* ID of PROPERTY (set in _properties)
* VALUE of PROPERTY (set in getProperties)
* MORE TO COME (0/1 0 = last property)
*
* Pins on ATTINY85
@IOT-123
IOT-123 / attiny_i2c_dht11.ino
Last active May 21, 2018 23:46
IOT123 ATTINY85 I2C SLAVE AUTO-JOIN LAYER FOR SENSOR: DHT11. See: https://github.com/IOT-123/dht11_attiny_i2c
/*
*
* IOT123 ATTINY85 I2C SLAVE AUTO-JOIN LAYER FOR SENSOR: DHT11
*
* Take readings on DHT11 and send across wire on request via I2C in 3 segment 16byte packets
* ID of PROPERTY (set in _properties)
* VALUE of PROPERTY (set in getProperties)
* MORE TO COME (0/1 0 = last property)
*
* Pins on ATTINY85
@IOT-123
IOT-123 / attiny_i2c_assimilate_template.ino
Created May 12, 2018 04:15
SCAFFOLDING FOR ASSIMILATE SENSOR USING ATTINY85
/*
*
* IOT123 ATTINY85 I2C SLAVE AUTO-JOIN LAYER FOR SENSOR: XXX
*
* Take readings on XXX and send across wire on request via I2C in 3 segment 16byte packets
* ID of PROPERTY (set in _properties)
* VALUE of PROPERTY (set in getProperties)
* MORE TO COME (0/1 0 = last property)
*
* Pins on ATTINY85
@IOT-123
IOT-123 / uno_i2c_generic_sensor_test_w_plotter_v2.ino
Created May 12, 2018 02:31
I2C Master logging from I2C slave with plotter/metadata support.
#include <Wire.h>
#define ADDRESS_SLAVE 10
bool _outputPlotterOnly = false;
bool _confirmedMetadata = false;
int _packetSegment = 0;
bool _i2cNodeProcessed = false;
char _property[2][24] = {"name", "value"};