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 16.1k 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.
    • S Offline
      sdetweil @jthirasilpa
      last edited by

      @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
      

      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

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

          @jthirasilpa said in MMM-NetworkScanner-loading...indefinitely:

          SyntaxError: Unexpected token ;

          sorry, take off the ‘;’ after the actual password

          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 - 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)

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

              @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);    
              

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • karsten13K Online
                karsten13
                last edited by

                what is the result of sudo arp-scan -l running on your machine?

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

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

                  Restart your MM

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

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

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

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

                      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 @karsten13
                        last edited by

                        @karsten13
                        Hi - it seems to function correctly - it returns the IP and MAC addresses of the various clients on the network.

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 6
                        • 2 / 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