1.0.1 • Published 7 years ago
node-esp3 v1.0.1
node-esp3
This is an implementation of the EnOcean Serial Protocol 3 (ESP3).
The EnOcean technology is an energy harvesting wireless technology used primarily in building automation systems, and is also applied to other applications in industry, transportation, logistics and smart homes. Modules based on EnOcean technology combine micro energy converters with ultra low power electronics, and enable wireless communications between batteryless wireless sensors, switches, controllers and gateways.
Installation
npm install node-esp3
Getting started
const esp3 = require('node-esp3');
...
const esp = new ESP3();
esp.open(function(err, packet) {
// do something with this packet
});
Config
The ESP3 constructor has a default config with the following attributes:
{
base: '00000000',
port: '/dev/ttyS3',
baudrate: 57600,
teachtime: 60,
autoOpen: true
}
You can modify them like whatever you want.
Packet
The packet which will be returned has multiple functions.
- getRaw() // Returns the raw packet as buffer
- getSyncByte() // Returns the sync byte
- getRawHeader() // Returns the raw header as buffer
- getHeader() // Returns the header
- getCrc8h() // Returns the crc8h checksum
- getRawData() // Returns the raw data as buffer
- getRawOptionalData() // Returns the raw optional data as buffer
- getOptionalData() // Returns the optional data
- getCrc8d() // Returns the crc8d checksum
Header
The header has the following attributes:
- dataLength
- optionalLength
- packetType // represented as hex string
Optional data
The optional data has the following attributes:
- subTelNum
- destinationId
- dBm
- securityLevel