MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-NetworkScanner-loading...indefinitely

    Scheduled Pinned Locked Moved Solved Troubleshooting
    54 Posts 6 Posters 15.0k Views 7 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jthirasilpa @sdetweil
      last edited by

      @sdetweil
      Hi Sam - thanks I tried the update. Still getting the same error - from the log:

      [19:00:49.868] [ERROR]  TypeError: Cannot read property 'network' of undefined
          at Class.scanNetworkMAC (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:42:36)
          at Class.socketNotificationReceived (/home/jojo/MagicMirror/modules/MMM-NetworkScanner/node_helper.js:30: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)
      
      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @jthirasilpa
        last edited by

        @jthirasilpa do another git pull from my repo… and try again

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          jthirasilpa @sdetweil
          last edited by

          @sdetweil
          Thanks Sam

          Tried 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                 },
          
          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @jthirasilpa
            last edited by

            @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

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • J Offline
              jthirasilpa
              last edited by

              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
              
              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @jthirasilpa
                last edited by

                @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…

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • J Offline
                  jthirasilpa
                  last edited by

                  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                 },
                  
                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdetweil @jthirasilpa
                    last edited by

                    @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
                    

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    T J 2 Replies Last reply Reply Quote 0
                    • T Offline
                      todro @sdetweil
                      last edited by todro

                      @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 URL

                      This 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.

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        sdetweil @todro
                        last edited by sdetweil

                        @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!

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 6
                        • 3 / 6
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy