Build an open future with us.

Invest in Mycroft and become a community partner.

Mycroft, the teenager


#1

Having got two Mark 1s up to the latest software versions and up and running last night, I finished off by instructing one to set an alarm for the following morning for 0730. I then asked the time. As it was 23:45, or there abouts, the reporting of the time was followed by both units closing their eyes. Obviously bed time.

When 0730 arrived, nothing happened. Both units were still asleep. So I issued “Wake up”, “wakey wakey”, “Awake”. Nothing worked. Both units woke up, claimed they didn’t understand me, and went back to sleep. I asked if an alarm was still set. Yes it was.

Oddly enough, the responses and actions were very similar to that of my teenager, who was in the other room… :rofl:


[SOLVED] Bug in Alarm Skill
#2

@Darmain - Thanks for the info! Let me see if I can replicate and then troubleshoot! @KathyReid - might have a quick and easy way to fix this (?) but I haven’t ran into it much. Although, I have seen it recently from what I can remember.


#3

@Darren-Mycroft Right, I know exactly what it is. The problem is crossed time zones. The setting of the alarm is done in local time but the alarm itself is running against Universal time. Universal time, or GMT, might be UK time but we are one hour ahead in British Summer Time (BST) right now. Mycrofts time zones are accounting for that, so the clock is right. So I proved this by at 17:55, as displayed on the clock, setting an alarm for 18:00, which failed to sound after five minutes. It then went on the sound at 19:00 on the clock.

By the way, all I got was three beeps, followed by a flashing display. As an alarm clock that won’t cut it, I will sleep through that. :slight_smile:


#4

@Darmain I often say Mycroft is still a toddler, so glad to see it progress to teenager. :slight_smile: . Thanks for flagging this and for really solving the problem we needed. I will submit an official ticket on our side. Flagging @steve.penrod the fixer of all things alarm.

On the issue of three beeps, I can probably solve that. Go into home.mycroft.ai and go to skills. (9/29/2018) . Please note the location of this setting is planned to be moved in our home.mycroft.ai upgrade.) You should see a configuration of the alarm skill with multiple options for sound. I agree that the three beeps isn’t enough. Although I hate the Constant Beep sound, it does the trick for me.


#5

@Darmain I think I have most of this addressed here: https://github.com/MycroftAI/mycroft-skills/pull/586

The only issue I know of at this point is that if you set an alarm for 29, 30 or 31 days you’ll get an odd response because the formatter has a bug that only cosiders the day, not the full date for “today/tomorrow/yesterday”. I.e. it things 10-20-2018 is “today” on 9-20-2018.

You can try this via a git pull on your /opt/mycroft/skills/mycroft-alarm.mycroftai folder. If it looks good, you can “vouch” for it at: https://github.com/MycroftAI/mycroft-skills/pull/586


#6

Hi @steve.penrod, On the case. Thanks for that.


#7

@steve.penrod Progress report

Ok, Let’s get that important news to you first. The good news is this fix appears to have addressed the issue.

I have issues of my own, which come down to a lack of familiarity, so any help you can offer would really be appreciated.

So, on to the skill test and after a fair amount of trial and error I updated the alarm skill on my Mark 1 by cloning it to the “pi” home directory and then “sudo cp” it into the skills directory. Then I had to get the owner and group reset to “mycroft” with “chmod”.

I then tested the skill, and unfortunately it didn’t work (yet). No alarms still when using a method described in the original post. So then I reasoned that with a little debugging I could follow the “Alarm set” process and see exactly what the code produced. However, first I wanted to prove my changes were being adapted by the Mark 1. I proved this by a subtle modification of the “For when” dialog, so its states “For when Dave”. That didn’t work, there was no change from “For when”.

Ah ha, if my change isn’t going in then neither is yours. Try a reboot. Result!!. Set an alarm; For when Dave? { one minutes time }. One minute later, the alarm goes off. Yay!

Right, so to the basic question, how do I reload a skill on a Mark 1, without rebooting it? On Linux you can “stop-mycroft” then “start-mycroft”, in fact I think it spots there has been a skill change and reloads itself.
The Mark 1 doesn’t seem to do this.

In the CLI I tried “:keep mycrofy-alarm.mycroftai”, “:deactivate mycrofy-alarm.mycroftai” and “:activate mycrofy-alarm.mycroftai” and just ended up lobotomising the poor lump :frowning_face:.

A reboot got me one step along. However I am SSHing into the unit, twice. One on the CLI, the other on the Linux console so I can run NANO. A reboot is a pain now.

