LinuxMCE Forums

General => Developers => Topic started by: bulek on December 26, 2007, 07:08:22 am

Title: Contributing device templates and other changes into "710"
Post by: bulek on December 26, 2007, 07:08:22 am
Hi,

I've made pretty complete GSD template for Marantz SR line of rs232 audio receivers. If I remember right, there is alyways a headache on upgrading LMCE if you have local changes in your sql database. Also, I'd like to enahnce it, so I'm curious if somehow this one can enter new 710 version of LMCE...

I also have implemented pretty complete support for other automation devices (blinds, drapes, thermostats, etc....) and have made some simple changes on their templates (so for instance they can be shown on floorplan, controlable from home automation interfaces, etc....) that I'd also like to contribute....

With my previous experience with Pluto, I ended up having local changes not entered into main database for over a year - so I'd like not to repeat this with LMCE...

Maybe I can also make sql dump and someone can review changes....

Please give me advice, what to do I(either to contribute now, or wait for release and contribute after that...) ?

Thanks in advance,

regards,

Bulek.
Title: Re: Contributing device templates and other changes into "710"
Post by: ddamron on December 26, 2007, 08:07:37 am
Bulek,

Interesting... you say GSD... are you using C++ or Ruby?

I'm doing the same thing with Insteon.. in Ruby.

Any chance you could post some of your code snippets?


Dan
Title: Re: Contributing device templates and other changes into "710"
Post by: ddamron on December 26, 2007, 08:11:00 am
Oh, BTW, I'm in the same boat... 

I need to update sqlcvs too.....

Hari, any word of wisdom here??
Title: Re: Contributing device templates and other changes into "710"
Post by: hari on December 26, 2007, 06:10:36 pm
Oh, BTW, I'm in the same boat... 

I need to update sqlcvs too.....

Hari, any word of wisdom here??

