Giter VIP home page Giter VIP logo

node-enocean's Introduction

node-enocean's People

Contributors

holger-will avatar huwylphi avatar mwittig avatar nabbl avatar pascalmartin avatar tim-hellhake avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-enocean's Issues

Last value store improvements

When a known sensor is deleted, the corresponding history values are not... would be good to do this to prevent the value store from getting bloated in an environment with lots of changes.

Maybe a possibility to flush the complete history would be a good addition...

Input Node (TCM310) always returns "undefined"

after pausing for a view months I returned to my node-red config and updated all modules.
Now the input node will not return any message objects anymore.

The output node does work ...

Newbie question:Send on/off switch commands

The following is perhaps a bit off-topic: I have hardware switch and which I have registered with node-ocean using the learning mode. Besides this I have a smartplug which I have paired with the hardware switch. Question: Is it possible to send on/off commands from node-enocean (seeing it as a software representation of the hardware switch) to switch the smartplug?

Listener leak in memory.js

Symptom

If the same instance of the library is used with consecutive listen()/close() calls, there will be a listener leak on the main emitter (SerialPortListener). Node will soon complain:

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 data listeners added. Use emitter.setMaxListeners() to increase limit

Analysis

The listener is installed as a side effect of creating the 'Memory':

index.js

this.mem    = new Memory( this , { sensorFilePath : this.sensorFilePath, memoryDirectoryPath : config.memoryDirectoryPath } ) // initialize the Memory implementation used for learning an forgetting sensors. all meaningfull events are emitted there

memory.js

