Read the statement by Michael Teeuw here.
MMM-NetworkScanner-loading...indefinitely
-
@jthirasilpa do another git pull from my repo… and try again
-
@sdetweil
Thanks SamTried update. Error log below:
[11:45:29.130] [ERROR] TypeError: Cannot read property 'network' of undefined at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:46:36) at Class.socketNotificationReceived (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:33:18) at Socket.<anonymous> (/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)
Node_helper code:
// Target hosts/network supplied in config or entire localnet 46 var arpHosts = self.config.network || '-l'; 47 var options = { 48 cachePassword: true, 49 prompt: 'Password,' + self.config.Password // put your password where ???? are (notice the quotes around) 50 } 51 var arp = sudo(['arp-scan', '-q', arpHosts]) //, options);
Module entry in config.js:
{ 139 module: "MMM-NetworkScanner", 140 position: "bottom_center", 141 header: "Devices Online", 142 config: { 143 devices: [ 144 { ipAddress: "192.168.1.11", name: "Champagne", icon: "server"}, 145 { ipAddress: "192.168.1.15", name: "Millie", icon: "server"}, 146 { ipAddress: "192.168.1.17", name: "Marmite", icon: "server"} 147 ], 148 showUnknown: false, 149 showOffline: true, 150 keepAlive: 600, 151 showLastSeen: true, 152 updateInterval: 30, 153 Password: 'xxxx' 154 } 155 },
-
@jthirasilpa weird…
the trace shows, on a timer tick (in the modulename.js) the node+helper received a socket message (sendSocketNotification from modulename.js), and received in node_helper)
the notification is correct, and it starts to rescan the network…but, it has lost the config pointer for some reason…
weird…
please do another git pull
also add debug:true,
to the module config section
let me know
thanks
-
Thanks. Scan seems to find some devices, but does not display them on Mirror.
Here is output log:
[20:41:24.611] [LOG] MMM-NetworkScanner is performing arp-scan [20:41:24.650] [LOG] MMM-NetworkScanner is performing ip address scan [20:41:24.651] [LOG] MMM-NetworkScanner is checking device: Champagne [20:41:24.651] [LOG] MMM-NetworkScanner is pinging 192.168.1.11 [20:41:24.666] [LOG] MMM-NetworkScanner is checking device: Millie [20:41:24.667] [LOG] MMM-NetworkScanner is checking device: Marmite [20:41:24.667] [LOG] MMM-NetworkScanner is pinging 192.168.1.17 [20:41:24.690] [LOG] MMM-NetworkScanner is checking device: JoJo [20:41:24.691] [LOG] MMM-NetworkScanner is pinging 192.168.1.70 [20:41:24.705] [LOG] MMM-NetworkScanner completed SCAN_NETWORK [20:41:24.707] [LOG] MMM-NetworkScanner ping result: [ 'Champagne', true ] [20:41:26.741] [LOG] MMM-NetworkScanner ping result: [ 'Marmite', false ] [20:41:26.743] [LOG] MMM-NetworkScanner ping result: [ 'JoJo', false ] [20:41:54.605] [LOG] MMM-NetworkScanner received SCAN_NETWORK [20:41:54.605] [LOG] MMM-NetworkScanner is performing arp-scan [20:41:54.630] [LOG] MMM-NetworkScanner is performing ip address scan [20:41:54.631] [LOG] MMM-NetworkScanner is checking device: Champagne [20:41:54.631] [LOG] MMM-NetworkScanner is pinging 192.168.1.11 [20:41:54.644] [LOG] MMM-NetworkScanner is checking device: Millie [20:41:54.645] [LOG] MMM-NetworkScanner is checking device: Marmite [20:41:54.645] [LOG] MMM-NetworkScanner is pinging 192.168.1.17 [20:41:54.658] [LOG] MMM-NetworkScanner is checking device: JoJo [20:41:54.659] [LOG] MMM-NetworkScanner is pinging 192.168.1.70 [20:41:54.672] [LOG] MMM-NetworkScanner completed SCAN_NETWORK [20:41:54.675] [LOG] MMM-NetworkScanner ping result: [ 'Champagne', true ] [20:41:56.706] [LOG] MMM-NetworkScanner ping result: [ 'Marmite', false ] [20:41:56.707] [LOG] MMM-NetworkScanner ping result: [ 'JoJo', false ]
Error log:
[20:35:38.953] [ERROR] (node:20348) MaxListenersExceededWarning: Possible Event Emitter memory leak detected. 11 error listeners added. Use emitter.setMaxListen ers() to increase limit [20:35:38.953] [ERROR] (node:20348) MaxListenersExceededWarning: Possible Event Emitter memory leak detected. 11 end listeners added. Use emitter.setMaxListener s() to increase limit [20:35:38.954] [ERROR] (node:20348) MaxListenersExceededWarning: Possible Event Emitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListen ers() to increase limit [20:35:38.954] [ERROR] (node:20348) MaxListenersExceededWarning: Possible Event Emitter memory leak detected. 11 close listeners added. Use emitter.setMaxListen ers() to increase limit [20:35:38.955] [ERROR] (node:20348) MaxListenersExceededWarning: Possible Event Emitter memory leak detected. 11 data listeners added. Use emitter.setMaxListene rs() to increase limit
-
@jthirasilpa said in MMM-NetworkScanner-loading...indefinitely:
[20:41:24.651] [LOG] MMM-NetworkScanner is pinging 192.168.1.11
[20:41:24.666] [LOG] MMM-NetworkScanner is checking device: Millie
[20:41:24.667] [LOG] MMM-NetworkScanner is checking device: Marmite
[20:41:24.667] [LOG] MMM-NetworkScanner is pinging 192.168.1.17
[20:41:24.690] [LOG] MMM-NetworkScanner is checking device: JoJo
[20:41:24.691] [LOG] MMM-NetworkScanner is pinging 192.168.1.70
[20:41:24.705] [LOG] MMM-NetworkScanner completed SCAN_NETWORK
[20:41:24.707] [LOG] MMM-NetworkScanner ping result: [ ‘Champagne’, true ]
[20:41:26.741] [LOG] MMM-NetworkScanner ping result: [ ‘Marmite’, false ]
[20:41:26.743] [LOG] MMM-NetworkScanner ping result: [ ‘JoJo’, false ]jojo isn’t in the configured list above… so, did u change the config?
and it says it will scan all the addresses in the devices list, but millie isn’t pinged…
what else do you have in bottom_center? it can get pushed off screen pretty easily…
-
Thanks - I did change the config to add one device “JoJo” with an IpAddress and I changed “Millie” from IpAddress to MacAddress (I am guessing that is why it is not showing in the ping result - but am not sure). I did not make any other changes to the config (apart from adding the debug line). There is no other bottom_center module and it clearly displays Devices Online “Loading…”, so I don’t think it’s the case that entries are being pushed off the page.
{ 139 module: "MMM-NetworkScanner", 140 position: "bottom_center", 141 header: "Devices Online", 142 config: { 143 devices: [ 144 { ipAddress: "192.168.1.11", name: "Champagne", icon: "server"}, 145 { macAddress: "xxxx", name: "Millie", icon: "server"}, 146 { ipAddress: "192.168.1.17", name: "Marmite", icon: "server"}, 147 { ipAddress: "192.168.1.70", name: "JoJo", icon: "male"} 148 ], 149 showUnknown: false, 150 showOffline: true, 151 keepAlive: 600, 152 showLastSeen: true, 153 updateInterval: 30, 154 debug: true, 155 Password: 'xxxx' 156 } 157 },
-
@jthirasilpa do you have arp-scan installed?
Open a terminal window and type
sudo arp-scan
If not install it. Not part of module.
sudo apt-get install arp-scan
-
@sdetweil
Problem is the fact that the CONFIG message is sent from the frontend only at the loading of the page (subclassing START). If the page is still open in the browser it will send SCAN_NETWORK requests periodically which will lead to the situation where the config object is empty when the scan is to be executed, if the service has been restarted meanwhile.Furthermore, if a reload of the page is executed, a CONFIG request is sent to NODE_HELPER which might be busy scanning and it seems as if there is no escape unless the correct sequential order for CONFIG and SCAN_NETWORK is used.
To verify:
1.) Stop loading of the page in browser or navigate to an other page so no SCAN_NETWORK will be created for the device status updates
2.) Stop + restart MM
3.) Reload page / enter start URLThis will lead to the correct order and the programmatic solution is to check if the config object is filled before executing the scan. If not, it has to be reloaded, the CONFIG request in NODE_HELPER can not be used as it uses the payload from the frontend.
-
@todro oh yeh that will be a mess. Hadn’t thought of that, electron will shutdown, but remote page wont
That will be a problem for many modules!
-
@sdetweil
Hi Sam - yes it is already installed.I treid the steps posted by todro (a couple of times).
Here is log output, but MM still shows Devices Online “Loading…”:
[19:46:01.569] [LOG] Use existing news fetcher for url: http://rss.cnn.com/rss/edition.rss [19:46:01.623] [LOG] MMM-NetworkScanner received CONFIG [19:46:01.623] [LOG] MMM-NetworkScanner completed CONFIG [19:46:01.625] [LOG] MMM-NetworkScanner received SCAN_NETWORK [19:46:01.625] [LOG] MMM-NetworkScanner is performing arp-scan [19:46:01.645] [LOG] MMM-NetworkScanner is performing ip address scan [19:46:01.646] [LOG] MMM-NetworkScanner is checking device: Champagne [19:46:01.646] [LOG] MMM-NetworkScanner is pinging 192.168.1.11 [19:46:01.656] [LOG] MMM-NetworkScanner is checking device: Millie [19:46:01.657] [LOG] MMM-NetworkScanner is checking device: Marmite [19:46:01.657] [LOG] MMM-NetworkScanner is pinging 192.168.1.17 [19:46:01.671] [LOG] MMM-NetworkScanner is checking device: JoJo [19:46:01.672] [LOG] MMM-NetworkScanner is pinging 192.168.1.70 [19:46:01.681] [LOG] MMM-NetworkScanner completed SCAN_NETWORK [19:46:01.838] [LOG] MMM-NetworkScanner ping result: [ 'Champagne', true ] [19:46:03.674] [LOG] MMM-NetworkScanner ping result: [ 'Marmite', false ] [19:46:03.685] [LOG] MMM-NetworkScanner ping result: [ 'JoJo', false ] [19:46:30.817] [LOG] MMM-NetworkScanner received SCAN_NETWORK [19:46:30.818] [LOG] MMM-NetworkScanner is performing arp-scan [19:46:30.840] [LOG] MMM-NetworkScanner is performing ip address scan [19:46:30.841] [LOG] MMM-NetworkScanner is checking device: Champagne [19:46:30.842] [LOG] MMM-NetworkScanner is pinging 192.168.1.11 [19:46:30.853] [LOG] MMM-NetworkScanner is checking device: Millie [19:46:30.855] [LOG] MMM-NetworkScanner is checking device: Marmite [19:46:30.856] [LOG] MMM-NetworkScanner is pinging 192.168.1.17 [19:46:30.872] [LOG] MMM-NetworkScanner is checking device: JoJo [19:46:30.873] [LOG] MMM-NetworkScanner is pinging 192.168.1.70 [19:46:30.882] [LOG] MMM-NetworkScanner completed SCAN_NETWORK [19:46:30.895] [LOG] MMM-NetworkScanner ping result: [ 'Champagne', true ] [19:46:32.875] [LOG] MMM-NetworkScanner ping result: [ 'Marmite', false ] [19:46:32.901] [LOG] MMM-NetworkScanner ping result: [ 'JoJo', false ] [19:47:10.155] [LOG] [SIGINT] Received. Shutting down server... [19:47:10.156] [LOG] Stopping module helper: updatenotification [19:47:10.156] [LOG] Stopping module helper: newsfeed [19:47:10.156] [LOG] Stopping module helper: MMM-UKNationalRail [19:47:10.157] [LOG] Stopping module helper: MMM-NetworkScanner [19:47:20.881] [LOG] Starting MagicMirror: v2.10.1 [19:47:20.890] [LOG] Loading config ... [19:47:20.895] [LOG] Loading module helpers ... [19:47:20.896] [LOG] No helper found for module: alert. [19:47:20.930] [LOG] Initializing new module helper ... [19:47:20.931] [LOG] Module helper loaded: updatenotification [19:47:20.932] [LOG] No helper found for module: clock. [19:47:20.932] [LOG] No helper found for module: currentweather. [19:47:21.243] [LOG] Initializing new module helper ... [19:47:21.243] [LOG] Module helper loaded: newsfeed [19:47:21.526] [LOG] Initializing new module helper ... [19:47:21.526] [LOG] Module helper loaded: MMM-UKNationalRail [19:47:21.526] [LOG] No helper found for module: MMM-TFL. [19:47:21.555] [LOG] Initializing new module helper ... [19:47:21.555] [LOG] Module helper loaded: MMM-NetworkScanner [19:47:21.556] [LOG] All module helpers loaded. [19:47:21.556] [LOG] Starting server on port 8080 ... [19:47:21.562] [INFO] You're using a full whitelist configuration to allow for all IPs [19:47:21.569] [LOG] Server started ... [19:47:21.570] [LOG] Connecting socket for: updatenotification [19:47:21.571] [LOG] Connecting socket for: newsfeed [19:47:21.571] [LOG] Starting module: newsfeed [19:47:21.572] [LOG] Connecting socket for: MMM-UKNationalRail [19:47:21.572] [LOG] MMM-UKNationalRail helper started ... [19:47:21.572] [LOG] Connecting socket for: MMM-NetworkScanner [19:47:21.573] [LOG] Starting module in node_helper: MMM-NetworkScanner [19:47:21.573] [LOG] Sockets connected & modules started ... [19:47:21.573] [LOG] Ready to go! Please point your browser to: http://0.0.0.0:8080 [19:47:30.001] [LOG] Create new news fetcher for url: http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000 [19:47:30.035] [LOG] Create new news fetcher for url: http://rss.cnn.com/rss/edition.rss - Interval: 300000 [19:47:30.459] [LOG] MMM-NetworkScanner received CONFIG [19:47:30.460] [LOG] MMM-NetworkScanner completed CONFIG [19:47:30.473] [LOG] MMM-NetworkScanner received SCAN_NETWORK [19:47:30.473] [LOG] MMM-NetworkScanner is performing arp-scan [19:47:30.501] [LOG] MMM-NetworkScanner is performing ip address scan [19:47:30.502] [LOG] MMM-NetworkScanner is checking device: Champagne [19:47:30.503] [LOG] MMM-NetworkScanner is pinging 192.168.1.11 [19:47:30.515] [LOG] MMM-NetworkScanner is checking device: Millie [19:47:30.515] [LOG] MMM-NetworkScanner is checking device: Marmite [19:47:30.516] [LOG] MMM-NetworkScanner is pinging 192.168.1.17 [19:47:30.532] [LOG] MMM-NetworkScanner is checking device: JoJo [19:47:30.533] [LOG] MMM-NetworkScanner is pinging 192.168.1.70 [19:47:30.544] [LOG] MMM-NetworkScanner completed SCAN_NETWORK sudo requires your password: [19:47:30.558] [LOG] MMM-NetworkScanner ping result: [ 'Champagne', true ] [19:47:32.535] [LOG] MMM-NetworkScanner ping result: [ 'Marmite', false ] [19:47:32.547] [LOG] MMM-NetworkScanner ping result: [ 'JoJo', false ] [19:47:59.468] [LOG] MMM-NetworkScanner received SCAN_NETWORK [19:47:59.469] [LOG] MMM-NetworkScanner is performing arp-scan [19:47:59.489] [LOG] MMM-NetworkScanner is performing ip address scan [19:47:59.492] [LOG] MMM-NetworkScanner is checking device: Champagne [19:47:59.494] [LOG] MMM-NetworkScanner is pinging 192.168.1.11 [19:47:59.504] [LOG] MMM-NetworkScanner is checking device: Millie [19:47:59.505] [LOG] MMM-NetworkScanner is checking device: Marmite [19:47:59.506] [LOG] MMM-NetworkScanner is pinging 192.168.1.17 [19:47:59.514] [LOG] MMM-NetworkScanner is checking device: JoJo [19:47:59.514] [LOG] MMM-NetworkScanner is pinging 192.168.1.70 [19:47:59.522] [LOG] MMM-NetworkScanner completed SCAN_NETWORK [19:47:59.525] [LOG] MMM-NetworkScanner ping result: [ 'Champagne', true ] [19:48:01.516] [LOG] MMM-NetworkScanner ping result: [ 'Marmite', false ] [19:48:01.529] [LOG] MMM-NetworkScanner ping result: [ 'JoJo', false ] [19:48:26.714] [LOG] [SIGINT] Received. Shutting down server... [19:48:26.715] [LOG] Stopping module helper: updatenotification [19:48:26.716] [LOG] Stopping module helper: newsfeed [19:48:26.716] [LOG] Stopping module helper: MMM-UKNationalRail [19:48:26.716] [LOG] Stopping module helper: MMM-NetworkScanner [19:48:33.169] [LOG] Starting MagicMirror: v2.10.1 [19:48:33.179] [LOG] Loading config ... [19:48:33.183] [LOG] Loading module helpers ... [19:48:33.185] [LOG] No helper found for module: alert. [19:48:33.220] [LOG] Initializing new module helper ... [19:48:33.221] [LOG] Module helper loaded: updatenotification [19:48:33.221] [LOG] No helper found for module: clock. [19:48:33.222] [LOG] No helper found for module: currentweather. [19:48:33.526] [LOG] Initializing new module helper ... [19:48:33.527] [LOG] Module helper loaded: newsfeed [19:48:33.809] [LOG] Initializing new module helper ... [19:48:33.810] [LOG] Module helper loaded: MMM-UKNationalRail [19:48:33.810] [LOG] No helper found for module: MMM-TFL. [19:48:33.840] [LOG] Initializing new module helper ... [19:48:33.840] [LOG] Module helper loaded: MMM-NetworkScanner [19:48:33.840] [LOG] All module helpers loaded. [19:48:33.841] [LOG] Starting server on port 8080 ... [19:48:33.847] [INFO] You're using a full whitelist configuration to allow for all IPs [19:48:33.854] [LOG] Server started ... [19:48:33.855] [LOG] Connecting socket for: updatenotification [19:48:33.855] [LOG] Connecting socket for: newsfeed [19:48:33.856] [LOG] Starting module: newsfeed [19:48:33.856] [LOG] Connecting socket for: MMM-UKNationalRail [19:48:33.857] [LOG] MMM-UKNationalRail helper started ... [19:48:33.857] [LOG] Connecting socket for: MMM-NetworkScanner [19:48:33.857] [LOG] Starting module in node_helper: MMM-NetworkScanner [19:48:33.858] [LOG] Sockets connected & modules started ... [19:48:33.858] [LOG] Ready to go! Please point your browser to: http://0.0.0.0:8080 [19:48:47.214] [LOG] Create new news fetcher for url: http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000 [19:48:47.247] [LOG] Create new news fetcher for url: http://rss.cnn.com/rss/edition.rss - Interval: 300000 [19:48:47.312] [LOG] MMM-NetworkScanner received CONFIG [19:48:47.313] [LOG] MMM-NetworkScanner completed CONFIG [19:48:47.314] [LOG] MMM-NetworkScanner received SCAN_NETWORK [19:48:47.315] [LOG] MMM-NetworkScanner is performing arp-scan [19:48:47.341] [LOG] MMM-NetworkScanner is performing ip address scan [19:48:47.342] [LOG] MMM-NetworkScanner is checking device: Champagne [19:48:47.342] [LOG] MMM-NetworkScanner is pinging 192.168.1.11 [19:48:47.353] [LOG] MMM-NetworkScanner is checking device: Millie [19:48:47.353] [LOG] MMM-NetworkScanner is checking device: Marmite [19:48:47.354] [LOG] MMM-NetworkScanner is pinging 192.168.1.17 [19:48:47.363] [LOG] MMM-NetworkScanner is checking device: JoJo [19:48:47.364] [LOG] MMM-NetworkScanner is pinging 192.168.1.70 [19:48:47.372] [LOG] MMM-NetworkScanner completed SCAN_NETWORK sudo requires your password: [19:48:47.686] [LOG] MMM-NetworkScanner ping result: [ 'Champagne', true ] [19:48:49.367] [LOG] MMM-NetworkScanner ping result: [ 'Marmite', false ] [19:48:49.381] [LOG] MMM-NetworkScanner ping result: [ 'JoJo', false ] [19:49:16.634] [LOG] MMM-NetworkScanner received SCAN_NETWORK [19:49:16.635] [LOG] MMM-NetworkScanner is performing arp-scan [19:49:16.657] [LOG] MMM-NetworkScanner is performing ip address scan [19:49:16.658] [LOG] MMM-NetworkScanner is checking device: Champagne [19:49:16.658] [LOG] MMM-NetworkScanner is pinging 192.168.1.11 [19:49:16.669] [LOG] MMM-NetworkScanner is checking device: Millie [19:49:16.669] [LOG] MMM-NetworkScanner is checking device: Marmite [19:49:16.670] [LOG] MMM-NetworkScanner is pinging 192.168.1.17 [19:49:16.679] [LOG] MMM-NetworkScanner is checking device: JoJo [19:49:16.681] [LOG] MMM-NetworkScanner is pinging 192.168.1.70 [19:49:16.690] [LOG] MMM-NetworkScanner completed SCAN_NETWORK [19:49:16.702] [LOG] MMM-NetworkScanner ping result: [ 'Champagne', true ] [19:49:18.693] [LOG] MMM-NetworkScanner ping result: [ 'Marmite', false ] [19:49:18.695] [LOG] MMM-NetworkScanner ping result: [ 'JoJo', false ] [19:49:46.639] [LOG] MMM-NetworkScanner received SCAN_NETWORK [19:49:46.640] [LOG] MMM-NetworkScanner is performing arp-scan [19:49:46.670] [LOG] MMM-NetworkScanner is performing ip address scan [19:49:46.670] [LOG] MMM-NetworkScanner is checking device: Champagne [19:49:46.670] [LOG] MMM-NetworkScanner is pinging 192.168.1.11 [19:49:46.680] [LOG] MMM-NetworkScanner is checking device: Millie [19:49:46.681] [LOG] MMM-NetworkScanner is checking device: Marmite [19:49:46.681] [LOG] MMM-NetworkScanner is pinging 192.168.1.17 [19:49:46.703] [LOG] MMM-NetworkScanner is checking device: JoJo [19:49:46.705] [LOG] MMM-NetworkScanner is pinging 192.168.1.70 [19:49:46.716] [LOG] MMM-NetworkScanner completed SCAN_NETWORK [19:49:46.740] [LOG] MMM-NetworkScanner ping result: [ 'Champagne', true ]