HAL config in external database?

This is the place to ask questions about using xPL - whether that's installing the software or getting your hardware working.

HAL config in external database?

Postby Jabberwock » Mon Feb 01, 2010 10:26 am

Following Tim's excellent advice given here:

viewtopic.php?f=1&t=956

I have started to appreciate the ease of use and portability of the database engine.

Just a thought - maybe it would be beneficial to store the config in an external database, accessible by other means? The problem with the current model is that it is pretty closed... The fact that it can be queried by xPL messages does help, but may not be most convenient, especially in the web context (with apps it's easier, as they can maintain their own variables based directly on the received messages).

A simple example: on my control website I want to have an icon which displays dawn/dusk. Extracting the information now from HAL is rather complicated (I think?), while querying a mySQL or SQLlite database would take three php lines.

Alternate route might be a webserver (although I would rather avoid it, as it would be my third!), which responds to specific http queries.
Jabberwock
 
Posts: 74
Joined: Fri May 23, 2008 12:41 pm
Location: Gniezno, Poland

Re: HAL config in external database?

Postby Tim » Thu Feb 04, 2010 8:16 am

I'm not sure how you are getting Dawn/Dusk status from HAL, but could you use the xPLDawnDusk app on Tom's site. You could then update your database based on it's messages, and your web app could get the current value from the database?
Tim
 
Posts: 84
Joined: Thu Dec 29, 2005 10:14 am

Re: HAL config in external database?

Postby Jabberwock » Thu Feb 04, 2010 8:25 am

Yes, but it still requires an external app that would save the Dawn/Dusk message (or the HAL config value) into mySQL database... Could be done, rather easily (even a script could to that), but it seems a waste to write a database handler if most of what HAL is doing is, well, handling a database (but in different format).
Jabberwock
 
Posts: 74
Joined: Fri May 23, 2008 12:41 pm
Location: Gniezno, Poland

Re: HAL config in external database?

Postby Ian Lowe » Thu Feb 04, 2010 8:43 am

Sorry for the slow response.

Yes, it's a good idea - and one of the reasons we have added a few new features into xplhal2.

For a start, there's the GOC - global object cache.

It's going to be used as the state tracking, config storing, event tracking point of truth in the network and will support replication between xplhal installs, and into the new xplcloud service (more about that later)

Secondly, there's the 'not quite ready' web services module in xplhal2. it's in the SVN, but not quite ready for the primetime. it should make the next build though.

That allows you to point a web browser request (so, any ajax library) at the xplhal server, and return (or set) the value of any entry in the GOC.

sound useful? I thought so ;)
Got a Question? Have you searched the forums? Perhaps the xPL Wiki can help.
User avatar
Ian Lowe
Site Admin
 
Posts: 626
Joined: Mon Dec 12, 2005 1:17 pm
Location: Glasgow, Scotland

Re: HAL config in external database?

Postby Jabberwock » Thu Feb 04, 2010 8:49 am

Yes, exactly what I had in mind! Web requests would do quite nicely...
Jabberwock
 
Posts: 74
Joined: Fri May 23, 2008 12:41 pm
Location: Gniezno, Poland


Return to Using xPL