• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Local IP address

Scheduled Pinned Locked Moved General Discussion
10 Posts 3 Posters 5.7k Views 3 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
    strawberry 3.141 Project Sponsor Module Developer
    last edited by strawberry 3.141 Jul 26, 2016, 12:09 AM Jul 26, 2016, 12:07 AM

    one way would be a module with a node_helper something like

    const NodeHelper = require('node_helper');
    const exec = require('child_process').exec;
    
    module.exports = NodeHelper.create({
      socketNotificationReceived: function(notification, payload) {
        if (notification === 'GET_IP') {
        exec('host raspberrypi', (error, stdout, stderr) => {
         if (error) {
           console.error(`exec error: ${error}`);
           return;
        }
      this.sendSocketNotification('IP', stdout);
    });
    }
      }
    });
    

    stdout will be something like “raspberrypi has address 192.168.1.20”

    Please create a github issue if you need help, so I can keep track

    P A 2 Replies Last reply Jul 26, 2016, 12:09 AM Reply Quote 0
    • P Offline
      PointPubMedia @strawberry 3.141
      last edited by Jul 26, 2016, 12:09 AM

      @strawberry-3.141 But, what’s about the screen location ? I didn’t find any builtin position like that…

      1 Reply Last reply Reply Quote 0
      • S Offline
        strawberry 3.141 Project Sponsor Module Developer
        last edited by Jul 26, 2016, 12:11 AM

        bottom_right https://forum.magicmirror.builders/topic/286/regions

        Please create a github issue if you need help, so I can keep track

        P 1 Reply Last reply Jul 26, 2016, 12:17 AM Reply Quote 0
        • P Offline
          PointPubMedia @strawberry 3.141
          last edited by Jul 26, 2016, 12:17 AM

          @strawberry-3.141 and I will need to handle the text size from the module itself to be very small and discrete!?

          1 Reply Last reply Reply Quote 0
          • S Offline
            strawberry 3.141 Project Sponsor Module Developer
            last edited by strawberry 3.141 Jul 26, 2016, 12:27 AM Jul 26, 2016, 12:26 AM

            you can add something like .ip-font { font-size: 8px; } in custom.css and use this class for your displaying dom or create an own css file for your module because it’s only module related :)

            Please create a github issue if you need help, so I can keep track

            1 Reply Last reply Reply Quote 0
            • A Offline
              amanzimdwini @strawberry 3.141
              last edited by Jul 26, 2016, 4:12 AM

              @strawberry-3.141
              Would you mind making that a module for everyone to use? (and I like the idea of “discreet”

              P 1 Reply Last reply Jul 26, 2016, 11:49 AM Reply Quote 0
              • S Offline
                strawberry 3.141 Project Sponsor Module Developer
                last edited by Jul 26, 2016, 8:01 AM

                i will have a look on this later today ;)

                Please create a github issue if you need help, so I can keep track

                1 Reply Last reply Reply Quote 0
                • P Offline
                  PointPubMedia @amanzimdwini
                  last edited by Jul 26, 2016, 11:49 AM

                  @amanzimdwini I agree ;)

                  S 1 Reply Last reply Jul 26, 2016, 12:11 PM Reply Quote 0
                  • S Offline
                    strawberry 3.141 Project Sponsor Module Developer @PointPubMedia
                    last edited by Jul 26, 2016, 12:11 PM

                    it’s already done https://forum.magicmirror.builders/topic/409/mmm-ip

                    Please create a github issue if you need help, so I can keep track

                    1 Reply Last reply Reply Quote 1
                    • 1 / 1
                    1 / 1
                    • First post
                      6/10
                      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