Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MyHomeMyData committed Jan 2, 2024
2 parents c8112c4 + 448b997 commit 8c604b7
Show file tree
Hide file tree
Showing 7 changed files with 285 additions and 99 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Important parts are based on the project [open3e](https://github.com/open3e).

A python based implementation of a pure listening approach using MQTT messaging is also availabe, see [E3onCAN](https://github.com/MyHomeMyData/E3onCAN).

**Present implementation is restricted on listening and reading via UDSonCAN (ReadByDid).** One of next steps will be implemention of UDSonCAN service WriteByDid.
**Present implementation supports reading and writing of datapoints via UDSonCAN (ReadByDid and WriteByDid).** Writing is restricted to raw data and numeric datapoints w/o sub structure.

During first start of adapter instance a device scan will be done providing a list of all available devices for configuration dialog.
A scan for datapoints of each device is also available.
Expand Down Expand Up @@ -84,8 +84,8 @@ You may use datapoints informations on tab "LIST OF DATAPOINTS" for reference (o

## What is different to open3e project?
* Obviously, the main differece is the direct integration to ioBroker. Configuration can be done via dialogs, data get's directly listed in object tree.
* WriteByDid is not supported yet. To come soon.
* Devices specific datapoints are not supported yet. A scan for datapoints per device (as depict tool of open3e is doing) is under development and hopefully comming soon.
* WriteByDid is supported for raw data and for numeric datapoints without sub structure under tree-view of objects. Writing of data is triggered by storing the datapoint with ack=false. The datapoint will be read again two seconds after writing.
* A scan for datapoints per device (as depict tool of open3e is doing) is available now. After a successful scan, device specific datapoints are listed in object tree.
* In addation to open3e real time collecting of data via listening is supported.

## May open3 be used in parallel?
Expand All @@ -101,7 +101,7 @@ Yes, that is possible under certain conditions:

### **WORK IN PROGRESS**
* This is beta stage!
* Implement WriteByDid
* Add writing for datapoints with complex structure.
* Improve usability for tab "LIST OF DATAPOINTS"

## License
Expand Down
2 changes: 1 addition & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"common": {
"name": "e3oncan",
"version": "0.4.3",
"version": "0.5.0",
"news": {
"0.0.1": {
"en": "initial release",
Expand Down
8 changes: 5 additions & 3 deletions lib/canCollect.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ class collect {
cntCommTimeout : 0, // Number of timeouts
cntCommBadProt : 0, // Number of bad communications
cntTooBusy : 0, // Number of conflicting calls of msgCollect()
nextTs : 0, // Timestamp for next storage (earliest)
tsMinStep : 5000 // Minimum time step between storages
};
}

async initStates(ctx, opMode) {
await this.storage.initStates(ctx, opMode);
this.stat.state = 'standby';
await this.storage.storeStatistics(ctx, this);
await this.storage.storeStatistics(ctx, this, true);
}

async onTimeout(ctxGlobal, ctxLocal) {
Expand All @@ -44,7 +46,7 @@ class collect {

async startup(ctx) {
this.stat.state = 'active';
await this.storage.storeStatistics(ctx, this);
await this.storage.storeStatistics(ctx, this, true);
this.data.collecting = false;
await this.storage.setOpMode('normal');
await ctx.log.info('Collect worker started on '+this.config.stateBase);
Expand All @@ -59,7 +61,7 @@ class collect {
this.timeoutHandle = null;

this.stat.state = 'stopped';
await this.storage.storeStatistics(ctx, this);
await this.storage.storeStatistics(ctx, this, true);

// Stop worker:
this.data.collecting = false;
Expand Down
Loading

0 comments on commit 8c604b7

Please sign in to comment.