Read the statement by Michael Teeuw here.
MMM-Wunderground - 2 locations gives duplicate data from the first location
-
Hi,
This is because of offloading scheduling to the node_helper.js. Have a look here: https://github.com/RedNax67/MMM-WunderGround/issues/20
-
Thanks much for the replies. Ill try duplicating the module with different names. That link will be helpful.
-
@Francopacks Hello, did you ever manage to get this resolved. I checked the link that @RedNax sent however after much fiddling I cannot seem to get it to load.
I made sure the API key and location worked with just one instance of the module loaded and for my testing I have cleared my config.js apart from
modules: [ { module: 'MMM-WunderGround2', position: 'top_left', config: { apikey: 'MYAPIKEY', // private; don't share! pws: 'pws:KAKCANTW6', // alsaka Weather station currentweather: 0, coloricon: true, hourly: '1', fctext: '1', fcdaycount: "6", fcdaystart: "1", hourlyinterval: "2", hourlycount: "1", animationSpeed: 5000, alerttime: 10000, alerttruncatestring: "english:", roundTmpDecs: 0, UseCardinals: 1, layout: "vertical", windunits: "mph", sysstat: "0" } },
I then
-
Copied and pasted MMM-WunderGround as MMM-WunderGround2 in the modules folder
-
Changed name of MMM-WunderGround.JS to MMM-WunderGround2.JS
-
Changed name of MMM-WunderGround.css to MMM-WunderGround2.css
made some changes to the MMM-WunderGround2.JS file to accommodate the change of filename -
Module.register("MMM-WunderGround2"
getStyles: function() { return ["weather-icons.css", "weather-icons-wind.css", "MMM-WunderGround2.css"
I am stumped at 'ipc message name ’ in the main JS and Nodehelper
Any further help would be really appreciated
Thanks
-
-
@jamielola Hi!
You’ll also have to change the notifications (GET_WUNDERGROUND (request) and WUNDERGROUND (the reply sent by node_helper). Those notifications go systemwide so when 2 modules send the same one, the first one wins… The trick is to make them unique to the instance.
-
@RedNax Thank you for the quick response.
I understand now.
This may be a gap in my knowledge but if you only have one instance of wunderground in the config, and only one instance of MMM-WunderGround2 in the modules folder and rename that to MMM-WunderGround2 and point it to the correct references as I did above, it should work as the notifications are only using GET_WUNDERGROUND and WUNDERGROUND once.
I am just getting a constant ‘Loading’ (I have checked the console from the dev tools and it all looks like it has loaded correctly with no errors) I don’t understand why would that module not work with the rename and being the only module in the modules folder and specified in the config? (my aim was to rename it, get it working, then rename the notifications, then bring the original wunderground back in to the MM)
Sorry if this is going too far astray, you have created a great module and I am essentially trying to hack it a bit here.
-
I did after spending awhile looking through the code. Mostly it was trial and error. RedNax lays it out well.
-
Thanks @Francopacks now I know it is achievable I will have another crack at it tonight, if you have any tips that you think would be helpful I would love to hear them.
-
So I got home and was determined to get this resolved, this is the last part of the mirror and i’ll be dammed if I fail here.
- Switched Raspberry PI on
- waited for MM to load
- Looked on in astonishment that the module that I renamed to MMM-WunderGround2 was working and not stuck in ‘Loading’
As I had made all them changes above to MMM-WunderGround2 including the socket name changes I Pulled MMM-WunderGround from github into the modules folder so I would have a fresh orginal copy for the 2nd instance.
I wrote the new instance into the config file and refreshed the MM, low and behold…‘Loading’ for that new instance. However I knew what I needed to do…the oldest trick in the IT book, switch the Raspberry PI off and switch it back on again, hey presto - they both loaded fine showing separate data.
I’d like to thank @RedNax and @Francopacks
TLDR: make sure you carry out a restart when you change the names in the main.js and nodehelper file if they are stuck in loading.
-
the node_helper will only load when the mirror is actually started, modifications to a modules node_helper will require a full restart of the mirror software, not just a reload. Which I discovered when modifying the stock newsfeed module :D