Read the statement by Michael Teeuw here.
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.
-
@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 usehttp://api.openweathermap.org/data/2.5/weather?q=London&APPID=YOUR_APIKEYfor 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_fakeThen, 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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login