RaimondB / node-red-contrib-nefit-easy

Nefit Easy™ Node-RED Node
MIT License
2 stars 1 forks source link

Runtime error after updating my pi to Raspbian Bullseye #283

Closed hoekbrwr closed 1 year ago

hoekbrwr commented 2 years ago

I have trouble with node-red-contrib-nefit-easy2 after updating to Raspbian Bullseye

Now I have installed Raspbian Bullseye and I do not receive any messages. I updated to the latest version of the node! At startup I am connected to Bosch: 15 Jun 14:55:59 - [info] [nefit-easy-config:fbd2d7c20a44ddc8] Nefit Easy 820921714 connected to Bosch backend. 15 Jun 14:55:59 - [info] [nefit-easy-config:9979e7fc.470718] Nefit Easy 820921714 connected to Bosch backend. 15 Jun 14:55:59 - [info] [nefit-easy-config:fbd2d7c20a44ddc8] Nefit Easy software firmware version: 02.22.00 15 Jun 14:55:59 - [info] [nefit-easy-config:9979e7fc.470718] Nefit Easy software firmware version: 02.22.00

At the debug level I get this fault message: "TypeError: Cannot read property 'then' of undefined"

I tried a debug print and found the suspected place where there is coming an undefined value:

// Execute command and generate message
this.status({ fill: "yellow", shape: "ring", text: "communicating" });
this.log(this.easy.command(node.command, node.uri, node.value)); // added by me for debugging
this.easy.command(node.command, node.uri, node.value).then((data) => {

This is the output in the node-red-log: 15 Jun 19:29:33 - [info] [nefit-easy:f1db003101a45f3a] undefined 15 Jun 19:29:33 - [error] [nefit-easy:f1db003101a45f3a] TypeError: Cannot read properties of undefined (reading 'then')

I reinstalled the node but get warnings about deprecated node xmpp:

npm WARN deprecated node-xmpp-client@3.2.0: this package is deprecated please use https://www.npmjs.com/package/@xmpp/client npm WARN deprecated node-xmpp-core@5.0.9: this package is deprecated please use https://github.com/xmppjs/xmpp.js npm WARN deprecated node-xmpp-tls-connect@1.0.1: this package is deprecated please use https://github.com/xmppjs/xmpp.js

hoekbrwr commented 2 years ago

After a night's sleep, I realized I made a mistake in configuring the node! Now I am connected!. However, this mistake is not detected at deploying the node! If you forget to choose a command directly after inserting the node there is a blank command field. This happens only once, because after that when there is a value in the command field, it is not possible to have an empty command! This can easily be corrected by setting the initial value of command to ie "status"!

  RED.nodes.registerType("nefit-easy", {
    category: "function",
    color: "#999999",
    defaults: {
      easyconfig: { value: "", type: "nefit-easy-config" },
      name: { value: "" },
      topic: { value: "nefit-easy", required: true },
      command: { value: "status" },
      value: { value: "" },
    },