MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    IR control of presentations?

    Scheduled Pinned Locked Moved General Discussion
    11 Posts 4 Posters 2.6k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      DrFalken
      last edited by

      Hey everyone - i’m looking to run https://revealjs.com/demo/ on MM, in a web browser module. I have a basic MM setup but otherwise a newbie :)

      The idea would be to able to able navigate through the slides with an IR remote (either mimicking keystrokes, or issuing api calls to the revealjs server.

      Does this seem realistic to do? Any pointers on implementation would be very helpful!

      S kayakbabeK 2 Replies Last reply Reply Quote 0
      • S Offline
        sdetweil @DrFalken
        last edited by sdetweil

        @DrFalken don’t know why you would want to use a web browser to open a web browser to do this… but

        if you put the demo in an iframe, it would be isolated from MM in terms of operation…

        and you can send events to that iframe from an MM module
        see
        https://stackoverflow.com/questions/28672152/pass-an-event-to-an-iframe-from-the-parent-window-javascript

        if you google search, ‘raspberry pi ir remote control gpio python tutorial’, there are a number of exmaples of using an IR report on a pi…

        collect the events in python, and pass to a module node_helper.js
        which can forward the events up to your controller module (that injected the iframe and forwards the events)
        my python print module, https://github.com/sdetweil/MMM-PythonPrint
        shows how to launch the python script and collect its output and forward up to module…

        so you need some IR receiver hardware, the python IR receiver code (library) , and what keys/gestures you want to pass on,
        and the module side that injects the iframe, with url … etc…

        nothing exists today…

        doc on building modules here
        https://docs.magicmirror.builders/development/introduction.html
        my SampleModule, which implemnnts the spec
        https://github.com/sdetweil/SampleModule
        the PythonPrint module is built from the sample…

        you should be able to get the iframe up and running in less than an hour using the sample… all yo u have to do is generate the right html iframe tag content in getDom() sample… (or maybe print is better)

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        D 1 Reply Last reply Reply Quote 0
        • D Offline
          DrFalken @sdetweil
          last edited by

          @sdetweil Thanks! Awesome writeup.

          Why would it be a browser to open a web browser? I meant to use the browser module to open a revealjs URL (which would represent a desired slideshow), or would that not be possible? Maybe I’m missing something.

          S 2 Replies Last reply Reply Quote 0
          • S Offline
            sdetweil @DrFalken
            last edited by

            @DrFalken MagicMirror is an app inside a browser to present its stuff…

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @DrFalken
              last edited by sdetweil

              @DrFalken in MM a module creates a small section of html content

              div ->iframe <end-div

              and then gives that to MM which places it inside the div matching the position declared for the modules content… (see index.html for the raw mm html page layout)

              so, you create the div, create iframe, add the url to the iframe, add the iframe to the div and return the div to MM (return from getDom() function.). and mm does the placement, and browser does all the rest of the work…

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              D 1 Reply Last reply Reply Quote 0
              • D Offline
                DrFalken @sdetweil
                last edited by sdetweil

                @sdetweil ah I get it. So what’s the point of browser modules? Just to provide a UI to navigate?

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @DrFalken
                  last edited by sdetweil

                  @DrFalken mm is a composite ( built from parts) information display. the ‘modules’ each from different author, control their content and update frequency, without knowledge of any other module.

                  because the parts are independent, anyone can construct the information display any way they want

                  technically mm is an output only medium, which has tiny bits of input nowadays… button push, limited voice, and some externally submitted events.

                  no general keyboard or mouse. no office type desktop.

                  due to some creative invention, mm has the ability to fake multiple pages, and allow externally invoked page change

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  D 1 Reply Last reply Reply Quote 0
                  • D Offline
                    DrFalken @sdetweil
                    last edited by

                    @sdetweil Thank you!

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      Thierry7100
                      last edited by

                      Hi,

                      If you are looking for an IR remote module, I wrote one some months ago to control a radio player embedded in the mirror. This module send notifications to other modules (or actions to show, hide or toggle modules).
                      This module work with lirc (the Linux infrared control) and has been tested on a RPi (4).

                      The module is available at https://github.com/thierry7100/MMM-Infrared-Remote

                      Hope this can help you.

                      D 1 Reply Last reply Reply Quote 1
                      • D Offline
                        DrFalken @Thierry7100
                        last edited by

                        @Thierry7100 Awesome, thank you! Will give it a shot.

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • First post
                          Last post
                        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