MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. darrene
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    D
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 7
    • Posts 58
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Airplay 'Now Playing' module - help badly needed

      So step 2, I have made a short javascript file that will read a fifo file and decode what it sees in the buffer.

      var fs = require('fs')
      var fifo = fs.createReadStream('shairport-sync-metadata')
      fifo.on('data', function(fifoHexBuffer) {
          fifoHexBuffer = fifoHexBuffer.toString();
          console.log(fifoHexBuffer)    
      })
      

      At the moment, the code runs once and stops once it reads. My next task is to have it continue, then I’ll have to make it into a node-helper script, to interact with my base64 decoder/display

      posted in Development
      D
      darrene
    • RE: First attempt on a 40" Flatscreen

      Fantastic work @PaulB - it looks awesome. I look forward to seeing the new modules once you get around to them :)

      posted in Show your Mirror
      D
      darrene
    • RE: Airplay 'Now Playing' module - help badly needed

      Ah! Thanks so much @alexyak - that’s fantastic. I can now move forwards :)

      So parenthesis are needed to call the function and explicitly not pass it a parameter. Is that right?

      posted in Development
      D
      darrene
    • RE: Airplay 'Now Playing' module - help badly needed

      The first step of my module, which simply displays a base64-decoded string in the mirror reads like this.

      /* global Module */
      /* Magic Mirror
      * Module: base64
      *
      * By Michael Teeuw http://michaelteeuw.nl
      * MIT Licensed.
      */
      
      Module.register("base64",{
      
          // Default module config.
          defaults: {
                  text: "Hello World!"
          },
      
      
        frombase64: function() {
          var string = 'RGFycmVu';
          var decodedString = atob(string);
          return decodedString;
          },
      
          // Override dom generator.
          getDom: function() {
                  var wrapper = document.createElement("div");
                  var decstr = this.frombase64
                  var msgstr = document.createTextNode(decstr);
                  wrapper.appendChild(msgstr);
                  return wrapper;
          }
      });
      

      It seems like it should work, but I get a literal string rather than a value returned…
      0_1477518803379_mm.jpg

      posted in Development
      D
      darrene
    • RE: Please help

      Hi @moris, i’m sorry nobody else has responded.

      The automatic Magicmirror2 installation should have done everything necessary. You might need to rotate the screen. If you need to do this, just type sudo /boot/config.txt and put rotate_display=1 at the end. If it all looks okay already, don’t bother with this!

      to run the Magic mirror, make sure you are in the Magicmirror directory:
      cd MagicMirror
      You will need to make a file in the config folder, called config.js. There is a config.js.sample you can use. Just use cp config/config.js.samaple config/config.js to copy it to the file that is needed

      then type:
      npm start
      and the mirror should start :)

      Hallo @moris, es tut mir leid, dass niemand sonst reagiert hat.

      Die automatische Magicmirror2 Installation sollte alles Notwendige getan haben. Möglicherweise müssen Sie den Bildschirm drehen. Wenn Sie dies tun müssen, geben Sie einfach sudo /boot/config.txt und setzen rotate_display = 1 am Ende. Wenn alles schon okay aussieht, kümmere dich nicht darum!

      Um den Magic-Spiegel auszuführen, stellen Sie sicher, dass Sie sich im Magicmirror-Verzeichnis befinden:
      cd MagicMirror
      Sie müssen eine Datei im config-Ordner namens config.js erstellen. Es gibt eine config.js.sample, die Sie verwenden können. Verwenden Sie einfach
      cp config / config.js.samaple config / config.js
      um es in die Datei zu kopieren, die benötigt wird

      Dann geben Sie ein:
      npm start
      Und der Spiegel sollte beginnen :)

      posted in General Discussion
      D
      darrene
    • Airplay 'Now Playing' module - help badly needed

      I’ve really been struggling to write my first module.

      I’ve used Shairport-Sync to allow my mirror to act as an Airplay device - something which works a treat.
      I’ve added Shairport-Sync-Metadata-Reader in order to base64-decode the playing track metadata, which Shairport outputs in xml format to a FiFo file.

      What I’m trying to do is create a module to read the FiFo stream, base64-decode the values and it sees, and display a couple of the fields (Artist/Track)

      I think I’ll need a node-helper to do the watch/decode/filter and then send any Artist & Track fields it sees to the module which then displays it.

      I’ve created this which pops up the decoded result for a hardcoded string

      <script>
      var string = 'RGFycmVu';
      var decodedString = atob(string);
      window.alert(decodedString);
      </script>
      

      I’ve tried without success though to incoporate this as a function into a .js file, so that I can display my test-decode on the mirror.
      I’ve been looking through all the modules I can find to find something I can use as an example but no luck. I know I need to pass the decodedString variable somehow but have struggled to work out how :(

      posted in Development
      D
      darrene
    • RE: Withings

      So the Python module I was trying to re-use didn’t work. I suspect Withings have changed their API or something else has changed. Following the steps on their website though, did work and I was able to send a command to retrieve my data.

      Now it’s a case of trying to code it up into a module!

      posted in Requests
      D
      darrene
    • RE: Withings

      I’ve been having a very quick play with this python script on my Pi, which demonstrates the API which could form the basis of a simple weight-data retrival module.

      I’m struggling with a few issues at the moment though - I’ve git clone’d and npm install’d, created a test.py file as indicated by the readme and in it I’ve put in it my Withings API key and secret values.

      I had to sudo pip install requests_oauthlib as that was a requirement which wasn’t installed.

      I’m SO nearly there I think! when my test.py file runs, it generates a Withings URL to authorise the app, I authorise on the website and am given an oauth response verification code, but when I paste it back into the script response, I get an error which i think is at the point the script tries to parse them through auth.get_credentials (after this point, the script gets my last measured weight):

       File "test.py", line 8, in <module>
       creds = auth.get_credentials(oauth_verifier)
       File "/home/pi/MagicMirror/modules/python-withings/withings/__init__.py", line 107, in get_credentials
      tokens = oauth.fetch_access_token('%s/access_token' % self.URL)
      File "/usr/local/lib/python2.7/dist-packages/requests_oauthlib/oauth1_session.py", line 304, in fetch_access_token
      token = self._fetch_token(url, **request_kwargs)
      File "/usr/local/lib/python2.7/dist-packages/requests_oauthlib/oauth1_session.py", line 361, in _fetch_token
      raise ValueError(error)
      ValueError: Unable to decode token from token response. This is commonly caused by an unsuccessful request where a non urlencoded error message is returned. The decoding error was No JSON object could be decoded.
      

      Oh well. It’s progress I suppose.

      posted in Requests
      D
      darrene
    • Audio visualiser

      If anyone could spare the time to write a small, attractive visualiser for audio output, I’d be eternally grateful. It’s on my list of things to try and do but I’m struggling to find the time I need.

      I think it could be a useful option for anyone using sound-orientated modules.

      I’m trying to come up with something along the lines of the Siri speech waveformalt text

      Some clever soul has already come up with a JS implementation of the waveform on GitHub, which means a lot of the heavy lifting is already done…

      posted in Requests
      D
      darrene
    • Suggestions for relocated screen buttons?

      I’d be interested to hear from anyone who has a neat solution to reusing and relocating the control buttons from their monitor. I’ve done a bit of searching but haven’t really found anything much…

      I’ve decided to follow @trividar 's Ikea Hovet frame idea for my mirror. I’d like to re-use the montior buttons somehow and make them easy to access. The best idea I have at the moment, is to buy some small, maybe illuminated micro-buttons and get out the soldering iron :)

      posted in Hardware
      D
      darrene
    • 1 / 1