app.on( "data" , function( data ) {
    if ( knownSensors.hasOwnProperty( data.senderId )) { (...) }
(...)
}

Expected behavior

close()-ing the SerialPortListener should also cleanup any listener installed in listen().

store more than one last value

it would be usefull to store more than one last value... now that we use a real database this could possibly grow into an integrated logger... i have to test performance and storage requirements though...

maybe make the number of stored values configurable per sensor...

general eep decoder

work has begun on a generic eep decoder. this is the tracking bug for it.

create a Logo

would be nice to have a logo for node-enocean. Help very welcome

serialport error when deploying flow

I'm pretty new to that, so excuse me if there is already an answer in the other issues, but so far, I can't solve the problem.

When I try to deploy a flow using the enocean listener I'll emediately get alot of errors in the debug screen, saying the serialport binding could not be located. I guess that is a version/dependency thing?

What do I have to do to get it running? (described for a newbie)

Hoping for help and thanks in advance.
Thomas

Error: Could not locate the bindings file. Tried:
 → /home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/build/serialport.node
 → /home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/build/Debug/serialport.node
 → /home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/build/Release/serialport.node
 → /home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/out/Debug/serialport.node
 → /home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/Debug/serialport.node
 → /home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/out/Release/serialport.node
 → /home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/Release/serialport.node
 → /home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/build/default/serialport.node
 → /home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/compiled/10.15.1/linux/arm/serialport.node

Add A5-38-09

ich strebe gerade an, ein Deuta-Controls BL-201-00-868 UP Broadcast Modul über meinen EnOcean Pi und ihrem node-enocean Modul anzusteuern.
Ich habe ein Testscript (s.u.) geschrieben, das ich aufrufe, sobald ich den BL-201 in der Lernmdous versetzt habe:

var enocean = require("node-enocean")()
var Dimmer = require('node-enocean-dimmer');
enocean.listen("/dev/ttyAMA0")
enocean.on( "data" , function( data ) {  
    console.log( data )              
});
var dimmer = new Dimmer( enocean , 2 )
dimmer.teach( )

Leider habe ich bisher keinerlei Erfolg gehabt, ein Telegramm vom BL-201 einzusehen.
Ich erhalte die folgenden Fehlermeldungen:

(node:13528) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Port is not open

Kann es zusätzlich sein, dass ich den spezifischen EEP Resolver für EEP A5-38-09 benötige, um die potenziellen Nachrichten vom Deuta Modul verarbeiten zu können?

Listender doesn't get all telegrams

Hi,

Vor einiger Zeit habe ich einen Eltako Funktaster (EEP F6-02-03) installiert um einen Deuta Dimmer zu bedienen.
Da ich neben der Steuerung über den Taster auch "Alexa" zum schalten nutzen wollte, war mein Plan die Telegramme vom Taster per
enocean.on("data",function(data)
Zu capturen, dann an meine Daten(Geräte-Adresse) anzupassen und vom Raspi zu verschicken.

Dabei fiel mir auf, dass ich längst nicht alle Telegramme vom Taster aufnehmen konnte. Es werden jeweils push-Telegramme und Release Telegramme verschickt.
Ich musste auf einen anderen Serialport listener zurückgreifen, der mir das komplette Bild lieferte.

Könnt ihr euch erklären, woran das liegen kann?
Ist das u.U. Ein bekanntes Problem?

Upgrade serialport dependency

Any plans on upgrading the serialport dependency (to v6 or v7)? I'm getting a lot of deprecating warnings while compiling the native part of the library.

where to edit!!!!!!

Where shuld i put this code. i didnt find any placce in my node red to write this code

var enocean = require("node-enocean")();
enocean.listen("/dev/ttyUSB0");
enocean.on("data",function(data){
console.log(data)

});

Learn/Forget Mode glich

When the learn Mode is started and immediately stop and started again, the timer does not start anew, but instead the first timer is still used. should use clearTimeout when manually stopping the learn/forget mode

New eep A5-20-01

Hello,

I've just bought a new ubiwizz device which isa self-powered iTRV.

I've pushed as you described in the README the new eep in enocean eepResolver but I have no idea how to parse data received.

here it is whatis print when I try to learn the device :


  timestamp: 1544043543857,
  loadFromBuffer: [Function],
  rawByte: '55000a0701eba500307f08050ac9f60001ffffffff5f00da',
  packetType: 1,
  senderId: '050ac9f6',
  choice: 'a5',
  subTelNum: 1,
  destinationId: 'ffffffff',
  rssi: 95,
  securityLevel: 0,
  packetTypeString: '4BS',
  raw: '00307f08',
  learnBit: 1,
  sensor: 
   { id: '050ac9f6',
     eep: 'a5-20-01',
     title: 'New HVAC Components',
     desc: 'I\'m a new sensor...',
     eepFunc: 'HVAC Components',
     eepType: 'Battery Powerd Actuator (BI-DIR)' },
  values: { type: 'Battery Powerd Actuator (BI-DIR', value: '00307f08' },
  data: 
   { LRNB: 
      { name: 'LRN Bit',
        value: 1,
        desc: 'Data telegram',
        unit: undefined },
     SP: 
      { name: 'Valve position or Temperature Setpoint',
        value: NaN,
        unit: '% or °C' },
     TMP: 
      { name: 'Temperature  from RCU',
        value: 32.470588235294116,
        unit: '°C' },
     SPS: 
      { name: 'Set Point Selection',
        value: 1,
        desc: 'Temperature set point 0...40°C. Unit respond to room sensor and use internal PI loop.',
        unit: undefined },
     RCU: 
      { name: 'Select function',
        value: 1,
        desc: 'service on',
        unit: undefined } } }

Do you think you could help me to bring this device alive ? :)

(node) v8::ObjectTemplate::Set() with non-primitive values is deprecated

Hi,
I tried basic.js, it works but I got this message:

(node) v8::ObjectTemplate::Set() with non-primitive values is deprecated
(node) and will stop working in the next major release.

==== JS stack trace =========================================