Moving along another step. How can I trace out information from the code on to the CLI? In a normal environment you could print to the console, but that clearly doesn’t work here.

That’ll do for the moment. Well done Steve. Once I find my feet I hope I can be more help and less burden.

I have put a comment onto Github under my username “DarmainTheDonkey”.

Cheers, Dave


#8

Thanks for the feedback, Darmain!

Here are a several points, in no particular order. I’m in the process of pushing a bunch of stuff, so some of this might not be out “in the wild” quite yet while it gets through approval to go public. But if now now, this should all apply very soon:

  • You can say “Hey Mycroft, install preview of Alarm” or “Hey Mycroft, install Alarm beta” (which is tricky to pronounce, sometimes – hence the “preview”). This tells Mycroft to switch from the latest approved version to the latest code checked in to the repo. That means you are at the mercy of the skill author – they could slip anything they want in the code. But is is a quick way to try stuff like this out and shouldn’t require an futzing to make it work.
  • Afterwards you can say “Hey Mycroft, install alarm” and it’ll switch back to the approved version
  • In general, you can just install or change a skill under /opt/mycroft/skills and it should be picked up by Mycroft. The only time it doesn’t work is if you install in such a way that permissions get in the way. On a Mark 1, skills are run under a special user called “mycroft”, so if you just copy skills you need to either do something like sudo chmod 777 /opt/mycroft/skills/WHATEVER or sudo chown mycroft /opt/mycroft/skills/WHATEVER
  • Even better, use the mycroft-msm utility to pull down things. You can type mycroft-msm install https://github.com/user/repo.git to get it installed with the correct permissions, running pip install on the requirements.txt file, etc.
  • To see things in the CLI for testing, use self.log.info("Something I want to see"). I do that all the time to examine the flow of programs. You can also see variables with: self.log.info("My variable: "+str(myvar)).
  • On a Mark 1 or Picroft (or soon Github install) you can type “mycroft-” to see all the helper functions available. mycroft-help give you a quick summary.

Hope that helps orient you.


#9

Thanks @steve.penrod,

That is a lot of very useful information. :+1::slightly_smiling_face:

Further good news, the alarm worked in the morning, at the right time!

A suggestion though. The alarm volume appears to be aligned with the voice volume. Can you apply some boost, ideally variable?


#10

Hi @steve.penrod,

The alarm has been running for a few days, following a “Set an alarm for 07:30 on weekdays” command. Observations to report.

  • There is a slippage with the time the alarm goes off. The clock displays 0730 but it can be a little while before the alarm sounds. This morning it had already reached 0731. Granted this could be a scheduler issue rather than the actual alarm skill.

  • Eye color, again this might not be an Alarm issue. The eyes were set to red via the home page. Following the alarm they went back to blue and stayed as such. I have just checked and the homepage reports blue also. I have set them back to red and will try again.

  • Cancelling the alarm, now there is a challenge. “BEEP BEEP BEEP”, “Hey Mycroft”,“CHIRP”;“Cancel the …”, “BEEP BEEP BEEP”,“HEY MYCROFT”,“CHI…”,“CANCEL THE ALARM”, “BEEP BEEP BE…”. Success. Well, I suppose it does wake you up well. Seriously, can we mute the alarm if Mycroft has identified and is processing the wake word?

We are getting there though. Thanks for your help and efforts.

Cheers,
Dave


#11

Hi @steve.penrod, Interesting discovery tonight. I mentioned above that the alarm seems to slip. It did again this morning. So this evening I asked mycroft what alarms were set. Alarm set for 07:32. Wait! I set it for 07:30. Interesting. I have reset for 07:30 again and see what happens. Many thanks, Dave


#12

Hi @steve.penrod,
I fear a problem has occurred somewhere in the new alarm release. The alarm went off at the right time but mycroft didn’t understand the command to cancel it. After a lot of noise and trying I had to pull the plug.


#13

Hi @Darmain, is there any chance you could upload your skills.log so we can take a look and do some analysis of why the stop alarm command isn’t working? Let me know if you’d like instructions.
Best, Kathy


#14

Hi @KathyReid, The only instruction I need is how do I upload a ZIP file to the forum? I have it ready, but…


#15

Sure, click the image icon in the comment window - it’s really an “upload” function, not just an “image” function :slight_smile:


#16

But first rename it to a jpg or something like? Zips aren’t allowed. :smirk:


#17

Nope, that doesn’t work either. It tries to treat it like an image. Where is the “File upload” button?:no_mouth:


#18

I see what you mean, it won’t allow it. Can you paste it into Pastebin or similar instead?