Saturday, December 16, 2017

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!

 

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