Read the statement by Michael Teeuw here.
MMM-NetworkScanner-loading...indefinitely
-
Thanks.
Whenever it shows up, it is contiguous to the MMM-NetworkScanner received CONFIG reading in the log. When this module is added, npm install adds the “sudo” dependency - I assume that this is what is sending the message, but do not know how to confirm?
-
@jthirasilpa cool, thx
edit the node_helper.js
add the following lineconst sudo = require("sudo"); sudo.setPassword('your-password'); // add this line, edit to use your password module.exports = NodeHelper.create({ -
Thanks Sam - I made that modification in node_helper.js in the module’s directory with my password.
I get the following errors from the logs:
0|mm | [21:06:46.210] [ERROR] WARNING! Could not load config file. Starting with default configuration. Error found: TypeError: sudo.setPassword is not a function 0|mm | [21:06:46.216] [ERROR] 0|mm | TypeError: sudo.setPassword is not a function 0|mm | at Object.<anonymous> (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:13:6) 0|mm | at Module._compile (internal/modules/cjs/loader.js:778:30) 0|mm | at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) 0|mm | at Module.load (internal/modules/cjs/loader.js:653:32) 0|mm | at tryModuleLoad (internal/modules/cjs/loader.js:593:12) 0|mm | at Function.Module._load (internal/modules/cjs/loader.js:585:3) 0|mm | at Module.require (internal/modules/cjs/loader.js:692:17) 0|mm | at require (internal/modules/cjs/helpers.js:25:18) 0|mm | at loadModule (/home/jojo/MagicMirror/js/app.js:132:17) 0|mm | at loadNextModule (/home/jojo/MagicMirror/js/app.js:166:5) -
Maybe some progress?
So I amended the insertion as follows:
sudo.setPassword = ('your-password'); // add this line, edit to use your passwordConfig loads, but NetworkScanner module still shows “loading…”
Error logs as follows:
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 | [21:26:17.270] [ERROR] (node:1940) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit 0|mm | [21:26:17.271] [ERROR] (node:1940) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added. Use emitter.setMaxListeners() to increase limit 0|mm | [21:26:17.272] [ERROR] (node:1940) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListeners() to increase limit 0|mm | [21:26:17.272] [ERROR] (node:1940) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit 0|mm | [21:26:17.272] [ERROR] (node:1940) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 data listeners added. Use emitter.setMaxListeners() to increase limit 0|mm | [21:26:26.569] [ERROR] TypeError: Cannot read property 'network' of undefined 0|mm | at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:42:36) 0|mm | at Class.socketNotificationReceived (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:30: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) /home/jojo/.pm2/logs/mm-out.log last 15 lines: 0|mm | [21:26:18.772] [LOG] Connecting socket for: MMM-UKNationalRail 0|mm | [21:26:18.772] [LOG] MMM-UKNationalRail helper started ... 0|mm | [21:26:18.773] [LOG] Connecting socket for: MMM-NetworkScanner 0|mm | [21:26:18.773] [LOG] Starting module: MMM-NetworkScanner 0|mm | [21:26:18.773] [LOG] Sockets connected & modules started ... 0|mm | [21:26:18.774] [LOG] 0|mm | Ready to go! Please point your browser to: http://0.0.0.0:8080 0|mm | [21:26:26.567] [LOG] MMM-NetworkScanner received SCAN_NETWORK 0|mm | [21:26:26.568] [LOG] MMM-NetworkScanner is performing arp-scan 0|mm | [21:26:26.569] [LOG] Whoops! There was an uncaught exception... 0|mm | [21:26:26.575] [LOG] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? 0|mm | [21:26:26.576] [LOG] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues 0|mm | [21:26:29.340] [LOG] Create new news fetcher for url: http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000 0|mm | [21:26:29.375] [LOG] Create new news fetcher for url: http://rss.cnn.com/rss/edition.rss - Interval: 300000 0|mm | [21:26:29.441] [LOG] MMM-NetworkScanner received CONFIG -
@jthirasilpa ok, had to read the sudo module code to find out where it was… cause when I searched I ended up in the wrong place…
remove the one line I had you add
do this
// add these 4 lines var options = { cachePassword: true, prompt: 'Password, ???? '; // put your password where ???? are (notice the quotes around) } var arpHosts = this.config.network || '-l'; var arp = sudo(['arp-scan', '-q', arpHosts], options); // change this line, to add ,options at the end -
@sdetweil said in MMM-NetworkScanner-loading...indefinitely:
var options = {
cachePassword: true,
prompt: 'Password, ??? '; // put your password where ??? are (notice the quotes around)
}Thanks - tried that. Got the following log:
0|mm | WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:43 0|mm | prompt: 'Password, mypassword'; // put your password where ???? are (notice the quotes around) 0|mm | ^ 0|mm | SyntaxError: Unexpected token ; 0|mm | at Module._compile (internal/modules/cjs/loader.js:723:23) 0|mm | at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) 0|mm | at Module.load (internal/modules/cjs/loader.js:653:32) 0|mm | at tryModuleLoad (internal/modules/cjs/loader.js:593:12) 0|mm | at Function.Module._load (internal/modules/cjs/loader.js:585:3) 0|mm | at Module.require (internal/modules/cjs/loader.js:692:17) 0|mm | at require (internal/modules/cjs/helpers.js:25:18) 0|mm | at loadModule (/home/jojo/MagicMirror/js/app.js:132:17) 0|mm | at loadNextModule (/home/jojo/MagicMirror/js/app.js:166:5) 0|mm | at /home/jojo/MagicMirror/js/app.js:168:6 -
@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 -lrunning 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.jsadd 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 commactrl-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?
-
Sorry I’m not being clear. I know that I need to modify the config.js (and have done so), but in line 45 of node_helper.js (as shown below) there is:
prompt: 'Password,' + this.config.Password // put your password where ???? are (notice the quotes around)Should I leave this as is or fill in the password? That is where I have tried it both ways.
Code you asked for from node_helper.js:
scanNetworkMAC: function() { 38 this.log(this.name + " is performing arp-scan"); 39 40 var self = this; 41 // Target hosts/network supplied in config or entire localnet 42 var arpHosts = this.config.network || '-l'; 43 var options = { 44 cachePassword: true, 45 prompt: 'Password,' + this.config.Password // put your password where ???? are (notice the quotes around) 46 } 47 var arp = sudo(['arp-scan', '-q', arpHosts], options); -
@jthirasilpa oh, i see I should have removed the comment… you do not need to change any code…
but the error does not match the code u are running now…
please do
pm2 stop 0 pm2 flush pm2 start 0 pm2 logsthat error must have been from yesterday
-
Hmm
So with the password entered only in the config file, the error output still references line 42
var arpHosts = this.config.network || '-l';Error output:
0|mm | [19:37:36.956] [ERROR] TypeError: Cannot read property 'network' of undefined 0|mm | at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:42:36) 0|mm | at Class.socketNotificationReceived (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:30: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 | [19:37:50.982] [LOG] MMM-NetworkScanner received SCAN_NETWORK 0|mm | [19:37:50.983] [LOG] MMM-NetworkScanner is performing arp-scan 0|mm | [19:37:50.984] [LOG] Whoops! There was an uncaught exception... 0|mm | [19:37:50.984] [ERROR] 0|mm | TypeError: Cannot read property 'network' of undefined 0|mm | at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:42:36) 0|mm | at Class.socketNotificationReceived (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:30: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 | [19:37:50.985] [LOG] 0|mm | MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? 0|mm | [19:37:50.986] [LOG] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues 0|mm | [19:38:21.046] [LOG] 0|mm | MMM-NetworkScanner received SCAN_NETWORK 0|mm | [19:38:21.047] [LOG] 0|mm | MMM-NetworkScanner is performing arp-scan 0|mm | [19:38:21.048] [LOG] Whoops! There was an uncaught exception... 0|mm | [19:38:21.048] [ERROR] 0|mm | TypeError: Cannot read property 'network' of undefined 0|mm | at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:42:36) 0|mm | at Class.socketNotificationReceived (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:30: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 said in MMM-NetworkScanner-loading...indefinitely:
0|mm | [19:37:36.956] [ERROR] TypeError: Cannot read property ‘network’ of undefined
0|mm | at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:42:36)Ok, but not ‘options’…
now, to check, this system is case sensitive… so in config.js it MUST look like this, right?
keepAlive: 300, updateInterval: 5, Password: 'pi' // added password (note capital P) }using your password of course
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login