Comments (9)
Do I see that correctly, that problem occurs in this case with Node-RED?
Can you give me more details about the circumstances under which this occurs?
from ecovacs-deebot.js.
Yes, correct.
I can extract the nodes and provide them if needed. But it's basically just data retrieval which is parsed then by node-red.
I've no clue yet which message crashed it. For the time being i added a try catch around it and some console.error things to get more details.
from ecovacs-deebot.js.
Here we go:
First again the stacktrace:
TypeError: Cannot read properties of undefined (reading 'data')
at EcovacsMQTT_JSON.handleMessage (/data/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:94:32)
at MqttClient.<anonymous> (/data/node_modules/ecovacs-deebot/library/ecovacsMQTT.js:73:18)
at MqttClient.emit (node:events:527:28)
at MqttClient._handlePublish (/data/node_modules/mqtt/lib/client.js:1547:12)
at MqttClient._handlePacket (/data/node_modules/mqtt/lib/client.js:535:12)
at work (/data/node_modules/mqtt/lib/client.js:438:12)
at Writable.writable._write (/data/node_modules/mqtt/lib/client.js:452:5)
at doWrite (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:409:139)
at writeOrBuffer (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:398:5)
at Writable.write (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:307:11)
at TLSSocket.ondata (node:internal/streams/readable:754:22)
at TLSSocket.emit (node:events:527:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
This is the message which caused the crash:
{ td: 'GetIOTConnStatus', on: 1, conn: 2, ip: '3.127.110.57' }
This is my modification to the code for reference:
try {
if (type === "incoming") {
eventName = topic.split('/')[2];
message = JSON.parse(message);
payload = message['body']['data']; //<-- crashing here
} else if (type === "response") {
resultCode = message['body']['code'];
resultCodeMessage = message['body']['msg'];
payload = message['body']['data'];
if (message['header']) {
const header = message['header'];
if (this.vacBot.firmwareVersion !== header['fwVer']) {
this.vacBot.firmwareVersion = header['fwVer'];
this.emit('HeaderInfo', {
'fwVer': header['fwVer'],
'hwVer': header['hwVer']
});
}
}
} else if (type === "logResponse") {
resultCodeMessage = message['ret'];
}
}
catch (error) {
console.error(error)
console.error(message)
}
from ecovacs-deebot.js.
This is the message which caused the crash:
{ td: 'GetIOTConnStatus', on: 1, conn: 2, ip: '3.127.110.57' }
Where did you log this message and was it caused by sending a command?
I think a message with this structure is a bit unusual.
from ecovacs-deebot.js.
The output ist from the second console.error statement within the catch. The stack trace is from the first console.error Statement.
from ecovacs-deebot.js.
This is the screenshot of the Deebot node which is causing that crash. So I just use it as input - till now I've never send a command to the node.
from ecovacs-deebot.js.
So after several days of running: It doesn't crash nodered anymore. However I see on a irregular basis these stacktraces in the error log:
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) TypeError: Cannot read properties of undefined (reading 'data')
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at EcovacsMQTT_JSON.handleMessage (/data/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:94:32)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at MqttClient.<anonymous> (/data/node_modules/ecovacs-deebot/library/ecovacsMQTT.js:73:18)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at MqttClient.emit (node:events:527:28)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at MqttClient._handlePublish (/data/node_modules/mqtt/lib/client.js:1547:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at MqttClient._handlePacket (/data/node_modules/mqtt/lib/client.js:535:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at work (/data/node_modules/mqtt/lib/client.js:438:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at Writable.writable._write (/data/node_modules/mqtt/lib/client.js:452:5)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at doWrite (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:409:139)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at writeOrBuffer (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:398:5)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at Writable.write (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:307:11)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at TLSSocket.ondata (node:internal/streams/readable:754:22)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at TLSSocket.emit (node:events:527:28)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at addChunk (node:internal/streams/readable:315:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at readableAddChunk (node:internal/streams/readable:289:9)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) { td: 'GetIOTConnStatus', on: 1, conn: 2, ip: '3.127.110.57' }
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) TypeError: Cannot read properties of undefined (reading 'data')
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at EcovacsMQTT_JSON.handleMessage (/data/node_modules/ecovacs-deebot/library/950type/ecovacsMQTT_JSON.js:94:32)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at MqttClient.<anonymous> (/data/node_modules/ecovacs-deebot/library/ecovacsMQTT.js:73:18)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at MqttClient.emit (node:events:527:28)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at MqttClient._handlePublish (/data/node_modules/mqtt/lib/client.js:1547:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at MqttClient._handlePacket (/data/node_modules/mqtt/lib/client.js:535:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at work (/data/node_modules/mqtt/lib/client.js:438:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at Writable.writable._write (/data/node_modules/mqtt/lib/client.js:452:5)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at doWrite (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:409:139)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at writeOrBuffer (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:398:5)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at Writable.write (/data/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:307:11)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at TLSSocket.ondata (node:internal/streams/readable:754:22)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at TLSSocket.emit (node:events:527:28)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at addChunk (node:internal/streams/readable:315:12)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at readableAddChunk (node:internal/streams/readable:289:9)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
[rgkiz ](http://localhost:2888/#/tasks/rgkizirt65zwvfn95z9low2af?log=1) { td: 'GetIOTConnStatus', on: 1, conn: 2, ip: '3.127.110.57' }
It's always the same IP which does not belong to my network. As an example I added two subsequent crashes from the error log here. Sadly I forgot to add timestamps into the log message ..
from ecovacs-deebot.js.
Thanks for the information 👍🏻
I will implement some code to handle this message when I find the time (maybe already in a few days).
from ecovacs-deebot.js.
This should be fixed with version 0.4.3 of node-red-contrib-ecovacs-deebot
from ecovacs-deebot.js.
Related Issues (20)
- Implementation of the ability to also use the yeedi API HOT 16
- Are there anyway to connect to the Ecovacs Robot without login? HOT 1
- No "ready" event received HOT 2
- Waterbox info HOT 4
- CleanReport and CleanSum HOT 12
- Move Left Right MoveTurnAround ? HOT 16
- ioBroker Warn Message HOT 1
- GetCleanLog serving old logs HOT 10
- Custom logging function HOT 1
- vacbot.disconnect(); HOT 27
- AirFreshening / aromamode not working HOT 20
- Request failed with status code 502/504 HOT 3
- No error event fired for "Charging dock not found" HOT 7
- Shortcut Command to remove current Map or Restore Map Backup ??? HOT 1
- Map get lost working on backup image HOT 1
- GB/WW api endpoint not found HOT 1
- Retrieve values for air quality returns code 500 HOT 10
- Some feedback on testing with the X2 Omni. HOT 4
- is it support R96? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecovacs-deebot.js.