ianperrin / MMM-NetworkScanner

A module for MagicMirror which determines the status of devices on the network based on their MAC or IP address

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: Cannot read property 'devices' of undefined

mortenbirkelund opened this issue · comments

I get the following error when I run MagicMirror after installing NetWorkScanner

MMM-NetworkScanner received SCAN_NETWORK
MMM-NetworkScanner is performing arp-scan
Whoops! There was an uncaught exception...
TypeError: Cannot read property 'devices' of undefined
    at Class.scanNetworkIP (/home/birkelund/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:91:74)
    at Class.socketNotificationReceived (/home/birkelund/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:30:18)
    at Socket.<anonymous> (/home/birkelund/MagicMirror/modules/node_modules/node_helper/index.js:98:10)
    at emitTwo (events.js:106:13)
    at Socket.emit (events.js:191:7)
    at /home/birkelund/MagicMirror/node_modules/socket.io/lib/socket.js:503:12
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at Immediate._tickCallback (internal/process/next_tick.js:98:9)
    at runCallback (timers.js:649:20)
    at tryOnImmediate (timers.js:622:5)
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues

Whoops! There was an uncaught exception...
TypeError: Cannot read property 'devices' of undefined
at Class.findDeviceByMacAddress (/home/pi/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:114:40)
at ChildProcess. (/home/pi/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:74:39)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:498:12)
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues

Sorry to bump this, but I'm seeing (very nearly) this exact issue! This happens whether the list of MAC/IP are populated or not.

My exact error message is below, and very similar:

MMM-NetworkScanner received SCAN_NETWORK
MMM-NetworkScanner is performing arp-scan
Whoops! There was an uncaught exception...
TypeError: Cannot read property 'network' of undefined
at Class.scanNetworkMAC (/home/server/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:42:36)
at Class.socketNotificationReceived (/home/server/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:30:18)
at Socket. (/home/server/MagicMirror/modules/node_modules/node_helper/index.js:113:11)
at Socket.emit (events.js:198:13)
at ~/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
at process._tickCallback (internal/process/next_tick.js:61:11)
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues

Notes:

  1. My code has fix d014539 yet still does this (on that line). This happens 100% of the time for me.
  2. I added "sudo chmod u+s /usr/sbin/arp-scan" making arp-scan able to be run without the user having root (the way ping is), this eventually causes a core dump! Unclear if related, will happily open another bug report if it is not.