thank you! It’s now working :)
I thought that my scheduleupdate was working but it didn’t (only 2 times )
with the Log function I could find the problem easy .
Read the statement by Michael Teeuw here.
Best posts made by washichi
-
RE: Help needed simple API based module
-
RE: Compliments text cycler without the randomizer
@cnelso24 Okay, so what you want is more something like hello world, but 6 times.
I’ll get my PI back tomorrow, I will setup magicmirror and play around with the modules.
I’m planning on making my own module, so this is a good exercise :pI’ll let you know If I got it working
Latest posts made by washichi
-
RE: Help needed simple API based module
@ooom416354 Yes, but other modules are also that.
I used the default module “weatherforecast” it is an simple api based module that gets the data and displays it in a table.I’m now trying to add a map, and then display the ISS current position on that, but implementing this in a module is a lot harder then normal javascript :p.
-
RE: Help needed simple API based module
thank you! It’s now working :)
I thought that my scheduleupdate was working but it didn’t (only 2 times )
with the Log function I could find the problem easy . -
RE: Help needed simple API based module
@yawns No I didn’t, but that should be exactly the same thing.
If I hardcode the (any) variable in “issRequest.onreadystatechange = function() {”
then it just doesn’t display, so it looks like it isn’t going in that function.
but if I hardcode the (any) variable after that function It displays.So I can display the variable (message), but the variable doesn’t get filled with the request.
-
RE: Help needed simple API based module
@yawns thank you!
the module shows now this.message and refreshes it with the schedule.
however I am still doing something wrong in my request:updateISS: function() { var url = this.config.apiBase; var self = this; var opennotifyRequest = new XMLHttpRequest(); opennotifyRequest.open("GET", url, true); this.message = "in updateISS"; opennotifyRequest.onreadystatechange = function() { self.message = "request status: "+ to.String(this.status); // not displayed if (this.readyState === 4) { if (this.status === 200) { var resp = JSON.parse(this.response); self.latitude = resp.iss_position.latitude; self.longitude = resp.iss_position.longitude; self.timestamp = resp.timestamp; self.message = resp.message; self.message = "dit gebeurt niet"; } } }; opennotifyRequest.send(); self.updateDom(); }
I can’t set message in that function, for example line 86. I use self/this wrong, or the function isn’t executing. but the code continous because when I set the message before or after that function it gets displayed.
-
RE: Help needed simple API based module
@yawns yeah that solved it, my module is now at least showing :).
sorry, stupid mistake haha, I though I checked it .
Thanks for your help -
RE: Help needed simple API based module
@cowboysdude
mhh okay, thank you! I’ll try to implement it, looking to the default weatherforecast module as example.from the modules readme I don’t totally understand why I need this, it sounds like optional . and I don’t have notifications. (or are updating modules seen as notification?)
-
Help needed simple API based module
Hi,
I just started creating modules, and don’t have any javascript experience.
I am trying my luck on a really simple API based ISS tracker module.
but I am doing something wrong.here is my code: https://github.com/washichi/MMM-ISS-current-location
the logs mm-out-0.log &mm-error-0.log don’t give me weird errors.
and I compiled it with http://liveweave.com/ (can’t find the right plugin for sublime3 ) so I’m doing something wrong in the code.I hope someone can help me to see what I did wrong.
-
RE: Module programming preview, jsfiddle?
@morozgrafix I am getting the error in sublime3. when only building mmm-module.js
(so I think my magicmirror/modules directory is not really relevant)Iḿ now just trying to create a good sublime3 environment to compile my modules.
So ill take a look atht the packages you mentioned.
Since I’m new to javascript I think that will help me to get some basic errors out.now trying to make an ISStracker module:
https://github.com/washichi/MMM-ISS-current-location
but it’s not showing on my magicmirror yet :p -
RE: Module programming preview, jsfiddle?
Can you tell me what plugins you use in Sublime3?
I have sublimelinter installed, and that works, but it isn’t complete:
I called “this.config.updateInterval” and didn’t have updateinterval defined, but didn’t get an error :(.and if I build my module I get:
Module.register("ISS-current-location",{ ^ ReferenceError: Module is not defined
Anyway to ignore that error?
-
RE: Compliments text cycler without the randomizer
@cnelso24 Okay, so what you want is more something like hello world, but 6 times.
I’ll get my PI back tomorrow, I will setup magicmirror and play around with the modules.
I’m planning on making my own module, so this is a good exercise :pI’ll let you know If I got it working