Security context: 0x20e79031 <JS Object>#0#
    1: .node [module.js:568] [pc=0x2d97b344] (this=0x5d80aefd <an Object with map 0x3d50be8d>#1#,module=0x5d89e2e1 <a Module with map 0x3d50c179>#2#,filename=0x5d89e28d <String[70]: /home/pi/enocean/node_modules/serialport/build/Release/serialport.node>)
    2: load [module.js:458] [pc=0x2d941ad8] (this=0x5d89e2e1 <a Module with map 0x3d50c179>#2#,filename=0x5d89e28d <String[70]: /home/pi/enocean/node_modules/serialport/build/Release/serialport.node>)
    3: tryModuleLoad(aka tryModuleLoad) [module.js:417] [pc=0x2d9415a8] (this=0x20e080c9 <undefined>,module=0x5d89e2e1 <a Module with map 0x3d50c179>#2#,filename=0x5d89e28d <String[70]: /home/pi/enocean/node_modules/serialport/build/Release/serialport.node>)
    4: _load [module.js:409] [pc=0x2d93c55c] (this=0x5d80af75 <JS Function Module (SharedFunctionInfo 0x5831c779)>#3#,request=0x5d89dcd9 <String[70]: /home/pi/enocean/node_modules/serialport/build/Release/serialport.node>,parent=0x5d80aed5 <a Module with map 0x3d50c179>#4#,isMain=0x20e08161 <false>)
    5: require [module.js:468] [pc=0x2d94cb98] (this=0x5d80aed5 <a Module with map 0x3d50c179>#4#,path=0x5d89dcd9 <String[70]: /home/pi/enocean/node_modules/serialport/build/Release/serialport.node>)
    6: require(aka require) [internal/module.js:20] [pc=0x2d94c86c] (this=0x20e080c9 <undefined>,path=0x5d89dcd9 <String[70]: /home/pi/enocean/node_modules/serialport/build/Release/serialport.node>)
    7: bindings [/home/pi/enocean/node_modules/bindings/bindings.js:76] [pc=0x2d975d14] (this=0x20e8c34d <JS Global Object>#5#,opts=0x5835d0e9 <String[15]: serialport.node>)
    8: /* anonymous */ [/home/pi/enocean/node_modules/serialport/lib/bindings.js:3] [pc=0x2d9743e4] (this=0x5d80b099 <an Object with map 0x3da09de5>#6#,exports=0x5d80b099 <an Object with map 0x3da09de5>#6#,require=0x5d80afb9 <JS Function require (SharedFunctionInfo 0x583391b9)>#7#,module=0x5d80af4d <a Module with map 0x3d50c179>#8#,__filename=0x5d80b055 <String[56]: /home/pi/enocean/node_modules/serialport/lib/bindings.js>,__dirname=0x5d80b041 <String[44]: /home/pi/enocean/node_modules/serialport/lib>)
    9: _compile [module.js:541] [pc=0x2d94bd04] (this=0x5d80af4d <a Module with map 0x3d50c179>#8#,content=0x5d80b425 <String[784]\: 'use strict';\n\nvar bindings = require('bindings')('serialport.node');\nvar listUnix = require('./list-unix');\n\nvar linux = process.platform !== 'win32' && process.platform !== 'darwin';\n\nfunction listLinux(callback) {\n  callback = callback || function(err) {\n    if (err) { this.emit('error', err) }\n  }.bind(this);\n  return listUnix(callback);\n};\n\nvar platformOptions = {};\nif (process.platform !== 'win32') {\n  platformOptions = {\n    vmin: 1,\n    vtime: 0\n  };\n}\n\nmodule.exports = {\n  close: bindings.close,\n  drain: bindings.drain,\n  flush: bindings.flush,\n  list: linux ? listLinux : bindings.list,\n  open: bindings.open,\n  SerialportPoller: bindings.SerialportPoller,\n  set: bindings.set,\n  update: bindings.update,\n  write: bindings.write,\n  platformOptions: platformOptions\n};\n>,filename=0x5d80b055 <String[56]: /home/pi/enocean/node_modules/serialport/lib/bindings.js>)
   10: .js [module.js:550] [pc=0x2d9434d4] (this=0x5d80aefd <an Object with map 0x3d50be8d>#1#,module=0x5d80af4d <a Module with map 0x3d50c179>#8#,filename=0x5d80b055 <String[56]: /home/pi/enocean/node_modules/serialport/lib/bindings.js>)
   11: load [module.js:458] [pc=0x2d941ad8] (this=0x5d80af4d <a Module with map 0x3d50c179>#8#,filename=0x5d80b055 <String[56]: /home/pi/enocean/node_modules/serialport/lib/bindings.js>)
   12: tryModuleLoad(aka tryModuleLoad) [module.js:417] [pc=0x2d9415a8] (this=0x20e080c9 <undefined>,module=0x5d80af4d <a Module with map 0x3d50c179>#8#,filename=0x5d80b055 <String[56]: /home/pi/enocean/node_modules/serialport/lib/bindings.js>)
   13: _load [module.js:409] [pc=0x2d93c55c] (this=0x5d80af75 <JS Function Module (SharedFunctionInfo 0x5831c779)>#3#,request=0x5833d311 <String[10]: ./bindings>,parent=0x5d80b751 <a Module with map 0x3d50c179>#9#,isMain=0x20e08161 <false>)
   14: require [module.js:468] [pc=0x2d94cb98] (this=0x5d80b751 <a Module with map 0x3d50c179>#9#,path=0x5833d311 <String[10]: ./bindings>)
   15: require(aka require) [internal/module.js:20] [pc=0x2d94c86c] (this=0x20e080c9 <undefined>,path=0x5833d311 <String[10]: ./bindings>)
   16: /* anonymous */ [/home/pi/enocean/node_modules/serialport/lib/serialport.js:16] [pc=0x2d954554] (this=0x5d80b8bd <an Object with map 0x3da09de5>#10#,exports=0x5d80b8bd <an Object with map 0x3da09de5>#10#,require=0x5d80b799 <JS Function require (SharedFunctionInfo 0x583391b9)>#11#,module=0x5d80b751 <a Module with map 0x3d50c179>#9#,__filename=0x5d80b875 <String[58]: /home/pi/enocean/node_modules/serialport/lib/serialport.js>,__dirname=0x5d80b861 <String[44]: /home/pi/enocean/node_modules/serialport/lib>)
   17: _compile [module.js:541] [pc=0x2d94bd04] (this=0x5d80b751 <a Module with map 0x3d50c179>#9#,content=0x5d80ee2d <Very long string[13557]>#12#,filename=0x5d80b875 <String[58]: /home/pi/enocean/node_modules/serialport/lib/serialport.js>)
   18: .js [module.js:550] [pc=0x2d9434d4] (this=0x5d80aefd <an Object with map 0x3d50be8d>#1#,module=0x5d80b751 <a Module with map 0x3d50c179>#9#,filename=0x5d80b875 <String[58]: /home/pi/enocean/node_modules/serialport/lib/serialport.js>)
   19: load [module.js:458] [pc=0x2d941ad8] (this=0x5d80b751 <a Module with map 0x3d50c179>#9#,filename=0x5d80b875 <String[58]: /home/pi/enocean/node_modules/serialport/lib/serialport.js>)
   20: tryModuleLoad(aka tryModuleLoad) [module.js:417] [pc=0x2d9415a8] (this=0x20e080c9 <undefined>,module=0x5d80b751 <a Module with map 0x3d50c179>#9#,filename=0x5d80b875 <String[58]: /home/pi/enocean/node_modules/serialport/lib/serialport.js>)
   21: _load [module.js:409] [pc=0x2d93c55c] (this=0x5d80af75 <JS Function Module (SharedFunctionInfo 0x5831c779)>#3#,request=0x5833ae21 <String[10]: serialport>,parent=0x5d812341 <a Module with map 0x3d50c179>#13#,isMain=0x20e08161 <false>)
   22: require [module.js:468] [pc=0x2d94cb98] (this=0x5d812341 <a Module with map 0x3d50c179>#13#,path=0x5833ae21 <String[10]: serialport>)
   23: require(aka require) [internal/module.js:20] [pc=0x2d94c86c] (this=0x20e080c9 <undefined>,path=0x5833ae21 <String[10]: serialport>)
   24: /* anonymous */ [/home/pi/enocean/node_modules/node-enocean/index.js:16] [pc=0x2d952a6c] (this=0x5d812461 <an Object with map 0x3da09de5>#14#,exports=0x5d812461 <an Object with map 0x3da09de5>#14#,require=0x5d812389 <JS Function require (SharedFunctionInfo 0x583391b9)>#15#,module=0x5d812341 <a Module with map 0x3d50c179>#13#,__filename=0x5d812421 <String[51]: /home/pi/enocean/node_modules/node-enocean/index.js>,__dirname=0x5d81240d <String[42]: /home/pi/enocean/node_modules/node-enocean>)
   25: _compile [module.js:541] [pc=0x2d94bd04] (this=0x5d812341 <a Module with map 0x3d50c179>#13#,content=0x5d81526d <Very long string[11665]>#16#,filename=0x5d812421 <String[51]: /home/pi/enocean/node_modules/node-enocean/index.js>)
   26: .js [module.js:550] [pc=0x2d9434d4] (this=0x5d80aefd <an Object with map 0x3d50be8d>#1#,module=0x5d812341 <a Module with map 0x3d50c179>#13#,filename=0x5d812421 <String[51]: /home/pi/enocean/node_modules/node-enocean/index.js>)
   27: load [module.js:458] [pc=0x2d941ad8] (this=0x5d812341 <a Module with map 0x3d50c179>#13#,filename=0x5d812421 <String[51]: /home/pi/enocean/node_modules/node-enocean/index.js>)
   28: tryModuleLoad(aka tryModuleLoad) [module.js:417] [pc=0x2d9415a8] (this=0x20e080c9 <undefined>,module=0x5d812341 <a Module with map 0x3d50c179>#13#,filename=0x5d812421 <String[51]: /home/pi/enocean/node_modules/node-enocean/index.js>)
   29: _load [module.js:409] [pc=0x2d93c55c] (this=0x5d80af75 <JS Function Module (SharedFunctionInfo 0x5831c779)>#3#,request=0x58338d51 <String[3]: ../>,parent=0x5d81801d <a Module with map 0x3d50c179>#17#,isMain=0x20e08161 <false>)
   30: require [module.js:468] [pc=0x2d94cb98] (this=0x5d81801d <a Module with map 0x3d50c179>#17#,path=0x58338d51 <String[3]: ../>)
   31: require(aka require) [internal/module.js:20] [pc=0x2d94c86c] (this=0x20e080c9 <undefined>,path=0x58338d51 <String[3]: ../>)
   32: /* anonymous */ [/home/pi/enocean/node_modules/node-enocean/examples/basic.js:1] [pc=0x2d94c138] (this=0x5d818125 <an Object with map 0x3da09de5>#18#,exports=0x5d818125 <an Object with map 0x3da09de5>#18#,require=0x5d818065 <JS Function require (SharedFunctionInfo 0x583391b9)>#19#,module=0x5d81801d <a Module with map 0x3d50c179>#17#,__filename=0x5d8180dd <String[60]: /home/pi/enocean/node_modules/node-enocean/examples/basic.js>,__dirname=0x5d8180c9 <String[51]: /home/pi/enocean/node_modules/node-enocean/examples>)
   33: _compile [module.js:541] [pc=0x2d94bd04] (this=0x5d81801d <a Module with map 0x3d50c179>#17#,content=0x5d818419 <String[634]\: var enocean = require( "../" )();  // require node-enocen\n// start listening on the serialport \n// if you use the enocean pi on a raspberry pi use:\n// enocean.listen("/dev/ttyAMA0")\n// on Windows use:\n// enocean.listen("COM1") or whatever COM-port you are connected\nenocean.listen( "/dev/ttyUSB0" ); \n\nenocean.on( "data" , function( data ) {   // a telegram has been received\n\x09console.log( data );               // log it to the console\n\x09console.log(data.choice);\n\x09console.log(data.packetTypeString);\n\x09console.log(data.raw);\n  if (data.choice === "a5") {\n    var ar = enocean.getData("a5-02-05",data.raw)\n    console.log(ar);\n  }\n});\n>,filename=0x5d8180dd <String[60]: /home/pi/enocean/node_modules/node-enocean/examples/basic.js>)
   34: .js [module.js:550] [pc=0x2d9434d4] (this=0x5d80aefd <an Object with map 0x3d50be8d>#1#,module=0x5d81801d <a Module with map 0x3d50c179>#17#,filename=0x5d8180dd <String[60]: /home/pi/enocean/node_modules/node-enocean/examples/basic.js>)
   35: load [module.js:458] [pc=0x2d941ad8] (this=0x5d81801d <a Module with map 0x3d50c179>#17#,filename=0x5d8180dd <String[60]: /home/pi/enocean/node_modules/node-enocean/examples/basic.js>)
   36: tryModuleLoad(aka tryModuleLoad) [module.js:417] [pc=0x2d9415a8] (this=0x20e080c9 <undefined>,module=0x5d81801d <a Module with map 0x3d50c179>#17#,filename=0x5d8180dd <String[60]: /home/pi/enocean/node_modules/node-enocean/examples/basic.js>)
   37: _load [module.js:409] [pc=0x2d93c55c] (this=0x5d80af75 <JS Function Module (SharedFunctionInfo 0x5831c779)>#3#,request=0x5d8186b1 <String[60]: /home/pi/enocean/node_modules/node-enocean/examples/basic.js>,parent=0x20e08081 <null>,isMain=0x20e08129 <true>)
   38: runMain [module.js:575] [pc=0x2d93bfb8] (this=0x5d80af75 <JS Function Module (SharedFunctionInfo 0x5831c779)>#3#)
   39: startup(aka startup) [node.js:160] [pc=0x43143864] (this=0x20e080c9 <undefined>)
   40: /* anonymous */(aka /* anonymous */) [node.js:449] [pc=0x43140f74] (this=0x20e08081 <null>,process=0x20e888d5 <a process with map 0x3da0e8a9>#20#)

I'm running node v6.3.1 on a Raspberry Pi 2, Jessie 4.4.9 v7.

Any idea?

Use levelDB for known sensors as well

look into the possibility to use levelDB as storage for known sensors as well.

Having a hand editable file is convenient in some situations, but most users will never edit a file by hand...
Maybe make the value store (levelDB or file) and option...

How can we send data to a device

I've tryied to use the node-enocean-button to send to my "F6" device but I don't understand how does it work ?

I don't see where I define the Id of the targeted device ?

implement node-enocean.js to node red

Hello everybody,

I am completely new to programming and to Github also. I just want to implement a node red flow beeing able to decode lots of Enocean EEPs. My hardware is a raspberry Pi and the tcm310 enocean gateway. In fhem i can see that everything is working. My plan is to get the sensor data to ms azure. I think node red would be the best choice for a beginner like me. Now i integrated node-enocean to node red (via global context). But lots of the funktins like enocean.on or enocean.listen do not work in the function node. I know that there exist already Enocean-nodes for node red but the enocean-node.js can handle more EEPs and i want to be flexible in choosing sensors.

I am looking forward to your answers!

Thank you very much.

Johannes

startLearning is not working

Hi,

I run enocean pi on a raspberry pi 2. I make a connection to my own server using socket.io. On the server, I can call an endpoint that should set the enocean pi in learning mode.

In your documentation you refer to startLearning(). When I use this, I get the exception that startLearning()is not a function. When I call just startLearning I don't have this problem. I placed an console.log() just before the startLearning call and can verify that it will get executed.

Unfortunately, no new sensors will be recognized and the learned event will never be executed.

This is the code where I call startLearning

socket.on('startLearning', function(data, callback) {

console.log("Learning new sensors..");

enocean.startLearning;

enocean.on('learned', function(d) {
    console.log("I'm done learning new sensors..");
    callback(null, d);
});

});
`

the enocean.on() call is also placed outside the socket.on() call, but without any effect.
configuration:

  • timeout: 30
  • config file path: __dirname + /data/config.json
  • sensor file path: __dirname + /data/sensors.json

support for ttyS0 on raspberry pi 3

Hello ,

Thanks again for providing this great npm .

It worked perfectly on my raspberry pi when I used the EnOcean USB dongle and accessed the data through ttyUSB0

However , I currently trying to use the enocean pi . I'm using raspberry pi 3 , therefore the ttyAMA0 is used the the built in BLE . So the the EnOcean pi is on ttyS0.

I tested the basic code which is :

var enocean      = require("node-enocean")();
enocean.listen("/dev/ttyS0");
enocean.on("data",function(data){   
    console.log(data)
});

it only works for a few seconds and then doesn't console log any thing after that . Any ideas for why this is happening ?

Config is now broken

Apparently, the recent fixes in 3.2.0 broke the configuration. I can't even initialize the module now. It seems the memory module is now initialized with memoryDirectoryPath set to undefined, which causes the default paths to not be applied.
The config object looks as follows:

{ sensorFilePath: 'D:\\test\\node-enocean-bug\\node_modules\\node-enocean/modules/knownSensors.json',
  memoryDirectoryPath: undefined }

which causes config.hasOwnProperty to succeed.

The fix is rather easy, change line 31 to

var memoryDir = config.memoryDirectoryPath || path.join(__dirname,"../memory")

and line 34 should probably be changed the same way for good measure.

Code errors when running: node index.js

Hi,

Code doesn't seem to work. I get syntax errors (at least on windows ...)

Code in question:
index.js:

socket.on( "get-last-sensor-value" , async function( id ) {
			socket.emit("last-sensors-value", await this.getLastValues( id ) ) // returns info for one single sensor

memory.js

	app.getLastValues = async function(id){
		return await getLastData(id)
	}

Error : enocean.startLearning is not a function

I'm trying to use tge startLearning function but its giving me the following error :

TypeError: enocean.startLearning is not a function

this is the code :

var enocean = require("node-enocean")();
enocean.listen("/dev/ttyUSB0");
enocean.startLearning()
enocean.on("learned",function(data){   
    console.log(data)
});

Syntax error when loading 2.0.0

Node 6.10.0, Raspberry pi, Debian Jessy.
Found ES7 syntax in source files which are not supported in Node below 7.x
Dodged issue by modifying my package.json.

It would be great if environment requirement is updated.

TypeError

I am trying to use your node with a wrapper from someone else and I am seeing the following error when I start Node-red. I have a Raspberry Pi3 with Enocean PI and configured for ttyS0. This causes Node-red to crash repeatedly and I have to stop it, edit the flow file to remove the node and then restart it.

22 Oct 14:17:46 - [red] Uncaught Exception:
22 Oct 14:17:46 - TypeError: offset is not uint
at TypeError ()
at checkInt (buffer.js:786:11)
at Buffer.writeInt16BE (buffer.js:908:5)
at ESP3Packet.getRawBuffer (/home/pi/.node-red/node_modules/serialport-enocean-parser/ESP3Packet.js:56:20)
at SerialPortListener. (/home/pi/.node-red/node_modules/node-enocean/index.js:73:23)
at SerialPort.emit (events.js:95:17)
at emitFetchedESP3Packet (/home/pi/.node-red/node_modules/serialport-enocean-parser/ESP3Parser.js:144:11)
at fetchCRC8ForDataAndCheck (/home/pi/.node-red/node_modules/serialport-enocean-parser/ESP3Parser.js:134:3)
at ESP3.tryToFillPackets (/home/pi/.node-red/node_modules/serialport-enocean-parser/ESP3Parser.js:29:4)
at Object.module.exports as parser
at SerialPort.settings.dataCallback (/home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/lib/serialport.js:147:14)
at SerialPort._emitData (/home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/lib/serialport.js:350:18)
at SerialPort. (/home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/lib/serialport.js:330:14)
at SerialPort. (/home/pi/.node-red/node_modules/node-enocean/node_modules/serialport/lib/serialport.js:343:7)
at Object.wrapper as oncomplete
nodered.service: main process exited, code=exited, status=1/FAILURE

Forgetting devices corrupts knownSensors.json

After forgetting a known sensor, knownSensors.json becomes corrupted. Steps to reproduce:

  1. rm knownSensors.json
  2. start the driver. knownSensors.json now contains {}
  3. learn a device. The file now contains
{
    "fefcce76": {
        "id": "fefcce76",
        "eep": "f6-02-03",
        "manufacturer": "unknown",
        "title": "New RPS Switch",
        "desc": "I'm a new sensor...",
        "eepFunc": "Rocker Switch, 2 Rocker",
        "eepType": "Light Control - Application Style 1"
    }
}
  1. forget the device. Now the file contains
{}    "fefcce76": {
        "id": "fefcce76",
        "eep": "f6-02-03",
        "manufacturer": "unknown",
        "title": "New RPS Switch",
        "desc": "I'm a new sensor...",
        "eepFunc": "Rocker Switch, 2 Rocker",
        "eepType": "Light Control - Application Style 1"
    }
}

Notice how the old contents don't get deleted.

  1. restarting the driver now fails with
SyntaxError: /opt/iobroker/node_modules/node-enocean/modules/knownSensors.json: Unexpected string in JSON at position 6
at JSON.parse ()

node-enocean does not work with node 10

node-enocean pulls in level ^1.6. The 1.x branch of level (actually leveldown) is not compatible with the current LTS of node (10.x). The dependency should be upgraded if possible. Alternatively, the dependency should be optional - level db is only used to remember nodes using teach-in. This functionality is not required to use the library (at least I don't use it :) )

multible telegram types for single address

Hello,

I'm trying to use this node module for my enocean devices but it's quite hard for me to understand how to work with.

I'm using a web app (Gladys project) and trying to integrate node-enocean as a plugin.

First of all, I see that I need to save/dump device on a json file, that's what I successfully did. By the way once device are learned, I'll need to save it in mysql db.

As I move step by step, I see that when I've learned device by hand, I see the device are "known" but the last values are not returned correctly :

last value: { timestamp: 1509808560835,
  rawByte: '55000707017af6000190503b2004ffffffff5600fc',
  packetType: 1,
  senderId: '0190503b',
  choice: 'f6',
  subTelNum: 4,
  destinationId: 'ffffffff',
  rssi: 86,
  securityLevel: 0,
  raw: '00',
  packetTypeString: 'RPS',
  sensor: 
   { id: '0190503b',
     eep: 'd2-01-0a',
     desc: 'actuator',
     manufacturer: 'Nodon' },
  values: [ { type: 'unknown', unit: 'unknown', value: 'unknown' } ] }

What am I doing wrong ?

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.