LIRC Client

Questions and comments specific to a particular plugin should go here.

Re: LIRC Event Receiver

Postby jinxdone » Sun Dec 16, 2007 2:18 am

townkat wrote:please also atach the file, you made me curious :)

and of corse the lircserver needs to be a diffrent plugin



Hehe.. sorry! I made some last minute changes that i almost forgot..
User avatar
jinxdone
Plugin Developer
 
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: LIRC Event Receiver

Postby jinxdone » Sun Dec 16, 2007 9:36 am

Ah.. I found what was my problem with testing the send feature with WinLirc. It uses a "transmit password" that changes the SEND_ONCE command to something else, I had to go and input it myself in the windows registry(HKLM\software\LIRC\password) to make it respond. Also winlirc doesnt support the other two commands.. but hey, everything seems to work fine now!

Also WinLirc seems to require the repeat count in the string, which is a bit non-standard behaviour since the specs say:

SEND_ONCE <remote control name> <button name> [<repeat count>]
SEND_START <remote control name> <button name>
SEND_STOP <remote control name> <button name>

[<repeat count>] = should be an optional argument.


*EDIT*

I updated the file attached in the first thread.. cleaned the code up a bit.


*EDIT*

Ok.. let's call this the final update.. I added even more things to the v0.7.0
User avatar
jinxdone
Plugin Developer
 
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: LIRC Event Receiver

Postby Bitmonster » Sun Dec 16, 2007 12:13 pm

Included in the latest beta.

I incorporated some fixes:
* created plugin.__init__ for AddAction (should not be added in in the __start__)
* added event.Skip() to the event handlers (to enable apply button)
* assigned Text to plugin.text, so the strings are translatable.
* changed wx.SpinCtrl to eg.SpinIntCtrl (wx.SpinCtrl has some limits)
* changed action class to eg.ActionClass (was already no eg.ActionWithStringParameter anymore)
* raise self.Exception in __call__ instead of "print". Looks nicer in the log.

There remains a small bug if you have no remotes if you have no connect to LIRC. It raises an IndexError if you change a control.

I might have used the version before (I saw the second EDIT to late), so the last changes might not be in it. Do you want to have SVN access, to avoid this in the future?
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: LIRC Event Receiver

Postby jinxdone » Sun Dec 16, 2007 3:34 pm

Ok.. I just committed a new version to the svn, I assume this version will be present in the next beta. (above build 1258)

I attended all the issues you brought up in the previous message.

Except:

* event.Skip() - which isn't neccessary, the apply button is updated correctly as is. (just tested using the -debug cmdline switch)
* wx.SpinCtrl to eg.SpinIntCtrl - I chose to use wx.SpinCtrl instead as it gets the job done just fine. For some reason I couldn't work out how to bind EVT_SPINCTRL (or equivalent) for the eg.SpinIntCtrl when I tried it.
User avatar
jinxdone
Plugin Developer
 
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: LIRC Event Receiver

Postby Bitmonster » Sun Dec 16, 2007 3:41 pm

jinxdone wrote:* wx.SpinCtrl to eg.SpinIntCtrl - I chose to use wx.SpinCtrl instead as it gets the job done just fine. For some reason I couldn't work out how to bind EVT_SPINCTRL (or equivalent) for the eg.SpinIntCtrl when I tried it.

wx.SpinCtrl doesn't validate. But you are right, the event binding is missing in eg.SpinIntCtrl. I will fix this later...
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: LIRC Event Receiver

Postby Bitmonster » Sun Dec 16, 2007 4:57 pm

Ok, eg.SpinNumCtrl and eg.SpinIntCtrl now generate an eg.EVT_VALUE_CHANGED event if their value changes. So this is the event to bind to:
repeatCtrl.Bind(eg.EVT_VALUE_CHANGED, OnRepeatSpin)
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: LIRC Event Receiver

Postby jinxdone » Sun Dec 16, 2007 5:31 pm

I see you made all the neccessary changes already. (svn sure is handy :))

As soon as it ships out along with the next beta i'd love to hear from anybody who can test sending some events with Lirc running on a *nix incase there are any problems with it.
User avatar
jinxdone
Plugin Developer
 
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: LIRC Event Receiver

Postby Bitmonster » Sun Dec 16, 2007 5:33 pm

jinxdone wrote:As soon as it ships out along with the next beta ....

<click><wait>......
There it is.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: LIRC Client

Postby Bitmonster » Mon Dec 17, 2007 8:38 pm

A user in the german forum has reported a problem with the LIRC plugin some time ago. If the computer goes into suspend state, the connection to the LIRC server is lost or at least doesn't work anymore. I had implemented a fix by overriding OnComputerSuspend and OnComputerResume to re-establish the connection, but this fix got lost somewhere.

I just have posted some words about the two methods here:
viewtopic.php?p=4228#p4228
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: LIRC Client

Postby jinxdone » Mon Dec 17, 2007 11:04 pm

Ok. I just committed a new version which adds handling for suspend/resume. Basically just shut down the reader on suspend and restart it on resume.

I also moved the strings used by the Send -action to it's own text class so that it shows up correctly in the translation tool.
User avatar
jinxdone
Plugin Developer
 
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: LIRC Client

Postby Bartman » Sun Dec 23, 2007 10:40 am

jinxdone wrote:Ok. I just committed a new version which adds handling for suspend/resume. Basically just shut down the reader on suspend and restart it on resume

I'm using the LIRC plugin with a IRTrans.
After resuming from Standby the plugin tells me that no remote are found and stops working. It worked fine before.
Bartman
Plugin Developer
 
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: LIRC Client

Postby jinxdone » Sun Dec 23, 2007 8:10 pm

@Bartman

It worked fine when I tested it, allthough I had it set to connect to another machine on my lan, not something running on localhost.

Probably the cause is that lirc -plugin tries to reconnect before the server is up. If you want to try a little debugging you could add a time.sleep() in there to test if it helps.

Change this bit:
Code: Select all
    def OnComputerResume(self, suspendType):
        print self.text.resumeconnection
        self.InitConnection()

To:
Code: Select all
    def OnComputerResume(self, suspendType):
        print self.text.resumeconnection
        time.sleep(4)
        self.InitConnection()
User avatar
jinxdone
Plugin Developer
 
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: LIRC Client

Postby Bartman » Tue Dec 25, 2007 8:40 am

I can try this, but I'm currently not near the computer. I was confused about the error messages about no configured remotes.
I would have expected a message about the inability to connect but I'm not familiar with the lirc protocol.
Have you thought about an option which lets the plugin try to connect every x seconds?
Bartman
Plugin Developer
 
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: LIRC Client

Postby Bartman » Tue Feb 12, 2008 9:10 pm

I had this message even on a remote machine which had a fresh reboot. I also got the same message connecting to the LIRC server (which came out of standby a few minutes before).
The events showed up fine when connecting with a telnet application.

What is reason for the "no remotes found" message? Do you issue an command to the LIRC Server and expect some kind of answer?
It also might be a flaw in the IR-Trans LIRC Server.
Bartman
Plugin Developer
 
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: LIRC Client

Postby jinxdone » Wed Feb 13, 2008 1:49 pm

Yep, It tries to do exactly that.

The reason is that it tries to fetch all remote and button/event data from the server so that you can easily use it for sending events. I attached an example of it at work.

I will add a checkbox to disable/enable this feature as disabling it should speed up the plugin startup by a few seconds if it's not supported.
Attachments
example.JPG
User avatar
jinxdone
Plugin Developer
 
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

PreviousNext

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 3 guests