Page 2 of 6
Re: LIRC Event Receiver
Posted: Sun Dec 16, 2007 2:18 am
by jinxdone
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..
Re: LIRC Event Receiver
Posted: Sun Dec 16, 2007 9:36 am
by jinxdone
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
Re: LIRC Event Receiver
Posted: Sun Dec 16, 2007 12:13 pm
by Bitmonster
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?
Re: LIRC Event Receiver
Posted: Sun Dec 16, 2007 3:34 pm
by jinxdone
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.
Re: LIRC Event Receiver
Posted: Sun Dec 16, 2007 3:41 pm
by Bitmonster
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...
Re: LIRC Event Receiver
Posted: Sun Dec 16, 2007 4:57 pm
by Bitmonster
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)
Re: LIRC Event Receiver
Posted: Sun Dec 16, 2007 5:31 pm
by jinxdone
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.
Re: LIRC Event Receiver
Posted: Sun Dec 16, 2007 5:33 pm
by Bitmonster
jinxdone wrote:As soon as it ships out along with the next beta ....
<click><wait>......
There it is.
Re: LIRC Client
Posted: Mon Dec 17, 2007 8:38 pm
by Bitmonster
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:
http://www.eventghost.org/forum/viewtop ... 4228#p4228
Re: LIRC Client
Posted: Mon Dec 17, 2007 11:04 pm
by jinxdone
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.
Re: LIRC Client
Posted: Sun Dec 23, 2007 10:40 am
by Bartman
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.
Re: LIRC Client
Posted: Sun Dec 23, 2007 8:10 pm
by jinxdone
@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()
Re: LIRC Client
Posted: Tue Dec 25, 2007 8:40 am
by Bartman
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?
Re: LIRC Client
Posted: Tue Feb 12, 2008 9:10 pm
by Bartman
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.
Re: LIRC Client
Posted: Wed Feb 13, 2008 1:49 pm
by jinxdone
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.