Testing and Feedback for Magic-Mirror-Voice-Control-Skill

@Papblo I will help you if I can however I haven’t looked at this code in quite some time. I would not know where to begin with debugging this code. I don’t even know what the latest version of Mycroft is or what changes may have broken the code. If you give me a few days I will see if I can take a look. Sorry I don’t have a quick answer for you.

@Papblo you do have MMM-Pages installed right?

Yes I do, the problem is every time when you say for example swipe right it goes to to the next page, that means the Module works great!..but the only problem i have is that this message appears )An error occurred while processing a request in Magic Mirror Voice Control Skill) instead of success.

That would be great if you could fix this problem :slight_smile:

Thank you

@Papblo In order for me to fix, I need to know what your MMM-Remote-Control is returning for the PAGE_INCREMENT/DECREMENT command. From a whitelisted browser in the address bar type ```
http://ip:8080/remote?action=NOTIFICATION&notification=PAGE_DECREMENT where you replace “ip” with the ip of your MagicMirror

Sorry for replying so late, i’m a little bit busy at the moment :).

The message I get is {success":true}, that’s really weird because when I speak swipe right the error message still shows up.

I really want just to get rid of this message, because otherwise it works perfect :))… For example when I say hide clock this message doesn’t shows up, i’m a little bit confused I think my magic mirror doesn’t like the word swipe :)).

Thanks

@Papblo sorry I realized my other reply was wrong. You could comment out everything from line 341 to 347. If that fixes your problem then bingo you’re done. I think the issue is a newer version of the MMM-Remote-Control module responds differently than when I wrote the skill. If I remember it right (cause I don’t have a working mirror to check it on) the previous version responded {‘status’: ‘success’}. So if you’re interested in changing the code instead of commenting it out, you can change line 341 to

response = status['success']
        if response == 'true':
            self.speak_dialog('success')
        else:
            self.speak('There was an error processing your request.')

That might be the code change you need. This is all from memory on my part because I have no way to verify.

1 Like

Now I get this error, but I think we are really close :).

~~~~here was an error processing your request. The error was caused by', reason)
UnboundLocalError: local variable 'reason' referenced before assignment
  ^--- NEWEST ---^

I have mycroft-core 20.2.4

Do you know maybe what I have to do?,
if not, I think I have to live with this message error :)

@Papblo did you comment out the lines? Or change the code? Look very carefully at the code I suggested. Make sure you have it exactly as I suggested. I think you left ‘reason’ at the end of there was an error.

i still get the error

    reason = status['reason']
KeyError: 'reason'

That's are my settings, i just changed success and true  

            response = status['success']
            if response == 'true':
                self.speak_dialog('success')
            else:
                reason = status['reason']
                reason = reason.replace('_', ' ')
                self.speak('There was an error processing your request

Sorry I forgot to tell you that, yes I did comment the lines out, but I didn’t have success… So I put everything how it was back :slight_smile:

So for now I’m going to leave it how it is, I still love the Module :).
Maybe one day someone is going to come with a good solution.

Thank you for your support and Time dmwilsonkc

@Papblo So I’m pretty sure the error is related to the different response from the MMM-Remote-Control module. When I wrote the skill, the module responded {“status”: “success”}. You said the module now responds {“success”: “true”}. So changing the code should work, but you’d need to change more than just the lines 341 & 342 because I’m sure it is not responding with {“status”: “error”, “reason”: “whatever the reason was”}. So that means there is no “reason” in the json file returned, thus causing the error in the skill’s code. So if we rewrite the code and remove all references to “reason” etc. the skill should not return the error. Like this:

 response = status['success']
    if response == 'true':
        self.speak_dialog('success')
    else:
        self.speak('There was an error processing your request.')

Now a good way to test this hypothesis would be to comment out the code and add back as you go line by line (that makes sense) for example starting at line 340 it should look like this:

status = r.json()
        #response = status['success']
        #if response == 'true':
           #self.speak_dialog('success')
        #else:
            #reason = status['reason']
            #reason = reason.replace('_', ' ')
            #self.speak('There was an error processing your request. The error was caused by', reason)

Oh, I should also point out that case matters. So check your response from the MMM-Remote-Control module. Is it’s response {“success”: “true”} or is it {“Success”: “True”}? Because it does matter! The skill’s code should match the case of the json response from the MMM-Remote-Control module. Fixing this error will just require a little trial and error on your part. If you get it working let me know.

Cheers!

1 Like

Thank you sooooo much, I just did like you said to comment everything out and save it, and look everything works perfect now, so many thanks again dmwilsonkc :))

status = r.json()
#response = status[‘success’]
#if response == ‘true’:
#self.speak_dialog(‘success’)
#else:
#reason = status[‘reason’]
#reason = reason.replace(’_’, ’ ')
#self.speak('There was an error processing your request.

I have one thing to mention, I needed to do everywhere the # on the __ init __ .py file where is written:

#response = status[‘success’]
#if response == ‘true’:
#self.speak_dialog(‘success’)
#else:
#reason = status[‘reason’]
#reason = reason.replace(’_’, ’ ')
#self.speak('There was an error processing your request.

Now finally, not on single error anymore :slight_smile:

I hope this helps other one with the same problem.

Hi. I installed and prepare the skill to use in Spanish. It works fine. The Skill doesn’t have errors. But I found tree points:
1.- I had to modified the init.py to accept different languages using more dialog (sentences that are on the init.py) files and json files to translate the actions
2.- The skill work correct with Magic Mirror Hide and show modules. And I can see the senteces with Kalliope
3.- But I don’t know why sometimes the skill begins to be in a loop process at Mycroft doesn’t stop to say: “Sucedió un error al procesar una petición de Magic” (An error occurred while processing a Magic request)
Note: Magic Mirror and Pycrof are in different pi’s

1 Like

Hi. I realize that the problem comes after a network problem. ¿could be a Remote control API problem?

A network issue from where to where?

Hi everybody, i find very interesting the mycroft integration with magicmirror and i have installed mycroft and magicmirror on the same pi, just to know i am on the latest versions both are running very well except when i launch mycroft it can t connect to magicmirror as they are using the same ip address i assume, i looked everywhere to find out what is the problem but j have no clue every comment is welcome!

Does your MagicMirror is bind on an IP address or just on localhost?

it is on an ip address