Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'ip') #28

Open
olalonde opened this issue May 31, 2022 · 3 comments
Open

TypeError: Cannot read properties of undefined (reading 'ip') #28

olalonde opened this issue May 31, 2022 · 3 comments

Comments

@olalonde
Copy link

I'm getting this error when running the example:

> node src/index.js

TypeError: Cannot read properties of undefined (reading 'ip')
    at /Users/redacted/code/test/node_modules/tp-link-tapo-connect/dist/network-tools.js:51:118
    at step (/Users/redacted/code/test/node_modules/tp-link-tapo-connect/dist/network-tools.js:33:23)
    at Object.next (/Users/redacted/code/test/node_modules/tp-link-tapo-connect/dist/network-tools.js:14:53)
    at fulfilled (/Users/redacted/code/test/node_modules/tp-link-tapo-connect/dist/network-tools.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

const devices = await listDevicesByType(cloudToken, 'SMART.TAPOPLUG');
    
    const smartPlug = devices[0];

    const deviceToken = await loginDevice(email, password, smartPlug);
    const getDeviceInfoResponse = await getDeviceInfo(deviceToken);
    console.log(getDeviceInfoResponse);

The device is on a remote network.

@BartaG512
Copy link

BartaG512 commented Dec 10, 2022

Getting the same error.
return tidyMac(device.mac) == tidyMac(mac); }).ip];
^

TypeError: Cannot read properties of undefined (reading 'ip')
at app\node_modules\tp-link-tapo-connect\dist\network-tools.js:52:56
at step (app\node_modules\tp-link-tapo-connect\dist\network-tools.js:33:23)
at Object.next (app\node_modules\tp-link-tapo-connect\dist\network-tools.js:14:53)
at fulfilled (app\node_modules\tp-link-tapo-connect\dist\network-tools.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

@ercksen
Copy link

ercksen commented May 30, 2023

Had the same issue and my problem was with ARP. I am using a WiFi to LAN Bridge in my case which is not transparent, so it was not able to find the correct MAC address. As no non-null assertion is made, you get this error.

Feedback could be better, but the actual problem probably has to do with your ARP setup. Are you running inside Docker?

@valinotti4
Copy link

Any workaround for this issue? I am also trying to run the script from an external network. If I run it from the same network as the smart plug is conected, it works fine.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants