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

acabrera2012

@acabrera2012

0
Reputation
484
Profile views
7
Posts
0
Followers
0
Following
Joined Jan 4, 2018, 2:36 PM
Last Online Jul 21, 2020, 1:30 PM

acabrera2012 Unfollow Follow

Latest posts made by acabrera2012

  • RE: PIR Sensor for MMM-ProfileSwitcher

    I know this is an old topic but in case anyone has had this question, I was able to use a PIR sensor with the MMM-ProfileSwitcher module. I simply added modified this section of MMM-ProfileSwitcher.js with the lines in bold:

        // Override the default NotificationRecieved function
        notificationReceived: function (notification, payload, sender) {
            if (notification === "DOM_OBJECTS_CREATED") {
                Log.log("Hiding all non default modules.");
                this.set_profile(this.config.includeEveryoneToDefault);
                this.sendNotification("CHANGED_PROFILE", {to: this.config.defaultClass});
            } else if (notification === "CURRENT_PROFILE") {
                this.change_profile(payload);
            } <strong>else if (notification == 'USER_PRESENCE') {
                    this.change_profile("Profile2")</strong>
                }
    
    },
    

    To explain, the MMM-PIR-Sensor module sends a notification to all modules when it detects movement. The notification is “USER_PRESENCE”. You simply check for it within your MMM-ProfileSwitcher module and tell it to change the profile. Hope this helps

    posted in Requests
    A
    acabrera2012
    Apr 10, 2018, 1:41 PM
  • RE: MMM-MirrorMirrorOnTheWall and MMM-AlexaPi

    Well, now that I’m looking at the Amazon Developer Console, I’m noticing something that I may have overlooked…My Alexa Skills have not been certified or published. My understanding was that you don’t want to publish the skills because they will then be available to the public. I thought that if I simply avoided those steps, I would be in an acceptable “beta” state since I only need it for home use. The other option I saw was to give access to only an Amazon Business Account, but that doesn’t seem right for the magic mirror setup. Am I thinking about this correctly? Did everyone else here make their MagicMirror2 Alexa skills public?

    posted in Troubleshooting
    A
    acabrera2012
    Mar 7, 2018, 3:15 PM
  • RE: MMM-MirrorMirrorOnTheWall and MMM-AlexaPi

    I suppose it could be something with Amazon blocking but I would think that one of the logs would have shown some sort of error. Are there other logs or useful tricks for debugging that I may have missed?

    As far as the image and video on Amazon, yes, I have already enabled them.

    posted in Troubleshooting
    A
    acabrera2012
    Mar 7, 2018, 1:30 PM
  • MMM-MirrorMirrorOnTheWall and MMM-AlexaPi

    Hello everyone,

    First of all, thanks to everyone that has written modules for this project as well as the original creator of the magicmirror. This is the most fun I’ve had in a while.

    But, I’m having some trouble getting Alexa working on my magic mirror. Here is what I have:

    • I have installed MMM-AlexaPi and MMM-MirrorMirrorOnTheWall as well as followed the instructions for MirrorMirrorOnTheWallSkill
    • AlexaPi is running and responds to “Alexa” and even answers basic questions.
    • The microphone icon shows on my magic mirror and changes its display when I say “Alexa” and it responds
    • I have a working config.yaml from the AlexaPi setup and use “magicmirror” as the device
    • When I log into my amazon developer console through any browser to test the Alexa skills, I can type something like “show me pictures of dogs” and I get images of dogs on my magic mirror display with the word “dogs” right underneath the photos

    So, my issue is that everything appears to be working, on its own, but Alexa is not truly integrated with my magic mirror because I can’t simply say “Alexa, show me pictures of dogs”. When I do, it responds with something like “I don’t know that one”.

    Here are a few pieces of info that might help someone point me in the right direction (with appropriated info redacted):

    • What I’m using:

      1. Raspberry Pi 3
      2. Raspbian Stretch
      3. MagicMirror 2.2.2
    • nano /etc/opt/AlexaPi/config.yaml

    # See https://github.com/alexa-pi/AlexaPi/wiki/Audio-setup-&-debugging
    # to get a better idea of how to set things in here
    
    # Level of log output
    # default: INFO
    # set to DEBUG for verbose logging
    logging: DEBUG
    
    sound:
      # Name of your microphone device: "magicmirror"
      # leave empty for default
      input_device: "USB PnP Sound Device: Audio (plughw:1,0)"
      # input_device: "magicmirror"
    
      playback_handler: "vlc"
    
      # you can go here with alsa, pulse or others
      # keep blank for the best audio output selected by the underlying code
      output: "pulse"
      # output device: "pulse"
      # currently supports ALSA only
      output_device: "magicmirror"
    
      # if left empty, won't be passed to the underlying library / command if it supports it
      # if it doesn't 100% will be used
      default_volume: 80
    
      # Means the same as above, but is used for media (playing music for example)
      # Leave blank to use the same setting as for speech content
      media_output:
      media_output_device:
      media_default_volume:
    
      # Some device: "magicmirror"
      # value is the number of seconds of silence to pad the beginning and end of the audio. Only
      # the sox handler supports this configuration option.
      playback_padding: 0
    
    # Amazon Alexa settings
    alexa:
      Client_ID: "amzn1.application-oa2-client.1234"
      Client_Secret: "1234"
      Device_Type_ID: "MagicMirror2"
      Security_Profile_Description: "someprofile"
      Security_Profile_ID: "amzn1.application.1234"
      refresh_token: "Atzr|1234"
    
    # See https://github.com/alexa-pi/AlexaPi/wiki/Triggers for the description of these options
    triggers:
      platform:
        enabled: true
        voice_confirm: false
    
        # one of: oneshot-vad, continuous, continuous-vad
        event_type: "oneshot-vad"
    
        # only for "continuous" event_types
        long_press:
          # system command to run after pressing the button for _duration_ number of seconds
          # empty to disable
          command: ""
    
          # duration in seconds
          duration: 10
    
          # CURRENTLY DISABLED
          # optional audio file to play before executing the command
          # you might wanna use full path to make sure AlexaPi finds it
          # you can use {resources_path} for the path to the AlexaPi "resources" directory
          audio_file: ""
    
    
      pocketsphinx:
        enabled: true
        voice_confirm: true
    
        phrase: "alexa"
        threshold: 1e-10
    
    # Commands to run before and after an interaction begins. Leave empty to disable.
    event_commands:
    
      # Example used to lower shairport-sync volume during interaction with alexa
      #     startup: "amixer set shairportvolume 100%"
      #     pre_interaction: "amixer set shairportvolume 10%-""
      #     post_interaction: "amixer set shairportvolume 10%+""
      # Note this assumes you have redirected shairport-syncs audio to a seperate softdevice
      # with control "shairportvolume". Example asound.conf avalible in the scripts folder
    
      # Command to run at the start of AlexaPi
      startup: ""
    
      # Command to run after a trigger is detected but before an interaction begins
      pre_interaction: ""
    
      # Command to run after the interaction has completed
      post_interaction: ""
    
      # Command to run during a clean shutdown of AlexaPi
      shutdown: ""
    
    platform:
      # Name of your platform, e.g. raspberrypi, orangepi, desktop
      device: "magicmirror"
    
    platforms:
      # common config for all platforms (if they support the options)
      # can be overriden in the the respective platform sections
      common:
    
      chip:
        # GPIO Pin with button connected
        button: XIO-P1
        # GPIO Pin for the playback/activity light
        plb_light: XIO-P3
        # GPIO Pin for the recording light
        rec_light: XIO-P5
    
      raspberrypi:
        # GPIO Pin with button connected
        button: 18
        # GPIO Pin for the playback/activity light
        plb_light: 24
        # GPIO Pin for the recording light
        rec_light: 25
    
      orangepi:
        # GPIO Pin with button connected
        button: 20
        # GPIO Pin for the playback/activity light
        plb_light: 9
        # GPIO Pin for the recording light
        rec_light: 8
    
      desktop:
        min_seconds_to_record: 3
    
      dummy:
    
      magicmirror:
        # Magic Mirror - github.com/MichMich/MagicMirror
        # Integrates with MMM-AlexaPi module (github.com/dgonano/MMM-AlexaPi) to display listening, playback, etc status
        # Hostname of the AlexaPi HTTP server, leave empty for any name
        hostname: ""
        # Port the ALexaPi HTTTP server binds to
        port: 5055
        # Hostname of the Magic Mirror
        mm_hostname: "localhost"
        # Port of the Magic Mirror
        mm_port: "8080"
        # How ofter the Hearbeat fires in seconds
        hb_timer: 5
    
      hyperion:
        # Hostname of the Hyperion node's JSON server
        hyperion_json_host: "127.0.0.1"
        # Port of the Hyperion node's JSON server
        hyperion_json_port: 19444
        # Visual status as static 'color' or 'effect'
        # Overridden by 'hyperion_flash_state_xxx'
        hyperion_mode: "effect"
        # Running speed when visualizing as 'effect'
        hyperion_effect_speed: 1
        hyperion_priority: 1
        color_playback: [80, 213, 35]
        color_processing: [35,169,213]
        color_recording: [168, 35, 213]
        flash_duration: 500
        flash_frequency: 8
        # Use Strobe effect instead of default effect or static color
        flash_state_playback: true
        flash_state_processing: false
        flash_state_recording: false
        # Visualize playback state
        indicate_playback: true
        #Also print json request/response when in debug mode
        verbose: false
    
      serial:
        port: "/dev/ttyACM0"
        baudrate: 9600
        messages:
          trigger: ""
          playback_start: "g"
          playback_end: "x"
          recording_start: ""
          recording_end: ""
          processing_start: ""
          processing_end: ""
          failure: ""
          success: ""
    
    
    • sudo systemctl status AlexaPi.service -l
    ● AlexaPi.service - Alexa client for all your devices
       Loaded: loaded (/usr/lib/systemd/system/AlexaPi.service; enabled; vendor preset: enabled)
       Active: active (running) since Tue 2018-03-06 13:09:08 EST; 10s ago
         Docs: https://github.com/alexa-pi/AlexaPi/wiki
     Main PID: 25992 (python)
       CGroup: /system.slice/AlexaPi.service
               └─25992 /usr/bin/python /opt/AlexaPi/src/main.py --daemon
    
    Mar 06 13:09:16 raspberrypi python[25992]: DEBUG: Player State: State.Ended
    Mar 06 13:09:16 raspberrypi python[25992]: DEBUG: Finished play.
    Mar 06 13:09:16 raspberrypi python[25992]: DEBUG: Indicate Stop Playing
    Mar 06 13:09:16 raspberrypi python[25992]: DEBUG: Calling URL: http://localhost:8080/alexapi?action=AVSSTATUS&status=idle
    Mar 06 13:09:16 raspberrypi python[25992]: DEBUG: Response: {"status":"success"}
    Mar 06 13:09:16 raspberrypi python[25992]: DEBUG: Indicating Success
    Mar 06 13:09:16 raspberrypi python[25992]: DEBUG: Calling URL: http://localhost:8080/alexapi?action=AVSSTATUS&status=success
    Mar 06 13:09:16 raspberrypi python[25992]: DEBUG: Response: {"status":"success"}
    Mar 06 13:09:18 raspberrypi python[25992]: DEBUG: Sending MM Heatbeat
    Mar 06 13:09:18 raspberrypi python[25992]: DEBUG: Response: {"status":"success"}
    
    • /opt/AlexaPi/src/main.py -d
    2018-03-06 13:13:22 DEBUG: Setting up playback handler: VlcHandler
    2018-03-06 13:13:22 DEBUG: sound output_device: pulse
    2018-03-06 13:13:22 DEBUG: Setting up Magic Mirror platform
    2018-03-06 13:13:22 INFO: Magic Mirror HTTP Server - :5055
    2018-03-06 13:13:22 INFO: Checking Internet Connection ...
    2018-03-06 13:13:22 DEBUG: Starting new HTTPS connection (1): api.amazon.com
    2018-03-06 13:13:22 DEBUG: https://api.amazon.com:443 "GET /auth/o2/token HTTP/1.1" 404 29
    2018-03-06 13:13:22 INFO: Connection OK
    2018-03-06 13:13:22 INFO: AVS token: Requesting a new one
    2018-03-06 13:13:22 DEBUG: Starting new HTTPS connection (1): api.amazon.com
    2018-03-06 13:13:22 DEBUG: https://api.amazon.com:443 "POST /auth/o2/token HTTP/1.1" 200 946
    2018-03-06 13:13:22 INFO: AVS token: Obtained successfully
    2018-03-06 13:13:22 DEBUG: Starting Magic Mirror platform HTTP Server
    2018-03-06 13:13:22 DEBUG: Starting Magic Mirror heartbeat with 5 second interval
    2018-03-06 13:13:22 DEBUG: Sending MM Heatbeat
    2018-03-06 13:13:22 DEBUG: Response: {"status":"success"}
    2018-03-06 13:13:22 DEBUG: Stopping audio play
    2018-03-06 13:13:22 DEBUG: Playing audio: /opt/AlexaPi/src/resources/hello.mp3
    2018-03-06 13:13:22 DEBUG: Player State: State.Opening
    2018-03-06 13:13:23 DEBUG: Player State: State.Playing
    2018-03-06 13:13:23 DEBUG: Started play. 
    2018-03-06 13:13:23 DEBUG: Indicate Start Playing
    2018-03-06 13:13:23 DEBUG: Calling URL: http://localhost:8080/alexapi?action=AVSSTATUS&status=playback
    2018-03-06 13:13:23 DEBUG: Response: {"status":"success"}
    2018-03-06 13:13:25 DEBUG: Player State: State.Ended
    2018-03-06 13:13:25 DEBUG: Finished play. 
    2018-03-06 13:13:25 DEBUG: Indicate Stop Playing
    2018-03-06 13:13:25 DEBUG: Calling URL: http://localhost:8080/alexapi?action=AVSSTATUS&status=idle
    2018-03-06 13:13:25 DEBUG: Response: {"status":"success"}
    2018-03-06 13:13:25 DEBUG: Indicating Success
    2018-03-06 13:13:25 DEBUG: Calling URL: http://localhost:8080/alexapi?action=AVSSTATUS&status=success
    2018-03-06 13:13:25 DEBUG: Response: {"status":"success"}
    2018-03-06 13:13:27 DEBUG: Sending MM Heatbeat
    
    
    • ~/MagicMirror/config/config.js
    ..................
                    {
                            module: 'MMM-MirrorMirrorOnTheWall',
                            position: "top_bar",
                            config: {},
                            classes: 'default everyone'
                    },
                    {
                            module: 'MMM-AlexaPi',
                            position: 'bottom_bar',
                            config: {
                                    alexaTimeout: 30000,
                                    alexaHBTimeout: 10000
                            },
                            classes: 'default everyone'
                    },
    .................
    
    • pm2 logs --lines 50
    0|mm       | > magicmirror@2.2.2 start /home/pi/MagicMirror
    0|mm       | > sh run-start.sh
    0|mm       | 
    0|mm       | Starting MagicMirror: v2.2.2
    0|mm       | Loading config ...
    0|mm       | Loading module helpers ...
    0|mm       | Initializing new module helper ...
    0|mm       | Module helper loaded: MMM-MirrorMirrorOnTheWall
    0|mm       | Initializing new module helper ...
    0|mm       | Module helper loaded: MMM-AlexaPi
    0|mm       | No helper found for module: alert.
    0|mm       | Initializing new module helper ...
    0|mm       | Module helper loaded: updatenotification
    0|mm       | No helper found for module: MMM-ProfileSwitcher.
    0|mm       | No helper found for module: MMM-RandomPhoto.
    0|mm       | Initializing new module helper ...
    0|mm       | Module helper loaded: MMM-PIR-Sensor
    0|mm       | No helper found for module: clock.
    0|mm       | Initializing new module helper ...
    0|mm       | Module helper loaded: calendar
    0|mm       | No helper found for module: currentweather.
    0|mm       | No helper found for module: weatherforecast.
    0|mm       | Initializing new module helper ...
    0|mm       | Module helper loaded: newsfeed
    0|mm       | Initializing new module helper ...
    0|mm       | Module helper loaded: MMM-PiLights
    0|mm       | Initializing new module helper ...
    0|mm       | Module helper loaded: MMM-Events
    0|mm       | Initializing new module helper ...
    0|mm       | Module helper loaded: MMM-fitbit
    0|mm       | Initializing new module helper ...
    0|mm       | Module helper loaded: MMM-Recipe
    0|mm       | Initializing new module helper ...
    0|mm       | Module helper loaded: MMM-MovieListings
    0|mm       | All module helpers loaded.
    0|mm       | Starting server on port 8080 ... 
    0|mm       | Server started ...
    0|mm       | Connecting socket for: MMM-MirrorMirrorOnTheWall
    0|mm       | Starting module helper: MMM-MirrorMirrorOnTheWall
    0|mm       | Connecting socket for: MMM-AlexaPi
    0|mm       | Starting node helper for: MMM-AlexaPi
    0|mm       | Connecting socket for: updatenotification
    0|mm       | Connecting socket for: MMM-PIR-Sensor
    0|mm       | Connecting socket for: calendar
    0|mm       | Starting node helper for: calendar
    0|mm       | Connecting socket for: newsfeed
    0|mm       | Starting module: newsfeed
    0|mm       | Started node_helper.js for MMM-DailyBibleVerse.
    0|mm       | Connecting socket for: MMM-PiLights
    0|mm       | [2018-03-06 13:17:49] [MMM-PiLights] Starting node_helper
    0|mm       | Connecting socket for: MMM-Events
    0|mm       | Starting node_helper for: MMM-Events
    0|mm       | Connecting socket for: MMM-fitbit
    0|mm       | Starting module helper: MMM-fitbit
    0|mm       | Connecting socket for: MMM-Recipe
    0|mm       | Connecting socket for: MMM-MovieListings
    0|mm       | MMM-MovieListing helper started...
    0|mm       | Sockets connected & modules started ...
    0|mm       | Launching application.
    0|mm       | Attempt to connect to AWS 
    0|mm       | { MODE: { MODE_0: 0, MODE_1: 1, MODE_2: 2, MODE_3: 3 },
    0|mm       |   CS: { none: 64, high: 4, low: 0 },
    0|mm       |   ORDER: { msb: false, lsb: true },
    0|mm       |   Spi: [Function: Spi] }
    0|mm       | Spi { _spi: _spi {}, device: '/dev/spidev0.0' }
    0|mm       | Set credential request recieved.
    0|mm       | { client_id: '1111',
    0|mm       |   client_secret: '1234' }
    0|mm       | Initial run request recieved.
    0|mm       | Running getData.py
    0|mm       | results: [{"message":"credentials.ini exists","type":"status"},{"message":"Writing credentials to credentials.ini","type":"status"},{"message":"Writing id: 1111 and secret: 1234","type":"status"},{"message":"Credentials write successful","type":"status"}]
    0|mm       | Connected to AWS IoT
    0|mm       | Subscribed: MagicMirror:new-text
    0|mm       | Subscribed: MagicMirror:new-images
    0|mm       | Subscribed: MagicMirror:change-module
    0|mm       | Subscribed: MagicMirror:new-video
    0|mm       | Finished getting data
    

    If have read hundreds of posts and followed many links before finally deciding to ask for some help. I’ve been trying to solve this one on my own for too long. If anyone has any suggestions, I would really appreciate the help.

    posted in Troubleshooting
    A
    acabrera2012
    Mar 6, 2018, 6:27 PM
  • RE: MMM-Facial-Recognition-Tools error

    @acabrera2012 SOLVED!

    I changed “model.save(config.TRAINING_FILE)” to “model.write(config.TRAINING_FILE)” in train.py

    posted in Troubleshooting
    A
    acabrera2012
    Jan 5, 2018, 4:43 PM
  • SOLVED

    Re: MMM-Facial-Recognition-Tools error

    Solved:

    I changed “model.save(config.TRAINING_FILE)” to “model.write(config.TRAINING_FILE)” in train.py.

    posted in Troubleshooting
    A
    acabrera2012
    Jan 5, 2018, 4:40 PM
  • MMM-Facial-Recognition-Tools error

    Hello everyone,

    I have been trying for weeks to get the facial recognition to work with my magic mirror. I have searched this forum and google but I can’t quite seem to find an answer to my problem. Here is the error I get when I’m trying to test it:

    [‘Angel’]
    Using FACE_ALGORITM: 1
    Loading training data…
    Training data loaded!
    Cropping…
    Crop: [[ 30 30 31 …, 148 143 136]
    [ 30 32 32 …, 145 143 136]
    [ 32 32 31 …, 144 144 135]
    …,
    [238 206 164 …, 200 206 179]
    [240 227 184 …, 199 210 181]
    [240 240 206 …, 199 212 193]]
    OpenCV Error: Bad argument (This LBPH model is not computed yet. Did you call the train method?) in predict, file /home/pi/opencv_contrib-3.3.0/modules/face/src/lbph_faces.cpp, line 396
    Traceback (most recent call last):
    File “facerecognition.py”, line 83, in
    label, confidence = model.predict(crop)
    cv2.error: /home/pi/opencv_contrib-3.3.0/modules/face/src/lbph_faces.cpp:396: error: (-5) This LBPH model is not computed yet. Did you call the train method? in function predict

    I have trained the LBPH model multiple times using .jpg’s as well as using the camera on my own face. This is what I’m running:

    • Raspberry PI 3
    • Raspberry pi cam
    • OpenCV-3.3.0
    • Python 2.7 (I also have Python 3 installed)
    • Electron 1.7.9
    • Node 8.9.1
    • npm 5.6.0

    If anyone has any idea how I can better troubleshoot this error through logs or any other means, please let me know. I’m so close to being up and running but I can’t seem to make any real progress on this one. Thanks.

    posted in Troubleshooting
    A
    acabrera2012
    Jan 4, 2018, 2:50 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