A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Subcategories

  • Any suggestions or wishes for the forum?

    105 Topics
    727 Posts
    J
    @sdetweil Thanks, I made the changes ad it works perfectly. Thank you for your prompt response.
  • HTTP Server for streaming podcasts / news / volume

    1
    1
    0 Votes
    1 Posts
    697 Views
    Y
    Dear fellow Mirror Designers, I wasn’t sure where to put this so I will post it here. From various sources I created a small python httpserver that changes the mirrors volume, starts a podcast (100 Seconds german news, when brushing your teeth:grimacing_face: ) or opens a live stream. This is the code, nothing special but may be helpful for some of you. I use FHEM and Philips Hue Dimmer Switches to control it: [image: 1540136724308-img_20181021_174249.jpg] Uses: python3, livestreamer, omxplayer #!/usr/bin/python3 -u host_name = '10.0.1.49' # Change this to your Raspberry Pi IP address host_port = 8000 proc = '' import RPi.GPIO as GPIO from pathlib import Path import os import subprocess import signal from subprocess import call from time import sleep from http.server import BaseHTTPRequestHandler, HTTPServer class MyServer(BaseHTTPRequestHandler): def do_HEAD(self): self.send_response(200) self.send_header('Content-type', 'text/html') self.end_headers() def do_GET(self): global proc html = ''' <html> <body style="width:960px; margin: 20px auto;"> <h1>Magic Mirror Control</h1> <p>Current GPU temperature is {}</p> <p>Podcast: <a href="/play">Play</a> <a href="/stop">Stop</a></p> <p>ARD Livestream: <a href="/ard">Play</a> <a href="/stop">Stop</a></p> <p>Volume: <a href="/down">down</a> <a href="/up">up</a></p> <p>System: <a href="/shutdown">Shutdown</a> <a href="/restart">Restart</a></p> <div id="podcast-status"></div> <script> document.getElementById("podcast-status").innerHTML="{}"; </script> </body> </html> ''' temp = os.popen("/opt/vc/bin/vcgencmd measure_temp").read() self.do_HEAD() status = '' if self.path=='/': #GPIO.setmode(GPIO.BCM) #GPIO.setwarnings(False) #GPIO.setup(17, GPIO.IN) status='nothing' elif self.path=='/play': if proc=='': my_file = Path("/home/pi/MagicMirror/video.mp4") if my_file.is_file(): statinfo = os.stat('/home/pi/MagicMirror/video.mp4') if statinfo.st_size > 0: proc = subprocess.Popen(["omxplayer", "-o", "alsa:hw:ALSA", "--no-osd", "/home/pi/MagicMirror/video.mp4"], preexec_fn=os.setsid) status='Playing Podcast' else: proc = subprocess.Popen(["omxplayer", "-o", "alsa:hw:ALSA", "--no-osd", "/home/pi/MagicMirror/Loading.mp4"], preexec_fn=os.setsid) status='Not yet available' else: proc = subprocess.Popen(["omxplayer", "-o", "alsa:hw:ALSA", "--no-osd", "/home/pi/MagicMirror/Loading.mp4"], preexec_fn=os.setsid) status='Not yet available' else: status='Stopping Podcast' os.killpg(os.getpgid(proc.pid), signal.SIGTERM) proc='' elif self.path=='/ard': if proc=='': proc = subprocess.Popen(["livestreamer", "hlsvariant://daserste_live-lh.akamaihd.net/i/daserste_de@91204/master.m3u8", "best", "-vnp", "omxplayer -o alsa:hw:ALSA --no-osd --timeout 20"], preexec_fn=os.setsid) status='Playing ARD Livestream' else: status='Stopping Stream' os.killpg(os.getpgid(proc.pid), signal.SIGTERM) proc='' elif self.path=='/stop': if proc!='': status='Stopping Podcast' os.killpg(os.getpgid(proc.pid), signal.SIGTERM) proc='' else: status='Nothing to stop' elif self.path=='/shutdown': status='Shutdown' subprocess.Popen(["sudo", "shutdown", "-h", "now"], preexec_fn=os.setsid) elif self.path=='/restart': status='Restart' subprocess.Popen(["sudo", "reboot"], preexec_fn=os.setsid) elif self.path=='/down': status='Volume down' subprocess.Popen(["amixer", "set", "Master", "12%-"], preexec_fn=os.setsid) elif self.path=='/up': status='Volume up' subprocess.Popen(["amixer", "set", "Master", "12%+"], preexec_fn=os.setsid) self.wfile.write(html.format(temp[5:], status).encode("utf-8")) if __name__ == '__main__': http_server = HTTPServer((host_name, host_port), MyServer) print("Server Starts - %s:%s" % (host_name, host_port)) try: http_server.serve_forever() except KeyboardInterrupt: http_server.server_close()
  • beginner questions

    1
    0 Votes
    1 Posts
    701 Views
    M
    hi all, i’m new to magicmirror and pi in general,apologies if this has been answered,i searched but didn’t find the answer. i’ve been playing around with the magicmirror for the past day or 2 and i like what i see but i’m wondering if it can do what i want to achieve… what i’m trying to achieve is a touchscreen mounted in my kitchen with all the usual stuff such as calender,weather,news ticker etc. i want a web browser for looking up recipes etc and be able to add notes and entries into the calendar but i don’t want a physical keyboard but one that pops up onscreen the way it does on phones and tablets. is this possible at the moment? cheers
  • New modules - how to find them

    Unsolved
    2
    0 Votes
    2 Posts
    939 Views
    justjim1220J
    @hoddog I don’t think so, BUT, I really like the idea!!!
  • I know it's here but I cannot seem to find it.....

    7
    0 Votes
    7 Posts
    3k Views
    cowboysdudeC
    @broberg I will look into that also…that’ll be a weekend thing :) Thank you!!!
  • The "best" voice control module

    Moved
    2
    0 Votes
    2 Posts
    1k Views
    W
    Someone ?
  • Thermostat...

    23
    0 Votes
    23 Posts
    16k Views
    K
    @cowboysdude said in Thermostat...: Just curious as to which way people are leaning towards a Thermostat that has it’s own api. I’ve looked at several … I like the Honeywell thermostats but I know there are others… What are you using or thinking of using and does it have an api? I use Ecobee it is very good thermostats. I guess you need to read the review on them. They helped me a lot when choosing. Ecobee Good luck
  • MagicMirror Image von Heise

    5
    1 Votes
    5 Posts
    3k Views
    M
    @lavolp3 Die LED’s blinken beide rot bzw. zumindest die rote blinkt… erst dreimal und dann viermal. Ich teile aber deine Vermutung, dass das Image nicht für den 3B+ geeignet ist… schade, dann muss ich schauen wie ich die gewünschten Module hinzufüge. Danke für deinen Post
  • Larger format calendar module?

    2
    0 Votes
    2 Posts
    1k Views
    ?
    @urdazed1 [card:eouia/MMM-CalendarExt]
  • hi there...hi everyone

    1
    0 Votes
    1 Posts
    569 Views
    V
    I’m a new user, so that you don’t have a friend. You may you can be with you? I want to learn more more more more. Thank you. #vin
  • TeleFrame - A opensource digital picture frame for Telegram

    1
    3 Votes
    1 Posts
    1k Views
    LukeCodewalkerL
    [card:LukeSkywalker92/TeleFrame] Dear MagicMirror-Community, I solved a problem and want to share it with you, because I think some of you may have the same or a similar problem and most of you have the skills to get this thing working :) Even if you don’t have this problem it may be interesting for you also. To the problem: My grandmother (over 80 years old) is not able to use a smartphone but she would really like to get all the images that are send to our family-whatsapp-group. Since the other members of this group are also no IT-experts I had to find a solution, that is also easy to use for them. The solution: I wrote an nodejs app that can run on a raspberry pi (with an attached display) and displays all the images that are send to a telegram-group (or to the bot directly) in a slideshow. So similar to a digital picture frame. But it can also show the name of the sender and the caption of the image (with emojis ;) ). When a new picture is send to the group (or bot), a notification with the sender name is shown and the slideshow will start from the biginning. The oldest image is kicked out of the slideshow to keep the total amount of images in a range that you don’t have to spend all the day in front of the picture frame to see the newest images. But you can set the amount in a config file. There are many other settings that can be adjusted in the config file, but you can see that in README on Github. You can also see a small demo and the instructions to install this app on Github. I hope this helps many others that are facing the same problem or that just want to have a digital picture frame like this :) Enjoy it! Luke
  • Buying two-way mirror in Israel

    1
    0 Votes
    1 Posts
    567 Views
    Z
    Hi all, I can’t find a two-way mirror manufacturer or even a store that sells these mirrors in Israel. Do you know where can I find one? Thanks, Zingero.
  • 0 Votes
    3 Posts
    2k Views
    A
    @maxbachmann thanks…man…i really appreciate it… for creating those…i dont know how …i have read the module development but i dont understand it…can you teach me?
  • Vacation.....

    6
    3 Votes
    6 Posts
    3k Views
    N
    @cowboysdude o How to show animated background in an array (What module)
  • Newbie here!!

    2
    0 Votes
    2 Posts
    712 Views
    Mykle1M
    @cjruff78 Assuming your mean MagicMirror you should probably go with this forums installation tutorial. https://forum.magicmirror.builders/topic/236/complete-setup-tutorial
  • Profile Selection between recognise and unrecognise

    1
    0 Votes
    1 Posts
    514 Views
    J
    Hi everyone, I’m looking for help, What I’m trying to do to is to recognise a person in front of a camera, If the person recognises the custom-made dashboard come on display, I have done the recognising a person part but not able to switch to the custom-made dashboard
  • Echo dot and magicmirror

    13
    0 Votes
    13 Posts
    8k Views
    C
    Thanks. i ve seen with alexa developper application but i am not strong with python and json script to arrange at my sauce :). (just a code with gpio). What is it FHEM ?
  • Re-purpose a RPI from Kodi to MM

    3
    0 Votes
    3 Posts
    1k Views
    T
    I ended up just doing an Update and removing Kodi, everything seems to be working fine otherwise. Thx
  • MagicMirror and RetroPie

    2
    0 Votes
    2 Posts
    1k Views
    R
    @ramez I’ve made a script that runs MM from RetroPie but when try to run it didn’t start here is the npm log file… 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ] 2 info using npm@5.6.0 3 info using node@v9.11.2 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle magicmirror@2.4.1~prestart: magicmirror@2.4.1 6 info lifecycle magicmirror@2.4.1~start: magicmirror@2.4.1 7 verbose lifecycle magicmirror@2.4.1~start: unsafe-perm in lifecycle true 8 verbose lifecycle magicmirror@2.4.1~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/MagicMirror/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games 9 verbose lifecycle magicmirror@2.4.1~start: CWD: /home/pi/MagicMirror 10 silly lifecycle magicmirror@2.4.1~start: Args: [ '-c', 'sh run-start.sh' ] 11 silly lifecycle magicmirror@2.4.1~start: Returned: code: 1 signal: null 12 info lifecycle magicmirror@2.4.1~start: Failed to exec start script 13 verbose stack Error: magicmirror@2.4.1 start: `sh run-start.sh` 13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16) 13 verbose stack at EventEmitter.emit (events.js:180:13) 13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:180:13) 13 verbose stack at maybeClose (internal/child_process.js:936:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) 14 verbose pkgid magicmirror@2.4.1 15 verbose cwd /home/pi/MagicMirror 16 verbose Linux 4.14.62-v7+ 17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" 18 verbose node v9.11.2 19 verbose npm v5.6.0 20 error code ELIFECYCLE 21 error errno 1 22 error magicmirror@2.4.1 start: `sh run-start.sh` 22 error Exit status 1 23 error Failed at the magicmirror@2.4.1 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ] any help please?
  • Touch foil question

    9
    0 Votes
    9 Posts
    5k Views
    M
    @trich1 yes side of the frame works. just needs to be possible to move the finger into the Infrared light grid it creates ;) However when you really want a photobooth with basically only the feature make a photo a small gesture sensor or a distance sensor (depending on how you want to trigger) would be a lot cheaper since touch foils are damn expensive in that size (never used one with a mirror but some producers state that some touch foils work with their mirror). And even a IR Frame will probably cost at least around 100$ I guess. Although I am no big fan of the touch + mirror combo anyways because you have fingerprints all over the mirror ^^ which you do not have with gesture control (maybe voice control would be cool aswell :) ) Well but back to your question I never used a IR Frame so far but in general mapping should be quite possible. But you need to check what options are out there for your distro. It appears to be pretty common that you need to map for example with multiple monitors since linux often sees them as one so mapping needs to be done here aswell. Just search for touchscreen calibration and you should find explanations
  • Newb User with multiple Questions

    5
    0 Votes
    5 Posts
    2k Views
    T
    Ok, got it. Thank you. Edit: I was just looking at the Sonos website and thei latest speaker (Sonos One) has Alexa built into it. Now I think that’s a better solution and I would want to see if i can retireve the current song ad metadata through the Sonos.