vbustouch-proxy: FileSystemRecorder is not a constructor

56 views
Skip to first unread message

Florian Loos

unread,
Dec 29, 2022, 6:58:27 AM12/29/22
to Resol Vbus
Hello all,

I would like to use mqtt to transfer the data sent by my Resol vbus LAN Adapter to my home automation system. The vbustouch-proxy seems to be the right tool to achive this. Unfortunately it throws an error on my ubuntu installation:

/home/flolo/resol-vbus/examples/vbustouch-proxy/index.js:66
const fsRecorder = new FileSystemRecorder({
                   ^

TypeError: FileSystemRecorder is not a constructor
    at Object.<anonymous> (/home/flolo/resol-vbus/examples/vbustouch-proxy/index.js:66:20)
    at Module._compile (node:internal/modules/cjs/loader:1120:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
    at Module.load (node:internal/modules/cjs/loader:998:32)
    at Module._load (node:internal/modules/cjs/loader:839:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

Node.js v18.7.0


I am not a developer. So any help or hint would be highly appreciated.

Thank you very much !
Florian

Daniel Wippermann

unread,
Dec 29, 2022, 7:03:32 AM12/29/22
to resol...@googlegroups.com
Hi Florian,

the resol-vbus repo has undergone quiet some changes lately, one of them being:


But I obviously forgot to adapt the vbustouch-proxy example to those changes, sorry about that.

The easiest way to work around this is to go back to an earlier commit and retry it:

cd /home/flolo/resol-vbus
git checkout 28f565d457f68176cc2ee0aa7a7058721e009731
npm install

The referenced commit (https://github.com/danielwippermann/resol-vbus/commit/28f565d457f68176cc2ee0aa7a7058721e009731) was before the removal of the Recorder functionality.

Best regards,
Daniel



--
You received this message because you are subscribed to the Google Groups "Resol Vbus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resol-vbus+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/resol-vbus/174c0c41-9c11-4884-8c3a-7ca306f94029n%40googlegroups.com.
Message has been deleted

Florian Loos

unread,
Dec 29, 2022, 5:05:05 PM12/29/22
to Resol Vbus
Hi Daniel,
thank you very much for your fast reply !
That did the trick. The error message has gone and after changing the host entry to  servers: [{ host: '192.168.xxx.xxx', port: xxxx }], the home automation system can receive values.

Nevertheless I see a lot of errors "undefined" on the command line. They appear at the exact intervall of the mqtt transmission. 

00_0010_7421_10_0100_045_1_8: Overpressure
00_0010_7421_10_0100_045_1_16: Flow rate error
error: undefined
debug: Connection state changed to INTERRUPTED
debug: Connection state changed to RECONNECTING
debug: Connection state changed to CONNECTED
error: undefined
error: undefined
error: undefined


Is there a way to find out where they come from?

Thanks and best regards,
Florian

Daniel Wippermann

unread,
Dec 30, 2022, 12:18:56 AM12/30/22
to resol...@googlegroups.com
Hi Florian,

yes, as you expected the messages originate as a result from the MQTT publish. „error: undefined“ means that no error occurred while publishing, so that is a good start.

But to get rid of these messages (or at least only show them when a real error occurred), you can change the following:

diff --git a/examples/vbustouch-proxy/index.js b/examples/vbustouch-proxy/index.js
index 62e0ad1..28c4e0b 100644
--- a/examples/vbustouch-proxy/index.js
+++ b/examples/vbustouch-proxy/index.js
@@ -487,7 +487,9 @@ const startMqttLogging = async () => {

if (payload) {
client.publish(config.mqttTopic, payload, err => {
- logger.error(err);
+ if (err) {
+ logger.error(err);
+ }
});
}
};


This is located at line 490 of the (unchanged) example. Just wrap the „logger.error…“ thing in a „if (err) { … }“ construct to only print the error message when one is passed over in the callback.

The reworked version of the vbustouch-proxy will have this fix incorporated as well.

Best regards,
Daniel






Daniel Wippermann

unread,
Dec 30, 2022, 3:45:38 AM12/30/22
to resol...@googlegroups.com
Hi Florian,

sorry, there is a second location where a similar fix must be applied:


hsc.on('headerSet', () => {
onHeaderSet(headerSetConsolidator, client).then(null, err => {
if (err) {
logger.error(err);
}
});
});

It is in the same file, just a couple of lines further down.

Best regards,
Daniel




Florian Loos

unread,
Dec 30, 2022, 5:07:12 AM12/30/22
to Resol Vbus
Hi Daniel !

Thank you very much! I will have a look. 
You know, I am not a developer so this might take a while to get it right :-).


Best regards,
Florian

Daniel Wippermann

unread,
Dec 30, 2022, 5:08:39 AM12/30/22
to resol...@googlegroups.com
Hi Florian,

okay, your second option is to wait a couple of hours, because I’m currently adapting that example to work without the FileSystemRecorder.

Best regards,
Daniel





Florian Loos

unread,
Dec 30, 2022, 5:11:54 AM12/30/22
to Resol Vbus
I'll go for the second option then :-)
It's more a hobby so not urgent at all.

Best regards,
Florian

Daniel Wippermann

unread,
Dec 30, 2022, 5:55:12 AM12/30/22
to resol...@googlegroups.com
Hi Florian,

the changes have been pushed to GitHub.

Please perform the following:

# Change to your checked out repo
cd /home/flolo/resol-vbus

# Discard any local changes done to this file
git restore examples/vbustouch-proxy/index.js

# Pull recent changes from GitHub and apply it to your local copy
git pull origin

# Rerun dependency installation since the package.json changed
npm install

After that the example should work without modification.

If you have any additional problem, don’t hesitate to get back to me.

Best regards,
Daniel







Florian Loos

unread,
Dec 30, 2022, 12:22:15 PM12/30/22
to Resol Vbus
Hi Daniel,

maybe I made a mistake with your instructions. I did receive the same error. So I started from scratch.
Now I have a new error message ...

00_0010_7421_10_0100_045_1_8: Overpressure
00_0010_7421_10_0100_045_1_16: Flow rate error
node:internal/fs/utils:348
    throw err;
    ^

Error: ENOENT: no such file or directory, open '/home/flolo/resol-vbus/examples/vbustouch-proxy/cache/20221230.vbus'
    at Object.openSync (node:fs:599:3)
    at Object.writeFileSync (node:fs:2221:35)
    at Object.appendFileSync (node:fs:2283:6)
    at VBusRecordingConverter.onReadable (/home/flolo/resol-vbus/examples/vbustouch-proxy/index.js:673:16)
    at VBusRecordingConverter.emit (node:events:513:28)
    at emitReadable_ (node:internal/streams/readable:590:12)
    at processTicksAndRejections (node:internal/process/task_queues:81:21)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at listOnTimeout (node:internal/timers:533:9)
    at process.processTimers (node:internal/timers:507:7) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/flolo/resol-vbus/examples/vbustouch-proxy/cache/20221230.vbus'
}

Node.js v18.7.0

Looking at the file system there is no "cache" directory.

Best regards,
Florian

Daniel Wippermann

unread,
Dec 30, 2022, 12:24:22 PM12/30/22
to resol...@googlegroups.com
Hi Florian,

please create that directory manually for now. The old FileSystemRecorder did create it on demand and so my working copy has this directory already, so I did not encounter that error. Just create it for now and I’ll update the example to do it automatically in a future release.

Best regards,
Daniel




Florian Loos

unread,
Dec 30, 2022, 12:33:18 PM12/30/22
to Resol Vbus
Ha, that was easy. Now running without error messages :-)
Thank you very much!

My next exercise will be trying to put this into a docker container so that it can run on my Synology....

Wishing you a happy new year and thanks again!

Best regards,
Florian

Daniel Wippermann

unread,
Dec 30, 2022, 12:34:40 PM12/30/22
to resol...@googlegroups.com
Hi Florian,

thanks for the feedback.

All the best wishes for the new year to you and your loved ones as well!

Best regards,
Daniel





Reply all
Reply to author
Forward
0 new messages