• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
  1. Home
  2. darrene
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

darrene

@darrene

10
Reputation
1.7k
Profile views
58
Posts
0
Followers
0
Following
Joined Oct 11, 2016, 7:24 PM
Last Online May 13, 2017, 7:08 AM

darrene Unfollow Follow

Best posts made by 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
    Oct 26, 2016, 6:34 PM
  • RE: Peek-a-boo...

    Hey @Baltibu, @carteblanche I’ll help all I can.
    So to make sure I got rid of any problems, I started with a clean MagicMirror install
    Then I install Alexyak’s voicecontrol module
    to get my USB microphone working, I need to overwrite the ~/.asoundrc file with these contents;

      #asym fun start here. we define one pcm device called "pluged"
      pcm.pluged {
      type plug
      #this is your output device
      slave.pcm "hw:0,1"
      }
    
     #one called "dsnooped" for capturing
    pcm.dsnooped {
    ipc_key 1027
    type dsnoop
    #this is your input device
    slave.pcm "hw:1,0"
    }
    
    #and this is the real magic
    pcm.asymed {
    type asym
    playback.pcm "pluged"
    capture.pcm "dsnooped"
    }
    
    #a quick plug plugin for above device to do the converting magic
    pcm.pasymed {
    type plug
    slave.pcm "asymed"
    }
    
    #a ctl device to keep xmms happy
    ctl.pasymed {
    type hw
    card 0
    }
    
    #for aoss:
    pcm.dsp0 {
    type plug
    slave.pcm "asymed"
    }
    
    ctl.mixer0 {
      type hw
      card 0
     }
    
     pcm.!default {
      type plug
      slave.pcm “asymed”
      }
    

    Then I start the Audio Preferences control panel in the Raspain GUI and select controls (tick PCM) for the sound card and select controls (tick microphone) for the USB microphone.

    I then created a PMDL keyword test file on the snowboy website and downloaded it.
    The PMDL I created I called smartmirror.pmdl - it recognised the phrase ‘smart mirror’
    Put this file in the ~/MagicMirror directory.

    Now it’s time to test!

    Add the following to your /config/config.js:

            	{
                    module: 'voicecontrol',
            	position: 'bottom_left',
            	config: {
                	models: [
                        	{
       			                 keyword: "show alert",  // keyword
                       			 description: "Say 'Show Alert' to show an alert",
                        		 file: "smartmirror.pmdl", // trained model file name
                        		 message: "SHOW_ALERT"  // notification message that's broadcast in the MagicM
    
               	     		},
               	 		]
           	 	}
        	},	
    

    start your magic mirror in dev mode:
    npm start dev

    wait for everything to start (you may get some ALSA stuff in the terminal window but that isn’t necessarily a problem). Ensure the dev window is in Console mode, so you can see any console messages as Magic Mirror runs. Once everything has started okay, try saying ‘smart mirror’ (or whatever your keyword is) If it’s all working, you should see two things happening:

    1. An empty, white alert box should pop up and then disappear on the Magic Mirror
    2. In the Dev console, you should see the alert notification being broadcast to all the modules.

    If you get both of these happening, you’re 90% of the way there :)
    If you only see the broadcast in the Dev console but not the alert, there’s a problem with the config.js or the alert.js
    If you don’t see the broadcast, you need to double-check everything, or the microphone isn’t working… You’ll need to solve this first.

    What we’ve just done, is made use of the MagicMirror notification broadcast and one of the default modules ‘Alert’

    The next step is to create a load of PMDL files for all of the words you want the mirror to respond to. Copy all the downloaded PMDLs into the MagicMirror root folder.

    You can now add to that section of the config.js for each PMDL file. The only thing to change is the file: entry (to be the PMDL file, and the description: entry (this will just add to what voicecontrol displays on the MagicMirror screen and will help in remembering what keywords you’ve got active).

    So… You should now have a bunch of trigger words that you can test. Each one will send a notification (which you will see in the dev console) and will briefly trigger the alert popup at the top of the magic mirror screen.

    All you need to do now, is change the SEND_ALERT that is broadcast, to something more useful.

    I wanted to hide and show modules so I ended up with something like this in my config.js:

            	{
                    module: 'voicecontrol',
            	position: 'bottom_left',
            	config: {
                	models: [
                        	{
       			                 keyword: "Hide Calendar",  // keyword
                       			 description: "Hide Calendar",
                        		 file: "hidecalendar.pmdl", // trained model file name
                        		 message: "HIDE_CALENDAR"  // notification message that's broadcast in the MagicM
    
               	     		},
                        	{
       			                 keyword: "Show Calendar",  // keyword
                       			 description: "Show Calendar",
                        		 file: "showcalendar.pmdl", // trained model file name
                        		 message: "SHOW_CALENDAR"  // notification message that's broadcast in the MagicM
    
               	     		},
    
               	 		]
           	 	}
        	},	
    

    Now, when I say “Show Calendar”, a SHOW_CALENDAR notification will be broadcast to all the modules and when I say “Hide Calendar”, a HIDE_CALENDAR notification will be broadcast to all the modules.

    None of the modules are going to understand what SHOW_CALENDAR and HIDE_CALENDAR mean, so we need to tell in this case, the calendar module, what to do.

    Make a backup copy of the /modules/default/calendar/calendar.js and then edit it so that it can act on NotificationReceived events.

    This is the bit that tripped me up initially. Modules will have a SocketNotificationReceived - this is where they interact with their node-helper.js file. It looks similar to what we’re after but not quite! There probably isn’t a plain ‘NotificationReceived’ section, so we’ll add one - we can always delete the .js and restore our backup if things go horribly wrong.

    I went ahead and added this to my calendar.js

    // voice control notification handling
    NotificationReceived: function (notification, payload) {
    	if (notification === "HIDE_CALENDAR") {
    		this.hide();
    	} else if (notification === "SHOW_CALENDAR") {
    		this.show();
    	} 
      },
    

    (I added this just after the SocketNotificationReceived section)

    Start your magic mirror in dev mode again and this time you should see a SHOW_CALENDAR or HIDE_CALENDAR notification broadcast when you say the appropriate keyword. If the NotificationReceived code is working, you will also see the Calendar appear or disappear!

    If you’ve made it this far, congratulations. You’re home and dry. You can now extend it by adding the same code, with different notifications in the other modules you want to control. I added a ‘HIDE_ALL’ and ‘SHOW_ALL’ to all of my modules so that I can switch them all on or off , as well as independantly.

    Give it a go and see how you get on. In each case, just take little steps and back any files up before you change them and you should be fine. I know next to nothing and I’ve managed, so it’s definitely doable…and you’ll have a big grin when it works.

    If you have any more trouble just give a shout and I’ll help all I can.

    posted in Troubleshooting
    D
    darrene
    Oct 20, 2016, 11:22 PM
  • RE: Please help

    @Moris, when you use the copy (cp) command, I think you have spaces where you shouldn’t.
    if you are in the MagicMirror folder, the command should be;
    cp(space)config/config.js.sample(space)config/config.js

    it is possible to use to auto-complete the text where a file or folder exists if you want to.
    I am not sure why you are getting the Npm ERR! messages. I’m hoping someone else can help here. Are you using npm start on the pi locally or are you SSH’ing into it? I’ve only ever started mine when I am on the Pi itself.

    Edit: @bhepler is a faster typer than me! :)

    your /boot/config.txt should only have =1 and not =:1 for the display_rotate command. Here is an example;

    # For more options and information see
    # http://www.raspberrypi.org/documentation/configuration/config-txt.md
    # Some settings may impact device functionality. See link above for details
    
    # uncomment if you get no picture on HDMI for a default "safe" mode
    #hdmi_safe=1
    
    # uncomment this if your display has a black border of unused pixels visible
    # and your display can output without overscan
    #disable_overscan=1
    # uncomment the following to adjust overscan. Use positive numbers if console
    # goes off screen, and negative if there is too much border
    #overscan_left=16
     #overscan_right=16
    #overscan_top=16
    #overscan_bottom=16
    
    # uncomment to force a console size. By default it will be display's size minus
    # overscan.
    #framebuffer_width=1280
    #framebuffer_height=720
    
    # uncomment if hdmi display is not detected and composite is being output
    #hdmi_force_hotplug=1
    
    # uncomment to force a specific HDMI mode (this will force VGA)
    #hdmi_group=1
    #hdmi_mode=1
    
    # uncomment to force a HDMI mode rather than DVI. This can make audio work in
    # DMT (computer monitor) modes
    #hdmi_drive=2
    
    # uncomment to increase signal to HDMI, if you have interference, blanking, or
    # no display
    #config_hdmi_boost=4
    
    # uncomment for composite PAL
    #sdtv_mode=2
    
    #uncomment to overclock the arm. 700 MHz is the default.
    #arm_freq=800
    
    # Uncomment some or all of these to enable the optional hardware interfaces
    #dtparam=i2c_arm=on
    #dtparam=i2s=on
    #dtparam=spi=on
    
    # Uncomment this to enable the lirc-rpi module
    #dtoverlay=lirc-rpi
    
    # Additional overlays and parameters are documented /boot/overlays/README
    
    # Enable audio (loads snd_bcm2835)
    dtparam=audio=on
    display_rotate=1
    

    Hope that helps!

    posted in General Discussion
    D
    darrene
    Oct 28, 2016, 8:27 PM
  • RE: Dynamic travel time

    So having realised the simplest approach to a week/weekend commute display would simply be to code the date information into MM-Traffic’s MMM-Traffic.js file, I’ve added the following logic to the getParams function;

    getParams: function() {
    var params = '?';
    

    -> var d = new Date();
    -> var n = d.getDay();

        params += 'mode=' + this.config.mode;
        params += '&origin=' + this.config.origin;
    

    -> if (n < 6) {params += ‘&destination=’ + “Cheltenham”;}
    -> else {params += ‘&destination=’ + “Gloucester”;}

        params += '&key=' + this.config.api_key;
        params += '&traffic_model=' + this.config.traffic_model;
        params += '&language=' + this.config.language;
        return params;
    },
    

    Which works like a dream :) My first bit of javascript. I’m so excited!

    I’d like to round it off by adjusting the
    ‘current commute is’
    and
    'origin to destination displays to be along the lines of ‘Work Commute’/‘Town Commute’ and ‘Home to Work’/‘Home to town’ but I’m struggling to find how to inject the logic.

    I can see the current commute is in the defaults and symbols section. Ideally I want to change the defaults section.

    The other is in the //routename section, but again I can’t work out how to make the alteration.

    posted in Development
    D
    darrene
    Oct 15, 2016, 8:24 AM
  • RE: MMM-Hue

    Thanks @Mitchfarino - it was user-error. I visited the developer page rather than clicking on the link you provided :) I deleted my previous post in shame after I realised my error.

    All sorted now. It’s fabulous. Thanks for sharing your code with the community by the way!

    posted in Utilities
    D
    darrene
    Oct 14, 2016, 12:06 PM
  • 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
    Oct 23, 2016, 10:01 PM

