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.

    wlan0 IP address in config file

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    2 Posts 2 Posters 206 Views 2 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.
    • H Offline
      hikano765
      last edited by lavolp3

      I want to open the server with the first IP address of the wlan0 network by putting ifaces.wlan0[0].address in the address part of the config.js file. I modified the code to do this, but I get an error on the screen.

      const os = require("os");
      
      const ifaces = os.networkInterfaces();
      const wlan0Address = ifaces.wlan0[0].address;
      
      let config = {
          address: wlan0Address, // The first IP address of the wlan0 network interface
          port: 8080, 
          // etc...
      };
      

      If I write the code as above, I don’t know why, but when I open the server, I don’t see any module screen on the web server. So I thought the modules were a problem, so I modified the code as follows, and the modules come out well from the web server at that address.

      /*const os = require("os");
      const ifaces = os.networkInterfaces();
      const wlan0Address = ifaces.wlan0[0].address;
      */
      let config = {
          address: "xxx.xxx.xxx.xxx", // static address
          port: 8080, 
          // etc...
      };
      

      The conclusion that I came up with through this process is

      const os = require("os");
      const ifaces = os.networkInterfaces();
      const wlan0Address = ifaces.wlan0[0].address;
      

      I think the code in the above part is problematic, I want to know exactly what the problem is with this code, and how to fix the code to solve it.

      In addition, since English is not the main language, I hope you understand that my writing may have some grammatical errors.

      S 1 Reply Last reply Reply Quote 0
      • S Away
        sdetweil @hikano765
        last edited by sdetweil

        @hikano765 a better thing would be to change the address: to address:“0.0.0.0”
        then it will listen on all the active network adapters .

        you will also have to fix the ipWhitelist to allow apps from outside systems to connect

        while you are developing your mm solution it’s easiest to do
        ipWhitelist:[],

        to allow apps from any system on your local betwork

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • 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