Read the statement by Michael Teeuw here.
MMM-NetworkScanner-loading...indefinitely
-
@jthirasilpa said in MMM-NetworkScanner-loading...indefinitely:
SyntaxError: Unexpected token ;
sorry, take off the ‘;’ after the actual password
-
Thanks - see error log below
[22:23:34.736] [ERROR] ReferenceError: options is not defined
at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:42:54)
at Class.socketNotificationReceived (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:29:18)
at Socket. (/home/jojo/MagicMirror/js/node_helper.js:113:11)
at Socket.emit (events.js:198:13)
at /home/jojo/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
at process._tickCallback (internal/process/next_tick.js:61:11)
[22:24:03.590] [ERROR] TypeError: Cannot read property ‘network’ of undefined
at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:45:36)
at Class.socketNotificationReceived (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:29:18)
at Socket. (/home/jojo/MagicMirror/js/node_helper.js:113:11)
at Socket.emit (events.js:198:13)
at /home/jojo/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
at process._tickCallback (internal/process/next_tick.js:61:11)
[22:24:05.534] [ERROR] TypeError: Cannot read property ‘network’ of undefined
at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:45:36)
at Class.socketNotificationReceived (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:29:18)
at Socket. (/home/jojo/MagicMirror/js/node_helper.js:113:11)
at Socket.emit (events.js:198:13)
at /home/jojo/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
at process._tickCallback (internal/process/next_tick.js:61:11) -
@jthirasilpa said in MMM-NetworkScanner-loading...indefinitely:
[22:23:34.736] [ERROR] ReferenceError: options is not defined
but you added the 4 lines, right?
var options = { cachePassword: true, prompt: 'Password, ???? ' // put your password where ???? are (notice the quotes around) }
and then the updated line
var arp = sudo(['arp-scan', '-q', arpHosts], options);
-
what is the result of
sudo arp-scan -l
running on your machine? -
@jthirasilpa just do this… get my version of the module
cd ~/MagicMirror/modules mv MMM-NetworkScanner MMM-NetworkScanner.original git clone https://github.com/sdetweil/MMM-NetworkScanner cd MMM-NetworkScanner npm install cd ~/MagicMirror/config nano config.js
add the following line to the config section of the network scanner module
Password: '??????', // where '?????' is you password in quotes, for example 'raspberry', note the trailing comma
ctrl-o at save the config.js
ctrl-x to exit nanoRestart your MM
-
@sdetweil
Thanks Sam - tried your version of the module and modified the config.js accordingly. Still not quite working. Error logs as follows:0|mm | at process._tickCallback (internal/process/next_tick.js:61:11) 0|mm | [09:41:25.508] [ERROR] ReferenceError: options is not defined 0|mm | at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:42:54) 0|mm | at Class.socketNotificationReceived (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:29:18) 0|mm | at Socket.<anonymous> (/home/jojo/MagicMirror/js/node_helper.js:113:11) 0|mm | at Socket.emit (events.js:198:13) 0|mm | at /home/jojo/MagicMirror/node_modules/socket.io/lib/socket.js:528:12 0|mm | at process._tickCallback (internal/process/next_tick.js:61:11) 0|mm | [09:41:55.508] [ERROR] ReferenceError: options is not defined 0|mm | at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:42:54) 0|mm | at Class.socketNotificationReceived (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:29:18) 0|mm | at Socket.<anonymous> (/home/jojo/MagicMirror/js/node_helper.js:113:11) 0|mm | at Socket.emit (events.js:198:13) 0|mm | at /home/jojo/MagicMirror/node_modules/socket.io/lib/socket.js:528:12 0|mm | at process._tickCallback (internal/process/next_tick.js:61:11)
-
@jthirasilpa hm… can u show me show me these lines from node_helper.js
scanNetworkMAC: function() { this.log(this.name + " is performing arp-scan"); var self = this; // Target hosts/network supplied in config or entire localnet var arpHosts = this.config.network || '-l'; var options = { cachePassword: true, prompt: 'Password,' + this.config.Password // put your password where ???? are (notice the quotes around) } var arp = sudo(['arp-scan', '-q', arpHosts], options);
I tested here with three different addresses… some coming online later… worked, no errors…
-
@karsten13
Hi - it seems to function correctly - it returns the IP and MAC addresses of the various clients on the network. -
@sdetweil
I tried it both ways - but should the ‘password’ field in the helper file be filled in? -
@jthirasilpa no… use the config.js
the reference to the options variable should be from line 47, not 42…
so, something is wrong with the code u have in node_helper.js
did u follow my steps above exactly?