MMM-WorldTides, no output on screen



  • @yawns and others,
    Just installed your module WorldTides.

    On screen I only get the info that the WorldTides data is loading … But even after 2 minutes it is still loading. What am I doing wrong?
    I can’t find my error, grrr !!!

    This is my part of the config.sys

    {
    	module		: 'MMM-WorldTides',
    	position 	: 'top_right',
    	header		: 'Getijden',
    	config		: {
    		longitude	: '52.212',
    		latitude	: '4.399',
    		appid		: '************************************'
    	}
    },
    

    When I do a call in my browser I get a result from the server.
    The call I make :
    http://www.worldtides.info/api?extremes&lat=52.212&lon=4.399&lenght=2592000000&key=************************************

    The result I get, within a second;

    {"status":200,"callCount":1,"copyright":"Tidal data retrieved from www.worldtide.info. Copyright (c) 2014-2017 Brainware LLC. Licensed for use of individual spatial coordinates on behalf of\/by an end-user. Source data created by Rijkswaterstaat \/ (Dutch Infrastructure Service) and is not subject to copyright protection. NO GUARANTEES ARE MADE ABOUT THE CORRECTNESS OF THIS DATA. You may not use it if anyone or anything could come to harm as a result of using it (e.g. for navigational purposes).","requestLat":52.212,"requestLon":4.399,"responseLat":52.2667,"responseLon":4.3,"atlas":"Netherlands","station":"Meetpost Noordwijk","extremes":[{"dt":1506946453,"date":"2017-10-02T12:14+0000","height":0.751,"type":"High"},{"dt":1506973424,"date":"2017-10-02T19:43+0000","height":-0.573,"type":"Low"},{"dt":1506990484,"date":"2017-10-03T00:28+0000","height":1.041,"type":"High"},{"dt":1507019577,"date":"2017-10-03T08:32+0000","height":-0.543,"type":"Low"},{"dt":1507035216,"date":"2017-10-03T12:53+0000","height":0.89,"type":"High"},{"dt":1507063479,"date":"2017-10-03T20:44+0000","height":-0.649,"type":"Low"}]}
    

    I even tried the longitude and latitude as a number, but that is not a solution either.
    longitude : 52.212, (without ‘’)


  • Moderator

    @pjkoeleman
    Hi, I haven’t played around with the module for a long time and I don’t have a magic mirror in use currently.
    I will try to take a look into this tomorrow, but I cannot promise.



  • @yawns
    Thanks for your time.
    When I can help (test) give a call .


  • Module Developer

    @yawns said in MMM-WorldTides, no output on screen:

    I will try to take a look into this tomorrow, but I cannot promise.

    XMLHttpRequest cannot load http://www.worldtides.info/api?extremes&lat=40.543&lon=-74.140&start=1506916800&key=da40ad48-3c4f-4fd7-b50a-2138e8866e2b. Redirect from 'http://www.worldtides.info/api?extremes&lat=40.543&lon=-74.140&start=1506916800&key=da40ad48-3c4f-4fd7-b50a-2138e8866e2b' to 'https://www.worldtides.info/api?extremes&lat=40.543&lon=-74.140&start=1506916800&key=123456789 has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:8080' is therefore not allowed access.
    


  • @Mykle1
    I would highly appreciate it.


  • Module Developer

    @pjkoeleman said in MMM-WorldTides, no output on screen:

    I would highly appreciate it.

    What? haha That post was directed to yawns. I thought I would give him a headsup on the error.

    However, tell me what info you are looking for regarding the tides. Do you simply want the current day’s high and low tides with the times they occur? I could try and put something together for you if I have the time. Then yawns can look at his module when he has the time.



  • @Mykle1 said in MMM-WorldTides, no output on screen:

    However, tell me what info you are looking for regarding the tides. Do you simply want the current day’s high and low tides with the times they occur?

    I’am living near the coast and often go for a walk along the beach. It’s handy to now when it’s high or low tides, especially if I want to photograph. But I have patience, do not hurry, just worry that I do not get it working.



  • @pjkoeleman said in MMM-WorldTides, no output on screen:

    http://www.worldtides.info/api?extremes&lat=52.212&lon=4.399&lenght=2592000000&key=

    @yawns and @Mykle1,

    I found the problem, yeah !!!
    The apiBase URL has to change from

    apiBase: "http://worldtides.info/api"
    

    to

    apiBase: "https://worldtides.info/api"
    

  • Moderator

    @pjkoeleman
    Yep, you are right. However you cannot simply replace the apibase, do you? I guess I have to change the module to use request() to allow access to https and to avoid no-origin replies.



  • @yawns said in MMM-WorldTides, no output on screen:

    Yep, you are right. However you cannot simply replace the apibase, do you? I guess I have to change the module to use request() to allow access to https and to avoid no-origin replies.

    I replaced the apibase in the file MMM-WorldTides.js as discribed above (line 29). So I think you should update the module with this.
    I will be looking in to your code to make some changes in the layout off the out put, so when you are interested let me now.


Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.