MagicMirror² v2.5.0 is available! For more information about this release, check out this topic.

Running MM² as an offline demo with local module data references



  • Hi, as the title states, I am looking for a way to run mm² without an internet connection as a demo. It is for my end of year major project, and my MM² based smart display will need to run for days on end without connecting to the internet, since I will not have access to it to connect it to the internet when it is being marked. Is there a way I can change the modules so they refer to local files and not internet servers? I currently have the default calendar, weather, date and clock modules as well as mmm-localpublictransport (I think thats the name). It is also already setup to launch MM² when the raspberry pi is powered on.

    I think that the calendar and module should be able to refer to a local iCal file, but the weather and public transport modules rely on complex API’s that I’m not quite sure how to localise.

    Any help/tips would be appreciated.


  • Module Developer

    @albinolan
    If your API needs simple RESTful HTTP Request/Response, You can make Fake HTTP Endpoint in your local RPI with webserver module or nginx, Apache…

    By Example,
    currentWeather module use http://api.openweathermap.org/data/2.5/weather?q=London&APPID=YOUR_APIKEY for getting weather data.
    When you type that URL in your browser, you can get weather data like this;

    {"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"base":"stations","main":{"temp":293.288,"pressure":1026.05,"humidity":76,"temp_min":293.288,"temp_max":293.288,"sea_level":1033.49,"grnd_level":1026.05},"wind":{"speed":1.86,"deg":250.502},"clouds":{"all":100},"dt":1534836850,"sys":{"message":0.0038,"country":"GB","sunrise":1534827349,"sunset":1534878617},"id":2643743,"name":"London","cod":200}
    

    Now, you can make a local webserver(using nginx/Apache or makeing your own tiny webserver with node.js) to host this result and assign a URL like this; http://localhost:8080/currentweather_fake

    Then, modify currentweather module to direct this local url as API endpoint.
    It will work, I think.



  • @Sean Thanks, seems bout right. Will try it when I get home.