This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tsio App proerties Advanced/External JavaScript Libraries Add | |
// http://code.highcharts.com/highcharts.js | |
// JSON payload for real time | |
// sending a len = 1 adds single point to chart series | |
// v always an array | |
{ "lng": 1, "sn": "ENO-Temp-Test", "v": [ 1456330983567, 17.7 ] } | |
// creates a new sereries as lng >1 | |
{ "lng": 10, "sn": "ENO-Temp-Test", "v": [ { "value": 19, "jts": 1456057196556}, { "value": 19.1, "jts": 1456058242342}..]} | |
// lng calc coudl be done client side |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a very simple mDot LoRaWAN connection manager | |
var tx_wdog = {intv: 60000, counter:0, flag: false, sendingFlag: null, ts:null, tid:null}; | |
var con = {state:0, statePrevious: 0, cmd: null, msg: null, status: null, rx_msg: null, sendInt: 60000}; | |
var tx_string = ''; | |
var rx_string = ''; | |
var log = true; | |
function cLog(logMsg){ | |
var d = new Date(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dumpping ground for freagments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These are very basic Node-Red funtions I will in time convert to NR nodes. | |
They require the ENO300 USB module and use nr-serail-in | |
57600 8 None 1 | |
Split input: after fixed timeout 50ms | |
and deliver: binary buffers | |
I've done all my testing on Raspberry PI. | |
Please note the send switch funtion need you to set a Base ID to support 128 ID else it will only use the chip ID which means only 1 channel. That said any EnOcean-ers out thier that can help get chip ID working would love your help :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// v0.1 added else for testing | |
// expects binary lines like 55000A0701EBA500005B080088E4C20001FFFFFFFF4F0034 | |
if (msg.payload.length > 20) { | |
var m = msg.payload; | |
console.log("ping",m.length,m.toString('hex')); | |
if (m.charCodeAt(0) == 85) { | |
var l = m.charCodeAt(2) + m.charCodeAt(1)*256; | |
console.log("Len =",l); | |
var type = m.charCodeAt(4); | |
console.log("Type=",type); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// node-enocean v0.0 | |
CRC8Table = [ | |
0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, | |
0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, | |
0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, | |
0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d, | |
0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5, | |
0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd, | |
0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85, | |
0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//T5 Analog Outputs | |
const ON=1 | |
const OFF=0 | |
// Array that holds the state of each pin | |
pinState <- [ 0, 0, 0, 0, 0, 0]; | |
// Pins array channel 1 is channelPin[0] in array | |
Pins <- [ hardware.pin1, hardware.pin2, hardware.pin5, hardware.pin7, hardware.pin8, hardware.pin9 ]; | |
// Register imp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AGENT | |
server.log("Monitor MK2 Agent - release 3 v1.1 - Boot"); | |
// Holds imp config & status data | |
impObj <-{ | |
"sid": 42, | |
"lid": 50, | |
"t": "", | |
"tEng": "C", | |
"rh": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a bit of fun to show how device and sensor state is typical displayed on commercial SCADA | |
// systems used in manufacturing, process control and electricity grid control rooms. | |
// But using the Electric imp and HTML5 | |
//Imp & Agent are written in squirrel-lang.org They should have a .NUT extension. | |
//but I've used .js so the editor will use colour highlighting. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tutorial 3: T1 & T2 combined Electric imp April inputs & outputs from JQM web app | |
//Imp & Agent are written in squirrel-lang.org They should have a .NUT extension. | |
//but I've used .js so the editor will use colour highlighting. |
NewerOlder