Saturday, December 16, 2017

A Few Solutions....

Composing yesterdays post, I was frustrated. Nothing was working and my newbie perl abilities were letting me down.

I decided to stop developing and start reading. I browsed through the developer section at forums.slimdevices.com, looking out for discussions that were relevant to my problems and might make more sense now that I'm several months into my perl career.

I few discussions rang some bells and some pointers were noted. The overriding impression I took away was that I needed to be working with the LMS, not against it. I'd been trying to shoehorn a http server running in a background process using external libraries. But what if I could leverage the LMS to manage a lot of this?

Bingo! In a couple of hours today, I got a http daemon running under the Slim::Networking::Select loop using addRead. No more background process voodoo required. It's a quick and dirty implementation right now but it behaves impeccably; no conflicts and no shutdown problems - and it works on Windows and Linux. Yay!

There's a bit more to do - I need to manage the stop and restart of the server if the user changes port or elects to switch it off, but that should be reasonably straightforward. There's also http client support inside LMS itself, maybe with HTTPS capabilities. Who knew??

I really feel that I'm making progress, which is good news!

 

A Few Issues...

Hmm. This is not easy.

One of the main issues arising from user testing on v0.1.1 was the fact that the LMS plug-in was not shutting down properly and thus locked LMS and prevented it from closing cleanly.

Looking into this in more detail, I found the that perl HTTP::Daemon was misbehaving and refusing to stop when asked politely. I changed to the Mojolicious Mojo::Server running as a deamon and this appeared to be much better behaved, facilitating clean LMS shutdowns.

In testing prior to release, however, it seems that's another issue raising it's head: the http daemon seems to be interfering with squeezebox connections to the LMS.

Read more: A Few Issues...

Test v0.1.0 / 0.1.1

The first test version of the skill went out on the Teamwork portal this week. Results were both good and bad.

The positives were that there's a really great team of testers involved with all levels of technical ability which really helps in finding both technical and usability issues. Everyone who tested is very engaged with great feedback and helpful suggestions.

The negative is that, at the moment, it doesn't really work :-(

Read more: Test v0.1.0 / 0.1.1

Verifying Alexa

Working through the Alexa Skill code in node-red, I discovered that there are fairly onerous requirements for verifying the origination of skill requests from Amazon. I looked at a few options but the easiest seems to be node-red-contrib-alexa-verifier which is a wrap of the JS alexa-verifier.

Initially, this doesn't seem to do much but when I attempt to pass a faked call to the skill code from postman, it's rejected with a 401 unauthorized status and a helpful description of the reason. This is good news as it's another hurdle down on the road to eventual certification.

 

 

 

New ASK built-in commands

Amazon have announced the release of a developer preview of a slew of new built-in commands for Alexa skills. These commands are intended to help developers by providing multiple variants of commands through a single inclusion in the skill. This lessens the burden of having to predict all the possible ways a user might say something. Included in the release are a bunch of intents around music including commands relating to playlists, artists, tracks and more.

These have significant implications for the squeezebox Alexa skill and I'll need to review them in detail. However, they're developer preview at the moment and therefore subject to change. Also, it looks like they're available for US skills only right now (I'm developing on the European platform). This won't hinder my plan to get an initial release out to testers to see how well the skill/LMS comms is working but is something I'll likely want to include in when I start building out the full command set.

 

 

 

Login Form

About Hab-Tunes

Hab-Tunes is an in-development skill for the Amazon Echo that allows voice control of Squeezebox devices. This site is intended to document the skill development and help give some idea of progress.

Follow Updates

Search #habtunes on twitter

Want to Help?

If you can contribute time, skills or ideas, find out how you can get involved.

Cron Job Starts