You are welcome. Glad you made it work and happy to see someone can make use of the module!
Read the statement by Michael Teeuw here.
Posts
-
RE: MMM-KeyBindings: Control your mirror with Amazon Fire Stick Remote and Generic Keyboard Inputs
-
RE: MMM-pages & MMM-pages-indicator - Lightweight module pages on your mirror!
Very nice module!
I actually worked on something similar with a fork of MMM-Carousel with clickable indicators and arrow buttons here: https://github.com/shbatm/MMM-Carousel
After working on a few modules for navigation I can totally understand walking the fine line between features and bloat. Feel free to take a look and borrow anything you want… I’m also open to any suggestions for improvement.
-
RE: MMM-KeyBindings: Control your mirror with Amazon Fire Stick Remote and Generic Keyboard Inputs
@AgilesChroms - I’m out of town for business, so bear with me since I’m unable to fully test these suggestions.
To use custom keyboard keys AND the remote, you can also modify the
evdevKeymap
andhandleKeys
in the MMM-KeyBindings Config. The module tries to “map” the remote’s key names to more standard keyboard key names and this can be tweaked. For example in the MMM-KeyBindings Config:... evdevKeymap: { Home: "KEY_HOMEPAGE", Enter: "KEY_KPENTER", j: "KEY_LEFT", // Change default "ArrowLeft" to "j" k: "KEY_RIGHT", // Change default "ArrowRight" to "k" ArrowUp: "KEY_UP", ArrowDown: "KEY_DOWN", Menu: "KEY_MENU", MediaPlayPause: "KEY_PLAYPAUSE", MediaNextTrack: "KEY_FASTFORWARD", MediaPreviousTrack: "KEY_REWIND", Return: "KEY_BACK" }, handleKeys: ['j','k'] // Add the new keys to the keyboard bindings
In MMM-Carousel, you can now use:
keyBindings: { NextSlide: "k", PrevSlide: "j", Slide0: "Return", ... }
Side note:
Something you may also find useful: the evdevKeymap tries to standardize keys, but if it receives a key that isn’t in the map, it will still pass it along. I use this to also control my Mirror via my home automation system using GET requests.
For example: if you add a keybinding to MMM-Carousel likeSlide1: "SomeSlideTitle"
, you can jump to that slide with a GET request to the following URL:http://mirror_ip:8080/MMM-KeyBindings/notify?notification=KEYPRESS&payload=%7B%22KeyState%22%3A%20%22KEY_PRESSED%22%2C%20%22Duration%22%3A%200.0%2C%20%22KeyName%22%3A%20%22SomeSlideTitle%22%7D // payload parameter is a url-encoded JSON string: {"KeyState": "KEY_PRESSED", "Duration": 0.0, "KeyName": "SomeSlideTitle"}
-
RE: MMM-KeyBindings: Control your mirror with Amazon Fire Stick Remote and Generic Keyboard Inputs
@AgilesChroms By default, the Carousel module will only respond to remote control keys on the “server’s” screen. This was done so you could pull up the MM in a browser on another computer and navigate separately with a keyboard/mouse. It’s in the plan down the road for multiple remotes on different screens running from one server, but I haven’t made it that far yet.
EDIT: I’m assuming that when you say browser, you’re talking about a browser on a different computer and not just another window on the server/RPi running MM. The suggestions below are based on that assumption.
For now:
First 2 corrections in your config:
- Remove
handleKeys: true,
from MMM-KeyBindings, this is for adding extra keyboard keys to bind to. - Add
"MMM-KeyBindings"
to theignoreModules
list in MMM-Carousel (probably doesn’t do anything at the moment, but just future proofing).
Next, 2 options for a fix:
- If you want to control the browser’s slides separately (i.e. from a keyboard attached to that computer):
- In MMM-KeyBindings config section, add:
enableMousetrap: true,
which will turn on regular keyboard binding in the browser window. - Keyboard key presses only work when the browser is active and focused – usually have to click in the window and make sure it’s active before it will respond. I also had issues with some media keys not being sent to to browser at all-which is why I went with the evdev path in the first place.
- Optional (and untested, but should work): If you want to use additional keyboard keys other than the standard keys, then in MMM-Carousel config section: add a duplicate entry in the
keyBindings
section:
You’ll also need to add any new “non-default” keys to MMM-KeyBindings:keyBindings: { NextSlide: "ArrowRight", // Remote Key Name NextSlide: "r", // Keyboard Key Name PrevSlide: "ArrowLeft", // Remote Key Name PrevSlide: "l" // Keyboard Key Name },
handleKeys: [ 'r', 'l' ],
- In MMM-KeyBindings config section, add:
- If you want the remote to control ALL screens: Remove the following from Line 71 in
modules/MMM-Carousel/MMM-Carousel.js
&& payload.Sender === this.instance
- This is a temporary test for now. In the future I will add a config option for the remote to control all instances or just the main screen. At the moment there is no good way to synchronize the screens when just using the Previous/Next navigation (e.g. if your main screen is on Slide 2 and you open a browser to Slide 0 and press next, both will move but one will be on Slide 3 and the other Slide 1).
Please let me know if this helps / works – still new to MM2 and just starting development of these modules so any feedback or feature requests are more than welcome! I’m glad someone else is able to make use of the modules.
- Remove
-
RE: MMM-KeyBindings: Control your mirror with Amazon Fire Stick Remote and Generic Keyboard Inputs
@AgilesChroms First thing I would check: What browser are you using to view the mirror? If using Chrome/Chromium on the browser (or any others with DevTools), please check the console and see if there are any errors (
Ctrl+Shift+I
). Also, which modules are you using besides KeyBindings? Could you post or message me a snippet of your config file?I am using this module with my fork of MMM-Carousel on both the monitor connected to the Pi and a separate browser without issue.
-
RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras
Unfortunately, at the moment I don’t have an answer for how to decrease the lag time, but I’m still trying to find better ways to process the feed to the front end. My delay is only 3-4 seconds and has a lot to do with the hardware you’re using to process the stream.
-
RE: Stream RTSP Security CAM Feed
Check out my new module here:
[card:shbatm/MMM-RTSPStream] -
RE: 27" custom framed magic mirror - fun to get done
@disakos I just posted a module for pulling an RTSP Stream from my Hikvision Cameras. Check it out here:
[card:shbatm/MMM-RTSPStream] -
[MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras
Description
This module will show a live RTSP video stream and/or periodic snapshots on the Magic Mirror from any IP Security Camera which supports the RTSP protocol and/or can serve a snapshot periodically.
Features:
- Supports single or multiple camera streams/snapshots
- For multiple streams: supports rotating through streams in a single window or displaying multiple windows (with customizeable layout)
- Supports fetching snapshots from a file or url when not actively streaming
- Flexible configurations to limit resource use on Raspberry Pi –
- Stops all streams when module is hidden
- Option for AutoPlay or manual starting of stream
- Plays one or all streams (when displaying multiple)
ffmpeg
process only started when active stream window is shown and customizeable delay for shutdown after stopping.- Note: 3 simultaneous streams on a RaspberryPi 3 is about the limit for usability.
- Support for MMM-KeyBindings module for Play/Pause Remote Control and navigation of multiple streams
Screenshot:
Download:
[card:shbatm/MMM-RTSPStream]
Version 1.2.1 (Updated 15 Oct 2017)
- Now uses hardware-accelerated OMXPlayer as default player for local video
- Resolved latency issues
- Uses PM2 to control stream playback – automatically restarts streams when they close
- Fullscreen, custom window and offset options now available.
- Important - please update your configurations after updating this module. A new configuration tool is available, see the README on GitHub for info.
Version 1.0.0
- Initial Release – Please submit bugs and issues via GitHub Issues
-
RE: Change Modules name
On the Raspberry Pi, a shortcut to renaming all of the instances of ‘MMM-This’ inside the files is to use the following command. Don’t forget to navigate to the new module’s directory!
find . -type f | xargs sed -i 's/MMM-This/MMM-That/g'
You still need to rename the actual files.