rch-goldsnaker / thingsboard-rpc-tutorial

5 stars 4 forks source link

TypeError: Cannot read properties of undefined (reading 'data') #2

Open MannimMond86 opened 1 month ago

MannimMond86 commented 1 month ago

Hello, I tried to follow the youtube tutorial:

prepaired the deviceId, TB_API_URL,TB_USERNAME,TB_PASSWORD using TB CE on hetzner server with http Node.js v22.4.1,npm 10.8.1 after download, npm install and npm start

npm start gives following error:

file:///F:/Learn-Git_GitKraken/thingsboard-rpc-tutorial/NodeJs/src/index.js:35
console.log(response.data); ^

TypeError: Cannot read properties of undefined (reading 'data') at RpcClient (file:///F:/Learn-Git_GitKraken/thingsboard-rpc-tutorial/NodeJs/src/index.js:35:24) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

rch-goldsnaker commented 1 month ago

Hello, how are you? Sorry for the delay, I have been busy with work these days. From what I see, you are having problems with the "RpcClientSide" service, and the error you're encountering is because no data is being returned in the response. My question is whether you configured the Rule Chain in ThingsBoard with the name "getCurrentTime"; that might be the issue. Let me know.