Code Monkey home page Code Monkey logo

node-enocean-esp2's People

Contributors

coolchip avatar dependabot[bot] avatar ekristoffe avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ekristoffe

node-enocean-esp2's Issues

Checksum verification issue with Eltako esp2 - solved

Hi,

I used your node red enocean esp2 package for over a year now. I had to modify it to get a good verification of all valid received data from my Eltako FGW14-USB gateway.

Regards

Lars

This is the diff:
diff --git a/parser.js b/parser.js
index d0db21b..380e935 100644
--- a/parser.js
+++ b/parser.js
@@ -83,11 +83,12 @@ const hexStringToByteArray = function (hex) {
return bytes;
};

-const verifyChecksum = function (buf, checksum) {
+const verifyChecksum = function (buf, checksum, hseq) {
let result = 0;
for (let index = 0; index < buf.length; index++) {

  •    result = (result + buf[index]) % 0xff;
    
  •    result = (result + buf[index]);
    
    }
  • result = result & 0xff;
    return result === checksum;
    };

@@ -100,7 +101,7 @@ const sliceBuffer = function (buf) {
telegram.org = buf.readUInt8(3);
telegram.payload = buf.slice(4, 4 + telegram.length - 2);
telegram.checksum = buf.readUInt8(4 + telegram.length - 2);

  • telegram.valid = verifyChecksum(buf.slice(2, 4 + telegram.length - 2), telegram.checksum);
  • telegram.valid = verifyChecksum(buf.slice(2, 4 + telegram.length - 2), telegram.checksum, telegram.hseq);
    telegram.dataBytes = telegram.payload.slice(0, 4).toString('hex');
    telegram.idBytes = telegram.payload.slice(4, 8).toString('hex');
    telegram.status = telegram.payload.readUInt8(8);
    @@ -233,4 +234,4 @@ const parse = function (buf) {
    return parsed;
    };

Usage example / documentation

I really want to use this nodes in nodered. I've been able to hook up the incoming node and am seeing telegram messages from the Eltako enocean bus, but want to know how to use the output node. How to send telegram messages (format in nodered), more concrete: how do I control actuators (f.e. fud14 dimmer) from nodered? How to receive feedback from the actuators?

If you could share an example nodered flow with a demonstration of the capabilities that would be great.

Thanks in advance!

Ps. I could not find any documentation. If there is any, a link to it will help me also.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.