Read the statement by Michael Teeuw here.
Nobody knows???
-
you provide no infos related to your problem, we are not clairvoyant
-
-
@karsten13 ok.
-
i will send u my code part and the error later. thanks for ur reply!
i hope we can fix this problem.
-
var stromRequest = new XMLHttpRequest(); var requestURL = 'http://192.168.178.44/cm?cmnd=var1'; stromRequest.onreadystatechange = function () { if (stromRequest.readyState === XMLHttpRequest.DONE) { if(stromRequest.status === 200) { var json_parse = JSON.parse(stromRequest.responseText).Var1 var stromverbrauch = Number(json_parse * 0.30)//.toFixed(2); var verbrauch = stromverbrauch.toFixed(2);
this is my request and the error:
-
so I assume the code snippet is from the module.js (not from node_helper.js). The url with IP 192.168.178.44 is pointing to another device in your network and is therefore different to the IP where mm is running?
If mm has the same IP you could try
localhost
instead, if the IP’s are different you can try this:var requestURL = location.protocol + "//" + location.host + "/cors?url=http://192.168.178.44/cm?cmnd=var1";
The 2. option with the cors url works only with the
develop
branch of mm (will be in the next official relase coming 1. April). -
thats right, its from the module.js. i read i can fix this issue with the node_helper.js but i dont know how to write the code down in the node_helper.js to get the result from my url.
i will try ur answer later.
i know how to write code in the node_helper.js form the request?
thanks
-
@karsten13 said in Nobody knows???:
var requestURL = location.protocol + “//” + location.host + “/cors?url=http://192.168.178.44/cm?cmnd=var1”;
now I get this error:
cannot get /cors.
-
you switched to
develop
and pulled the latest version of mm? Looks like not. -
@fischi87 here is how to get to develop branch, depending on how u installed
https://forum.magicmirror.builders/topic/14327/testing-new-fixes-or-solving-current-problems-with-next-release-code