Latest posts made by darrene

  • RE: Parsing stdout into a module for display

    Thanks so much @strawberry-3.141, that’s just what I needed to set me in the right direction. I’ll do a bit of reading and follow this approach,. I’ll be sure to post how I get on :)

    posted in Requests
    D
    darrene
    Nov 5, 2016, 1:29 PM
  • Parsing stdout into a module for display

    Is anyone able to provide an example of a simple module that can parse/display a printf output on the mirror? I’m trying to do this but really struggling to understand how to. I can use fprintf to get to a file but that’s not much help to me either.

    Ideally I would like to printf a value that will then be displayed in my module on the mirror…

    posted in Requests
    D
    darrene
    Nov 4, 2016, 8:06 PM
  • RE: MMM-Hue

    Not directly - I think it’d be a lot of work and as you say, would need a way of interfacing with the mirror. At the end of all that you could just use The Hue/Elgato Eve/Siri app to do the same thing.

    What I wondered though, was if something like MMM-Schedule was installed, it’d be really easy to put a schedule in the config.js to turn specific lights on and off on certain schedules - it could send the notification schedule which MMM-Hue could react to. It’d mean you/the mirror could schedule the lighting schemes automatically to run while you were away from home.

    If MMM-Hue could react to a HUE_LIGHT_ON and HUE_LIGHT_OFF notification, perhaps with a light-ID and Brightness value as the payload, that’d do the trick wouldn’t it?

    A scheduling GUI would be uber-cool, but hard-coding the config.js would be enough for most, I’d have thought…

    It’s on my (very long) list of things to have a go at, if I get a chance :)

    posted in Utilities
    D
    darrene
    Oct 30, 2016, 5:06 PM
  • RE: MMM-Hue

    Hi @Mitchfarino, I was just wondering if you’d considered extending the module to control lighting schedules?

    It suddenly struck me that as the mirror is always on and stays in the house, it might be very really cool (not to mention useful when you’re away) to have a capability in the module to turn on/off dim lights on a hardcoded schedule or time/day combo.

    From there it could even be a short hop to link it up the the MMM-RemoteControl module, to set schedules remotely.

    posted in Utilities
    D
    darrene
    Oct 29, 2016, 2:59 PM
  • RE: MMM-forecast-io -- Localized up to the minute weather

    Hi @dmcinnes, thank you for sharing an awesome module. It’s fantastic - the first one I installed and I think it must be the only one I haven’t swapped out since :)

    Is there any chance of having a precipitation/temperature graph like the one from Jangellx’s variant of @MichMich’s MagicMirror1, which could be swapped out for the current precipitation graph?
    0_1477752420244_MMM-weather.jpg

    The bulk of the javascript looks to be in the bottom half of this code: GitHub, uses d3 and d3min but it’s completely beyond me how to Frankenstein the code together…

    It’d give a superb optional look to a lovely module!

    posted in Utilities
    D
    darrene
    Oct 29, 2016, 2:50 PM
  • RE: Airplay 'Now Playing' module - help badly needed

    Hmm, using a child process doesn’t return anything either :(

    The shairport metadata reader is a compiled C program which uses printf to return the metadata to the console:

    pi@raspberrypi:~/fifo-js $ ~/shairport-sync-metadata-reader/shairport-sync-metadata-reader < /tmp/shairport-sync-metadata
    
    Artist: "Sohn".
    Title: "Tremors".
    
    ^C
    pi@raspberrypi:~/fifo-js $ 
    

    But I dont’ seem to be able to parse what’s being sent to stdout from my javascript

    If anyone has any examples that work, I’d be grateful.

    posted in Development
    D
    darrene
    Oct 29, 2016, 12:04 PM
  • RE: Please help

    have you tried a sudo apt-get update ?
    It might be worth giving that a try - afterwards, reboot then try re-running npm start again

    posted in General Discussion
    D
    darrene
    Oct 28, 2016, 11:05 PM
  • RE: Airplay 'Now Playing' module - help badly needed

    So a bit more testing and things aren’t looking as rosy as I’d first thought. Before trying fifo-js, I’d experimented with the filesystem readStream - If i try looping that I end up with a java out of memory condition.

    The fifo-js approach works with a fifo file that I echo things into to test, but doesn’t return anything while the Shairport service has it open for some reason?

    There is a metadata reader script which I could use to read the metadata and parse it. I’ve compiled the executable and it runs fine. I should be able to call that from my javascript module through child process, right?

    posted in Development
    D
    darrene
    Oct 28, 2016, 10:34 PM
  • RE: Please help

    @Moris, when you use the copy (cp) command, I think you have spaces where you shouldn’t.
    if you are in the MagicMirror folder, the command should be;
    cp(space)config/config.js.sample(space)config/config.js

    it is possible to use to auto-complete the text where a file or folder exists if you want to.
    I am not sure why you are getting the Npm ERR! messages. I’m hoping someone else can help here. Are you using npm start on the pi locally or are you SSH’ing into it? I’ve only ever started mine when I am on the Pi itself.

    Edit: @bhepler is a faster typer than me! :)

    your /boot/config.txt should only have =1 and not =:1 for the display_rotate command. Here is an example;

    # For more options and information see
    # http://www.raspberrypi.org/documentation/configuration/config-txt.md
    # Some settings may impact device functionality. See link above for details
    
    # uncomment if you get no picture on HDMI for a default "safe" mode
    #hdmi_safe=1
    
    # uncomment this if your display has a black border of unused pixels visible
    # and your display can output without overscan
    #disable_overscan=1
    # uncomment the following to adjust overscan. Use positive numbers if console
    # goes off screen, and negative if there is too much border
    #overscan_left=16
     #overscan_right=16
    #overscan_top=16
    #overscan_bottom=16
    
    # uncomment to force a console size. By default it will be display's size minus
    # overscan.
    #framebuffer_width=1280
    #framebuffer_height=720
    
    # uncomment if hdmi display is not detected and composite is being output
    #hdmi_force_hotplug=1
    
    # uncomment to force a specific HDMI mode (this will force VGA)
    #hdmi_group=1
    #hdmi_mode=1
    
    # uncomment to force a HDMI mode rather than DVI. This can make audio work in
    # DMT (computer monitor) modes
    #hdmi_drive=2
    
    # uncomment to increase signal to HDMI, if you have interference, blanking, or
    # no display
    #config_hdmi_boost=4
    
    # uncomment for composite PAL
    #sdtv_mode=2
    
    #uncomment to overclock the arm. 700 MHz is the default.
    #arm_freq=800
    
    # Uncomment some or all of these to enable the optional hardware interfaces
    #dtparam=i2c_arm=on
    #dtparam=i2s=on
    #dtparam=spi=on
    
    # Uncomment this to enable the lirc-rpi module
    #dtoverlay=lirc-rpi
    
    # Additional overlays and parameters are documented /boot/overlays/README
    
    # Enable audio (loads snd_bcm2835)
    dtparam=audio=on
    display_rotate=1
    

    Hope that helps!

    posted in General Discussion
    D
    darrene
    Oct 28, 2016, 8:27 PM
  • RE: Airplay 'Now Playing' module - help badly needed

    Luckily there is a fifo-js package available, which makes things super-easy!
    npm install fifo-js

    const FIFO = require('fifo-js')
    
    let fifo = new FIFO('fifo-testfile')
    
    var count = 1
    while (count == 1)
        {
        let text = fifo.readSync(fifo)
        console.log(text)
        }
    fifo.close()
    

    I’m getting there. I have an IN and I have an OUT in javascript. Now the hard work of joining the two together - interpreting and the decoding the appropriate metadata begins!

    posted in Development
    D
    darrene
    Oct 28, 2016, 5:34 PM
Enjoying MagicMirror? Please consider a donation!
MagicMirror created by Michael Teeuw.
Forum managed by Sam, technical setup by Karsten.
This forum is using NodeBB as its core | Contributors
Contact | Privacy Policy