for now we had to reset the repository to provide some developing sqlCVS service, the local database has to be resynchronized after a fresh 0704 installation (there is a script for that, see the sqlCVS thread). After that you can checkin your local changes and pull updates from the database.
After daniel's return we will see how to include the dump from the new repo in the 0710.
sqlCVS makes it easy to identify which rows are affected by a batch (for example see Zaerc's addition for the Logitech webcam: http://sqlcvs.charonmedia.org/sqlcvs/?site=batch/detail&repository=dce&batchid=-2).
The next step for me will be a crude perl hack to merge a batch between two repositories. The final "merge" code should maybe go into the sqlCVS binary, there are already some routines to sort out id collisions.

Any better thoughts?

best regards,
Hari
Title: Re: Contributing device templates and other changes into "710"
Post by: ddamron on December 26, 2007, 11:44:38 pm
Hari, Will that also handle things lik PNP Detection scripts?
How do I handle 'external' files?
Title: Re: Contributing device templates and other changes into "710"
Post by: hari on December 27, 2007, 12:53:20 am
Hari, Will that also handle things lik PNP Detection scripts?
How do I handle 'external' files?

they go into the svn:
http://svn.charonmedia.org/trac.cgi/browser/trunk/src/pnp_detection_scripts

bulek: i already did a script for the Marantz SR detection:
http://svn.charonmedia.org/trac.cgi/browser/trunk/src/pnp_detection_scripts/20_MarantzReceiver.sh
after resorting sqlCVS things we have to insert the final DeviceTemplate id.
Can you add the marantz template to a fresh 0704 installation after running the sqlcvs sync script (http://sqlcvs.charonmedia.org/ReinitSqlCVS.sh)? You could then check in and i could test it with my 7001 ;)

EDIT:
you have to refer to the script from the DHCPDevice Table (referred by DeviceTemplate):
Code: [Select]
| PnpDetectionScript | varchar(25) | YES  |     | NULL              |                |
the field should hold the scriptname without path. Can be done in the pluto-admin (device template).

best regards,
Hari
Title: Re: Contributing device templates and other changes into "710"
Post by: ddamron on December 27, 2007, 01:14:10 am
Thanks Hari, that makes sense..

I'm debugging right now..
Title: Re: Contributing device templates and other changes into "710"
Post by: PeteK on December 27, 2007, 01:26:19 am
When the Pluto guys attempted to check my template was checked into the pluto sqlcvs server, they encountered problems due to the fact that I had checked it into Hari's server earlier.  Dan, if your templates are already checked into the plut sqlcvs server, there may be the same issues checking into Hari's sqlcvs server.
Title: Re: Contributing device templates and other changes into "710"
Post by: hari on December 27, 2007, 02:52:31 am
When the Pluto guys attempted to check my template was checked into the pluto sqlcvs server, they encountered problems due to the fact that I had checked it into Hari's server earlier.  Dan, if your templates are already checked into the plut sqlcvs server, there may be the same issues checking into Hari's sqlcvs server.
yeah, that of course leads to problems. With sqlCVS a client can only be synchronized to one repository (the one from which it imported the .sqlcvs dumps).

best regards,
Hari
Title: Re: Contributing device templates and other changes into "710"
Post by: ddamron on December 27, 2007, 05:19:54 am
Understood.

I'm (STILL) debugging right now..

Trying to make the code a bit more readable...

When I'm ready to check it in, I'll let you guys know...

Thanks...
Dan
Title: Re: Contributing device templates and other changes into "710"
Post by: totallymaxed on December 27, 2007, 04:52:36 pm
When the Pluto guys attempted to check my template was checked into the pluto sqlcvs server, they encountered problems due to the fact that I had checked it into Hari's server earlier.  Dan, if your templates are already checked into the plut sqlcvs server, there may be the same issues checking into Hari's sqlcvs server.
yeah, that of course leads to problems. With sqlCVS a client can only be synchronized to one repository (the one from which it imported the .sqlcvs dumps).

best regards,
Hari

Hmmm... that throws up an interesting issue. If changes are made down-stream in your sqlCVS how do you get those changes back upstream? Whats the thinking about how this will be managed?
Title: Re: Contributing device templates and other changes into "710"
Post by: bulek on December 27, 2007, 10:19:12 pm
Hari, Will that also handle things lik PNP Detection scripts?
How do I handle 'external' files?

they go into the svn:
http://svn.charonmedia.org/trac.cgi/browser/trunk/src/pnp_detection_scripts

bulek: i already did a script for the Marantz SR detection:
http://svn.charonmedia.org/trac.cgi/browser/trunk/src/pnp_detection_scripts/20_MarantzReceiver.sh
after resorting sqlCVS things we have to insert the final DeviceTemplate id.
Can you add the marantz template to a fresh 0704 installation after running the sqlcvs sync script (http://sqlcvs.charonmedia.org/ReinitSqlCVS.sh)? You could then check in and i could test it with my 7001 ;)

....
best regards,
Hari
Hmm,

I'm not sure if there is an easy way to do it. I also made several scarce changes to local database for other templates too (mostly for supporting more devices on interactive floorplan). I also spent quite some time for adding things to Marantz template ( I also had to add a lot of new generic A/V commands), so I guess I cannot reproduce this work from memory...

Is there any other way of detecting my work and let it go in to main database in more automatic way ?

Thanks in advance,

regards,

Bulek.
Title: Re: Contributing device templates and other changes into "710"
Post by: hari on December 27, 2007, 11:13:04 pm
Hmmm... that throws up an interesting issue. If changes are made down-stream in your sqlCVS how do you get those changes back upstream? Whats the thinking about how this will be managed?
have not discussed that with Daniel or pluto yet (all are busy with the 0710). I'm still busy staring at the sqlCVS code to explore the innards. Great stuff that is. Some brilliant mind came up with that. But from what i have seen in my journey it does not fit for that task at the moment. I'm still awaiting response from pluto. We will discuss the topic after Daniel's vacation. My first task was to do a rudimentary "batch viewer" to see the affected rows. The biggest thing hindering me from automatic merging at the moment is the id reordering. How should the script now if eg a devicetemplate is the same in the two repos if they have different id's..
Other than that it should be pretty easy to extend sqlCVS for some "merge" option to pull a specific batch from another repo and push it into the local database (without psc and stuff). That changes could then be checked in upstream.

But maybe I'm completely wrong...

best regards,
Hari
Title: Re: Contributing device templates and other changes into "710"
Post by: hari on December 27, 2007, 11:16:24 pm
Is there any other way of detecting my work and let it go in to main database in more automatic way ?
all rows with empty psc_id should be local additions. Changes to rows can only be seen with a sqlCVS diff to the synced repo.

best regards,
Hari
Title: Re: Contributing device templates and other changes into "710"
Post by: Matthew on January 03, 2008, 03:43:48 pm
If I'm not mistaken, the consensus of this thread is that adding GSD templates to LMCE v0710 should not require revising the LMCE installer, but rather will depend on installing 0710 with its default GSD templates and sqlCVS support, and then syncing one's complete base installation to the public sqlCVS. Correct?

Will a public sqlCVS support that operation sometime soon, perhaps by the time v0710 is actually released (not just beta)? Will that sqlCVS allow naming groups of GSD devices, so a sync can grab just a subset (like "base 0710", or "Marantz stack#X" or "Matthew's House"), or a group of groups?

Thanks for working on sqlCVS - it really does look like it could be the site of the most LMCE development of all, as people can contribute configs to it for their own gear with a minimum of overhead.
Title: Re: Contributing device templates and other changes into "710"
Post by: hari on January 03, 2008, 11:21:33 pm
If I'm not mistaken, the consensus of this thread is that adding GSD templates to LMCE v0710 should not require revising the LMCE installer, but rather will depend on installing 0710 with its default GSD templates and sqlCVS support, and then syncing one's complete base installation to the public sqlCVS. Correct?
yes. The installer does not have to be touched. But a default install uses dumps from the pluto rep at the moment. But that can be changed easily. For now there is a script to reinitialize the database (0704).
Quote
Will a public sqlCVS support that operation sometime soon, perhaps by the time v0710 is actually released (not just beta)? Will that sqlCVS allow naming groups of GSD devices, so a sync can grab just a subset (like "base 0710", or "Marantz stack#X" or "Matthew's House"), or a group of groups?
sqlCVS doesn't support that at the moment. Maybe we have to do some "batch merging" functionality for syncing with the pluto repo. That could be misused to only pull specific devices (but you would have to track batches, every commited change adds a new one).
Quote
Thanks for working on sqlCVS - it really does look like it could be the site of the most LMCE development of all, as people can contribute configs to it for their own gear with a minimum of overhead.
i totally agree. sqlCVS with GSD is such a powerful tool.

best regards,
Hari
Title: Re: Contributing device templates and other changes into "710"
Post by: danielk on January 08, 2008, 12:43:26 am
Mathew, that sounds correct. But 0710 will probably not point to the public sqlCVS by default, but 0804 should (there are already directions in the wiki on how to point to the sqlCVS server.) My plan is to switch the public SVN repo over to Ubuntu's "Hardy Heron" (aka 8.04) as soon as 710 is released so that we'll be able to do make a 0804 release shortly after Ubuntu releases 8.04. I hope to make the delay between Ubuntu 7.10 and LMCE 0710 that we had this time a one time aberration...
Title: Re: Contributing device templates and other changes into "710"
Post by: ddamron on January 08, 2008, 01:44:44 am
That's great news Daniel,

Hari,

What you're doing will make all my work publicly accessible!!!  AWESOME!

Keep up the GREAT WORK guys!

This is truly starting to become a community supported project!  My hat's off to EVERYONE's efforts!

Dan