• 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. romain
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Offline
  • Profile
  • Following 0
  • Followers 1
  • Topics 9
  • Posts 76
  • Groups 0

romain

@romain

17
Reputation
1.9k
Profile views
76
Posts
1
Followers
0
Following
Joined Mar 30, 2017, 3:10 PM
Last Online Nov 16, 2017, 1:08 PM

romain Unfollow Follow

Best posts made by romain

  • RE: VoiceControl module

    I did it, It wasn’t easy but it’s work, I can use voicecontrol and others voicecontrol driven module at the same time.
    I had to change my /etc/asound.conf file again (yes, again. Because changing it already solve some of my issue on the past)

    before my file looked like this:

    pcm.!default {
            type asym
            playback.pcm {
                    type plug
                    slave.pcm "hw:0,0"
            }
            capture.pcm {
                    type plug
                    slave.pcm "hw:1,0"
            }
    }
    

    Easy enough when you know what your doing (that wasn’t my case). this file is there to say what is the default device to playback and capture (A lot of application or software just use the default device so if the default configuration isn’t working for you, you need to change it for you.) In my cas ethe microphone is the “hw:1,0” and my speaker is the “hw:0,0”

    That worked well when my microphone is used by one application at the time. However, not so much when it need to be used by multiple ones.
    So my new /etc/asound.conf file is looking like this now

    pcm.myTest {
        type dsnoop
        ipc_key 2241234
        slave {
            pcm "hw:1,0"
            channels 1
        }
    }
    
    pcm.!default {
            type asym
            playback.pcm {
                    type plug
                    slave.pcm "hw:0,0"
            }
            capture.pcm {
                    type plug
                    slave.pcm "myTest"
            }
    }
    

    instead of directly say that my input device is the “hw:1,0” I say it’s “myTest”, which is describe above. myTest’s type is “dsnoop” , that’s whats allow the michrophone to be use by multiple application at the same time. The ipc_key is there with a random value because when I tested with arecord, it asked me to put one. The channels is there because it was on the documentation ( http://alsa.opensrc.org/Dsnoop ) >.> not sure what it does though.
    And there you go, after that I could use two voice control things at the time

    posted in Utilities
    R
    romain
    Apr 19, 2017, 10:44 AM
  • RE: 3 different Alexa modules, which one is the best?

    @borrigan

    AlexaPi service, when running, is “Always On”? It is always listening? How to test it directly without having integrated with MMM-AlexaPi Yet?

    you should hear “hello” when it start and then if you say Alexa you should hear “yes” then you can ask a question. It is always listening.
    A little tips for you, before using the service, try to run AlexaPi yourself. It provide you more debugging info that way.
    To do it, first desactivate the service with the terminal by writing sudo systemctl stop AlexaPi.service; sudo systemctl disable AlexaPi.service (you can reactivate later by doing sudo systemctl enable AlexaPi.service).
    Then you can run AlexaPi yourself by writing in the terminal /opt/AlexaPi/src/main.py -d (If you you putted it on that location anyway).

    Where can the activation word be configured? If I just say “Alexa”, should it work?

    in the yaml file in /etc/opt/AlexaPi/config.yaml there is a section pocketsphinx: (this is what is use to detect words I believe). in that section you have a key phrase: with "alexa" as a value. you can simply change the word to another word. Do not choose an over complicated one though, I think pocketsphinx try to guess what it supposed to sound like based on the spelling so if you choose a word not in English it might not guess correctly. You shoudl let alexa untill you get it to work though, because we know that one work for sure. You can test other word later.

    Finally, I spent hours troubleshooting the microphone. It is a very standard Logitech Microphone. I just could not get it working.

    I am no expert in sound but I going to try to help you.
    First, I rather have the output from arecord -l rather than arecord -L . the later give to much information to my understanding.
    The output of my arecord -l look like this:

    pi@raspberrypi:~ $ arecord -l
    **** List of CAPTURE Hardware Devices ****
    card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    

    I can see it’s “card 1” and “device 0” . that’s what I am interesting about.
    then, my aplay -l give me

    pi@raspberrypi:~ $ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
      Subdevices: 8/8
      Subdevice #0: subdevice #0
      Subdevice #1: subdevice #1
      Subdevice #2: subdevice #2
      Subdevice #3: subdevice #3
      Subdevice #4: subdevice #4
      Subdevice #5: subdevice #5
      Subdevice #6: subdevice #6
      Subdevice #7: subdevice #7
    card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    

    I using the default speaker output, which is the bcm2835 Alsa device which is “card 0” and “device 0”

    Knowing that you can test if your device working by doing the following:
    meaning you should be able to do a aplay -D hw:0,0 /usr/share/sounds/alsa/Front_Center.wav to test your speaker where “hw:0,0” (you could also put “plughw:0,0”) is your output device. Not sur what does “hw” and “plughw” mean, but the numbers are the card number and the device number. 0,0 in my example (remember the aplay -l above)
    this will use the vlc handler i beleive. You can test it the same way with play instead of aplay for the sox handler.

    you can test your michrophone in the same way by doing arecord -r 48000 -f S16_LE -D hw:1,0 -d 5 test.wav this will tell to record with the device hw:1,0 (in my example the card 1, device 0) for 5 second at a rate of 48000Hz and as S16_Le type (not sure what that is) and the result will be put in a file name test.wav. You can then play or aplay that file to see if the recording whent well.

    If you manage to make those command work. In the /etc/opt/AlexaPi/config.yaml there is a section sound: with a key “input_device:” and a key “output_device:” . Both of those key have for value “default” . for the output it’s easy, the default is the system defautl output which is hw:0,0 in my example. so you can let default or put “hw:0,0” instead if you want to use that output like me.
    The tricky part is the input. The input is your michrophone, but there is no “default” michrophone in the pi right ? so the chance AlexaPi understand what you are talking about are prett slim in my opinion.
    But when I wrote “hw:1,0” or “plugwh:1,0” instead of default , I had an error. For some reason it didn’t wanted to take that value. That’s when trickery was needed for me. I’m sure some people hadn’t to do that but I did.
    I creat a alsa configuration file name “asound.conf” with the following in it :

    pcm.myTest {
        type dsnoop
        ipc_key 816357492
        ipc_key_add_uid 0
        ipc_perm 0666
        slave {
            pcm "hw:1,0"
            channels 1
        }
    }
    
    pcm.!default {
            type asym
            playback.pcm {
                    type plug
                    slave.pcm "hw:0,0"
            }
            capture.pcm {
                    type plug
                    slave.pcm "myTest"
            }
    }
    

    This overrite what is the “default” configuration.
    type asym mean my playback and default arn’t on the same sound device.
    the playback.pcm describe what is my output device. In my example you can see i putted “hw:0,0” because I use the default output.
    the capture.pcm describe the input device (microphone). I put “MyTest” as a name which is describe above in the file (the name isn’t very explicit but I was testing and never changed it >.> )
    I am not going to enter in the detail for the myTest thing, but basically, it’s tell that the michrophone can be use in multiple application at the time and that it is the “hw:1,0” (remember the arecord -l thing above in the post)

    This asound.conf file should be put in the /etc/ folder.

    Well. That’s it. That’s what I had to do to make my microphone work for AlexaPi. Adapt this to your own devices and it might work like me.
    Remember to test it whitout the service first and when that’s work you activate the service and see if it still work or not. and if not we’ll try to understand why.

    posted in General Discussion
    R
    romain
    Apr 25, 2017, 8:02 AM
  • RE: PM2 startup Autostart didn't work

    I think the issue is that the command you need to run isn’t “sudo pm2 startup”.
    If you run “pm2 startup”, the real command you’ll need to run appear

    pi@raspberrypi:~ $ pm2 startup
    [PM2] Init System found: systemd
    [PM2] You have to run this command as root. Execute the following command:
    sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
    
    posted in Troubleshooting
    romainR
    romain
    Apr 4, 2017, 3:07 PM
  • RE: turning monitor on by incoming call?

    Never tryed those module but you should open the code, find where MMM-FRITZ-Box-CallMonitor detect a call (I beleive it’s on the socketNotificationReceived function).
    Then you should identify which function is called when the sensor detect you in the MMM-PIR-Sensor.
    Then you can add a this.sendNotification("THE_NAME_YOU_WANT", {}) in the MMM-FRITZ-Box-CallMonitor side and a

    if (notification === "THE_NAME_YOU_WANT") {
      //call the function that the sensor thing call
    }
    

    And it should work.
    I can’t help you more than that because I do not own those sensors.
    Good luck

    posted in Requests
    romainR
    romain
    Apr 25, 2017, 1:36 PM
  • RE: 3 different Alexa modules, which one is the best?

    @borrigan Hello. I end up successfully setting MMM-AlexaPi and MMM-alexa.
    they both have adventages and inconvinient
    -MMM-AlexaPi

    • This module isn’t a stand alone module. You need to install AlexaPi on you pi ( https://github.com/alexa-pi/AlexaPi )
    • This module is ONLY to show the status of AlexaPi. And this is AlexaPi that allow you to talk to Alexa. Meaning you don’t need the mirror at all to use it. But it’s neat because you can “see” what’s happening. Also Alexa saying “yes” when you say her name.
    • It might or might not be easy to setting up. Some people won’t have any issue using it by following the setup instruction and other would have to tweaks some things.
    • slower than MMM-alexa

    -MMM-alexa

    • It is a stand alone module. Meaning you just need this module to talk to Alexa.
    • The square indicate you the status . yellow is bad configuration if I recall correctly. Red is ready to listen. green is listening.
    • It is not activated by voice. You need either a button or to send the right notification to the module to make Alexa listen to you.
    • It seem to not answer as much as MMM-AlexaPi
    • You need to add https://sakirtemel.github.io/MMM-alexa/ to the allow return URL in your avs security settings of your device . And need to generate the first token by going in that first url and enter the requested information
    • faster than MMM-AlexaPi

    in both case I had to tweak some of my sound configurations files so my microphone is picked up and the output is my speaker.
    Because MMM-Alexa needed to be activated manually or by another module (and the fact it seem to provide less answer) I think MMM-AlexaPi is better. Even though AlexaPi seem a bit slower to answer. To trigger MMM-Alexa I used the voicecontrol module (it’s a module that convert voice into notification. I set up the word “Alexa” to send the right notification to mmm-alexa) but the voicecontrol module seem to have a loooooooooot of false positive. It was activated way to much even if I didn’t talk sometime.

    I didn’t successfully made mirrormirroronthewall worked though (I might try again later. I didn’t tryed since I made the other two works)
    I think mirrormirroronthewall is probably the best module of all three since is suppositivly allow you to do more than the other two that only allow you to ask question to alexa and get answers from it.

    as for the

    But it does not say how to develop this module :(

    You can either use an already existing moduel like “voicecontrol” to do that.

    or developping something yourself. to do that:
    You can for example take as a template the helloworld module in the ~/MagicMirror/modules/default as a template . copy/past it in the ~/MagicMirror/modules , rename the folder to something else. let’s say “toto” as an example, then rename the file inside it to match that name. helloworld.js should now be toto.js . now open the toto.js and replace all the hello words by toto.
    Then delete the text: "Hello World!" and the wrapper.innerHTML = this.config.text; since you don’t need to display anything.
    Now you can write this.sendNotification('ALEXA_START_RECORDING', {}); where was the wrapper.innerHTML = this.config.text;
    And that send the notification to start recording what you are saying to mmm-alexa. However that example will only work once.

    If you never code something before, I don’t recomand you to do the developping of a module like this yourself. It’s better to use an already existing module.

    /!\ if your sound configuration isn’t good, you might not be able to use voicecontrol and mmm-alexa in the same time.
    Explaining the sound configuration here would be pointless since you might not have those issue.

    posted in General Discussion
    romainR
    romain
    Apr 24, 2017, 7:36 AM
  • RE: Calendar no entries

    your link works for me (the http://www.ifeiertage.de/he-sk.ics one) it’s telling me Walpurgisnacht is in 5 days, Tag der Arbeit in 6 days etc etc…
    So you might have done something wrong in your config.js file like forgot a comma or some quotation marks around the url

    posted in Troubleshooting
    romainR
    romain
    Apr 25, 2017, 9:21 AM
  • RE: turning monitor on by incoming call?

    @timog What do you mean ? there are two different module. So they aren’t link for sure. That’s where the “notification” system come into play.
    I saw two type of notification in the maagic mirror modules.

    • The socket notification: It’s a way to “send” data (payload) to the node_helper.js of that module and for the node_helper to send back data as well. You cann’ot reach other modules with it. You can just tell your node helper to do some things for you (because node_helper is node js and not just js)
      it allow you to do things you can’t normally do. Such as open and read a file). you send a socket notification by using the function this.sendSocketNotification(notification, payload); where notification is a string, for example “TOTO” or “Hello, my name is slam shady”. And payload is any variable you want to transmit. it’s common tu use a dictionary with because it allow you to send multiple variable at once .
      A dictionary is a list of key associate with value separate with comma encapsulate in {};
      for example this.sendSocketNotification("LUNCH", {drink: water, dish: sandwich}); would be a valid synthax.
      This will send a notification lunch and the associate payload. It will be get by a function “socketNotificationReceived” that look like this:
    socketNotificationReceived: function(notification, payload) {
            if (notification === "LUNCH") {
                  Log.log("I going to drink" + payload.drink + " and I going to eat  a " + payload.dish);
            }
        },
    
    • the normal notification. That’s what you want, that allow you to send notification to OTHER module with an associate payload. sending notification work exactly like socket notification but you don’t write socket. so it would be more like this.sendNotification("LUNCH", {drink: water, dish: sandwich});
      and it isn’t get by socketNotificationReceived but by notification received
    notificationReceived: function(notification, payload, sender) {
            Log.log("I received a notification from " + sender + " !");
            if (notification === "LUNCH") {
                  Log.log("I going to drink" + payload.drink + " and I going to eat  a " + payload.dish);
            }
        },
    

    The difference is that the received function have an additional argument “sender” that is the name of the module you got the notification from.

    So, what you want to do is identify where in the code the call is detected. When you do, you want to use sendNotification to tell MMM-PIR-Sensor that a call is incomming. as an example: this.sendNotification("CALL INCOMMING", {}); and in the MMM-PIR-Sensor you want to catch that. if the MMM-PIR doesn’t have a notification received creat one.

    notificationReceived: function(notification, payload, sender) {
            if (notification === "CALL INCOMMING") /*you can also add a condition to check if the sender is MMM-FRITZ-Box-CallMonitor if you want to be sure that if another module send you a similar notif yu won't react*/{
                  // call the function you want
            }
        },
    

    if it already have a notificationReceived function just add the if inside.

    That’s where you detective work continue. You need find what’s happen when the captor detect you. What does he do ? you need to call the same function it call. If the function is in the node_helper, you will need to send a socket notification and to the node helper (again, you can choose whatever name for the notification). And add an if in the socketNotificationReceived of the node_helper or add one if none exist.
    then you can call the same function the detection does.
    That’s involved a little trial and error. You could try to send a socketNotification to the node_helper, catch it and send back a socketNotification USER_PRESENCE from the node_helper to the main js like so self.sendSocketNotification("USER_PRESENCE", true);. Maybe that’s all there is to it.
    Or maybe you just need to send a socketNotification SCREEN_WAKEUP from the main js to the node_helper. like so this.sendSocketNotification("SCREEN_WAKEUP", {});

    Bref, maybe the screen_wakeup if enough, maybe you really need to fake human presence but sending the user_presence, maybe there is another function to call. Try a bunch of stuff.
    Remember, the idea is to send a global notification that a call is there with sendNotification. catch it in pyr sensor with socketNotificationReceived. Then call the right function. If the function is already in the MMM-PIR-Sensor.js then just call it. and if it is in the node_helper send a socketNotification.
    My best bet is that you need to either send directly the SCREEN_WAKEUP socketNotification from MMM-PIR-Sensor.js to node.helper.js or send a random notification that you choosed from the MMM-PIR-Sensor.js to node.helper.js and then send back a USER_PRESENCE notification with the payload true.

    Hopefully it was clear enough. I know it’s hard to understand that kind of stuff when you never did it before (Even though I had experience in coding in other languages, I did not had the experience in js / node js / magicmirror so I struggle at first myself)

    posted in Requests
    romainR
    romain
    Apr 26, 2017, 8:04 AM
  • RE: 3 different Alexa modules, which one is the best?

    @johnnyboy Yes, But it’s not your fault. I have read an entire very long thread about mirror mirror on the wall (and maybe some others, I don’t remember if all the information were on the same spot or not) and it seem that one guy talked about trying that (changing the region) and the creator of the module himself didn’t knew Ireland was possible. But he did point out in which file the region thing was. (it wasn’t had to find though).
    So I do think he meant that “that one ‘must’ be in the us-east” because he didn’t knew there was another option.
    And he didn’t changed his tutorial to reflect that. (I’m guessing because he wasn’t able to test this way itself. Or maybe he wasn’t willing to)

    posted in General Discussion
    romainR
    romain
    Apr 26, 2017, 9:30 AM
  • RE: Left to Right Modules, instead of top to bottom?

    I’m not entirerly sure about that but if you check the index.html within the mirror you can see

    https://pastebin.com/CJFZ3pub

    then in the main.css of the css folder we can see

    .region {
      position: absolute;
    }
    
    .region.fullscreen {
      position: absolute;
      top: -60px;
      left: -60px;
      right: -60px;
      bottom: -60px;
      pointer-events: none;
    }
    
    .region.fullscreen * {
      pointer-events: auto;
    }
    
    .region.right {
      right: 0;
    }
    
    .region.top {
      top: 0;
    }
    
    .region.top .container {
      margin-bottom: 25px;
    }
    
    .region.top .container:empty {
      margin-bottom: 0;
    }
    
    .region.top.center,                                                                                                                                                                                                                          
    .region.bottom.center {
      left: 50%;
      -moz-transform: translateX(-50%);
      -o-transform: translateX(-50%);
      -webkit-transform: translateX(-50%);
      -ms-transform: translateX(-50%);
      transform: translateX(-50%);
    }
    
    .region.top.right,                                                                                                                                                                                                                           
    .region.top.left,                                                                                                                                                                                                                            
    .region.top.center {
      top: 100%;
    }
    
    .region.bottom {
      bottom: 0;
    }
    
    .region.bottom .container {
      margin-top: 25px;
    }
    
    .region.bottom .container:empty {
      margin-top: 0;
    }
    
    .region.bottom.right,
    .region.bottom.center,
    .region.bottom.left {
      bottom: 100%;
    }
    
    .region.bar {
      width: 100%;
      text-align: center;
    }
    
    .region.third,                                                                                                                                                                                                                               
    .region.middle.center {
      width: 100%;
      text-align: center;
      -moz-transform: translateY(-50%);
      -o-transform: translateY(-50%);
      -webkit-transform: translateY(-50%);
      -ms-transform: translateY(-50%);
      transform: translateY(-50%);
    }
    
    .region.upper.third {
      top: 33%;
    }
    
    .region.middle.center {
      top: 50%;
    }
    
    .region.lower.third {
      top: 66%;
    }
    
    .region.left {
      text-align: left;
    }
    
    .region.right {
      text-align: right;
    }
    
    .region table {
      width: 100%;
      border-spacing: 0;
      border-collapse: separate;
    }
    
    

    First you can see that the module side to side (top left, top center, top right and the bottom counter part) are not at the same level that other places they are inside the container of the top bar.
    Also when you watch the css you see that all class except for those have width: 100% .

    You can see that for the class left and right, they do a text-align: left and a text-align: right and for the class center they do a left: 50% and all sort of translation.

    So I am guessing that if you wanted to replicate that behaviour for the upper third, middle center and lower third, you could add new region under their container and make sure to choose a class name including left, center and right respectively.
    class=“region left” as an example so it apply the . It might be enough (you can see that the class “upper third” have a top:33% but the class third itself have a width:100% so you don’t want to include third in the class name yet you want the top:30% so maybe creat a new class that do the top:33% . let’s call it custom_upper_third as an example:

    .region.custom_upper_third {
      top: 33%;
    }
    

    so your html could look like

    https://pastebin.com/mdzSipzH

    Then you do the same for the other sides.

    Keep in mind that I didn’t test this and that I’m quite new in html / css / javascript so I might be wrong about this

    posted in Custom CSS
    romainR
    romain
    May 10, 2017, 7:29 AM
  • RE: Cant figure out how to install a module in the config.js

    in the config file you should have a modules: [ line. In fact, there should be almost at the end of the file an ]
    This mean modules is an array. ([ value1, value2, etc... ] is an array.
    Every value of the array is a dictionnary (a list of keys associates with a value) . it should look like this

    {
               key: value,
               next_key: value,
               etc..
    }
    

    Two key/value pair should be separated by a , and two dictionary should be separated by a ,
    as an example

    {
               key: value,
               next_key: value,
               etc..
    },
    {
               key: value,
               next_key: value,
               etc..
    }
    

    the , is very important because without it, it does’nt understand it changed value and you end up with an error because it doesn’t understand why you put a { or a : in the middle of an unfinished value

    What you should know is this : a [ is always closed by a ], if you having one without the other few characters later somethings is wrong. a { is always closed by a }, if you having one without the other few characters later somethings is wrong.
    two element in the same array should be separeted by ,. same thing with two element in a dictionnary.
    If you have a config issue it probably mean you forgot one of the following , { } [ ] : somewhere.
    Since you probably just copy past the config in the readme, my best bet is that you either forgot the first { or the last }, . Or maybe the configuration didn’t put a , at all at the end in their example because it suppose you add it at the end of the array. In that case
    The last element of the array might not have a , because it’s the last element. So if you add an alement after it, you have tu put it yourself.

    Hopefully that was clear enough

    posted in Troubleshooting
    romainR
    romain
    Apr 24, 2017, 12:52 PM

Latest posts made by romain

  • RE: Synchronus socketNotification ?

    Right, I think this is the only way too. It’s kind of annoying though because the value can change so I would need to send it to send node helper every single time it change to keep it up to date.
    Oh well.

    posted in Troubleshooting
    romainR
    romain
    Jun 28, 2017, 9:04 AM
  • RE: Synchronus socketNotification ?

    @shbatm I could but then It would be asynchronus. I can"t have a function doing stuff, get the variable I want, continue to do stuff.
    I would have to do stuff, send a socket notification to request the variable, receive the notificataion, send back the variable with another notification then get the notification and only then I would be able to continue what I was doing. This is a very slow process just to get a variable value. Also I would have to store a lot of variable so I can use them in two different function.

    What I want is similair to a function call you know ? doing stuff in the row. I don’t want to do stuff in two different fonction asynchronusly.
    It can be usefull to do it like this in some cases don’t get me wrong, but’s it’s create somes issue as well in some other cases

    posted in Troubleshooting
    romainR
    romain
    Jun 21, 2017, 1:09 PM
  • Synchronus socketNotification ?

    Is there a way to have a synchronus socket notification or something similar ?
    Let me explain, I have a module, that module have a node helper. I can send thing directly to the node_helper with a third party software. And I do it by making a GET. As an example, One of the get is about retreving a variable in previously set in config map. But to get that I have to send a socket notification and wait until I have the answer. But this is asynchronus so it doesn’t wait so I can’t send the answer back.
    I though about sending the config to the node_helper in the start function but it’s kind of a pain because I would have to update it every so often if the value change.

    So is there a way to do some sort of synchronus request from the node_helper to the associate js file ?

    posted in Troubleshooting
    romainR
    romain
    Jun 20, 2017, 3:13 PM
  • RE: Html into Iframe

    Scratch that, the first example is working. It’s just that, because of the body black background, the text inside the iframe wasn’t visible. Justed needed to to change the css for the iframe to overide the background of the body

    posted in Troubleshooting
    romainR
    romain
    Jun 13, 2017, 10:14 AM
  • Html into Iframe

    Hello, I try to put my own html code into an iframe but it doesn’t work. How shoudl I that ?
    I tryed :

    getDom: function() {
      var wrapper = document.createElement("div");
      var iframe = document.createElement("iframe")
    
      iframe.src = this.file("biblop.html")
    
      wrapper.appendChild(iframe)
      return wrapper
    }
    

    No error, (I can see the border of the iframe) yet nothing happen in it

    I tryed to “write” the html into the iframe as well, thinking that I could use the node helper to read my html file to get the content eventually.

    getDom: function() {
      var wrapper = document.createElement("div");
      var iframe = document.createElement("iframe")
    
      var myContent = ''
         + 'My dynamic document' 
         + '<p>Hello world</p>';
    
      iframe.contentWindow.document.open('text/htmlreplace'); 
      iframe.contentWindow.document.write(myContent);
      iframe.contentWindow.document.close();
     
      wrapper.appendChild(iframe)
      return wrapper
    }
    

    But content.Window is null every time so it can’t be open.
    I tryed to tweak those two solution in different ways (like using absolute path) but the end result was the same.
    How can I do that ?

    (PS: I tryed the first code I wrote above outside of the magic mirror first on my ubuntu and it was working just fine. Soemhow it’s the magic mirror itself that don’t like it)

    posted in Troubleshooting
    romainR
    romain
    Jun 13, 2017, 9:19 AM
  • RE: MMM-AlexaPi

    @bminer1 That’s normal, there is multiple type of user in linux with different level of permission, it’s for safety (that you or a virus doesn’t destroy your operating system). When you are connected to your regular user (pi if you are using raspbian) you have only access in writing to your home folder. However, the pi user is also a “sudo” user, which mean that you can get higher permission in exchange of providing the right password (which is your regular password in raspbian).
    To do that you write sudo your_command , for example sudo nano /etc/opt/AlexaPi/config.yaml . you’ll be ask to enter a password and then you can edit your file.
    It’s like being administrator on windows, but with a password instead of a window that ask you if you want to run as administrator

    posted in Troubleshooting
    romainR
    romain
    Jun 7, 2017, 7:40 AM
  • Same notif received multiple time

    I sometime receive the same notification multiple time, like if the mirror run my module twice or something. It’s not happening every time.
    As an example, I have a module that send a socket notification in the start function to the node helper to initialise something. let’s call it Notif_A.
    l catch it the notification, make sure it’s Notif_A with an if statement, and When the node helper did it’s job it send back the data he got. still with a send socket notification Let’s call it Notif_B.
    The odd thing is that I sometime got into the if that check if it received Notif_B twice in a row. Like if I got the notif twice.
    The thing is, I only send Notif_A in the start function And I only send Notif_B if I received Notif_A.

    I also noticed that the getDom function on some modules are callde 2 or 3 time in the raw at the begining (I checked with console.log)

    So… what’s happening here ? Why is the notification is catched twice ? Is the start function runned twice for some reason ?

    posted in Troubleshooting
    romainR
    romain
    Jun 6, 2017, 1:36 PM
  • RE: MM does not boot when starting my raspberry

    @RE_Magic_Mirror Nice pun ;)

    posted in Troubleshooting
    romainR
    romain
    May 17, 2017, 1:47 PM
  • RE: MM does not boot when starting my raspberry

    @RE_Magic_Mirror Not that I know of but I am not an expert in linux configuration.

    But if your issue is about “seeing” the desktop, I might have some tricks for you.
    Maybe you could change you desktop wallpaper to be a black screen for started and take away the trash icon so the desktop part is black and empty.
    Then you could right click on the panel barr above your screen and enter the panel settings and play around with them to make the barre itself invisible and then take away the unnecessary icons on it.
    It will not make your mirror start quicker but you won’t see the default wallpaper and menu as much

    posted in Troubleshooting
    romainR
    romain
    May 17, 2017, 7:30 AM
  • RE: MM does not boot when starting my raspberry

    @opensky727 did you put the sudo at the begining of the command ?
    It should loook like this
    sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi

    You should have the permission as sudo

    posted in Troubleshooting
    romainR
    romain
    May 14, 2017, 5:22 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