PDA

View Full Version : PIR-1 Switch Input



jsl
May 29th, 2013, 09:45 AM
Hello,
How do you configure the switch inputs in the PIR-1. It looks like it can emulate a keyboard button press, but I don't see any action in Girder when I activate a switch that's plugged into it.
Thanks,
John

Ron
May 29th, 2013, 11:12 AM
Girder5:

pir.keyboard( "SERIAL OF YOUR PIR", key1, key2, key3, key4)

for example

pir.keyboard('64939313332351801071', 4,5,6,7)

In Girder 6 build 13 has an action that does this as well.



The numbers 4,5,6 and 7 are respectively the keys 'a','b','c' and 'd'. You can find the values for these numbers in the attached PDF. Note we are only using HID usage Page 7.

jsl
May 29th, 2013, 11:35 AM
OK - see that. Is each input stereo? I'm using a splitter, but I'm not able to activate key1 at all and key3 only when I plug the switch in.

Ron
May 29th, 2013, 12:01 PM
each input is stereo yes. So you can activate key2 and key4?

jsl
May 29th, 2013, 12:07 PM
I tested with a different splitter and I was able to get key3 (along with key2 and key4), but not key1 at all.

Ron
May 29th, 2013, 12:26 PM
Checking... I've noticed that all keys fire but 'A',.. however the PIR-1 is sending the key event to Girder. Strange...

jsl
May 29th, 2013, 12:31 PM
Another quick question: you don't detect the switch release - just the switch closure, right?

Ron
May 29th, 2013, 12:44 PM
We detect, closure, then repeat then release.

Did you see there are also Girder events being sent by the PIR-1? Are you trying to have Girder respond to the PIR-1 ? If so it might be better to use the Girder events instead of going through the keyboard presses...

jsl
May 29th, 2013, 01:06 PM
I didn't see anything until I ran the pir.keyboard function above. Now I see whatever I last set the pir.keyboard function to be. How would I clear that?

Ron
May 29th, 2013, 01:13 PM
call gir.keyboard with all zeros to stop the keyboard events.

Are you using Girder 5.1?

jsl
May 29th, 2013, 01:27 PM
I've tried it with both 5.0 and 5.1, but didn't see any difference. When I reset the function, I can see things happening in the Logger, but when I try to learn the event to trigger an action, it doesn't see anything happen.

Ron
May 29th, 2013, 01:46 PM
Might need to grab the updated PIR-1 driver from the PIR-1 product page.

jsl
May 29th, 2013, 01:59 PM
I updated the driver and it didn't seem to make a difference. For what its worth, in addition to no event learning, the little green indicators in the lower left-hand corner of the screen don't indicate any action unless I have set up something in the pir.keyboard function. Again, the Logger shows activity.

Ron
May 29th, 2013, 02:35 PM
I've updated the PIR-1 firmware. Please download IR Studio and do a web upgrade of your PIR-1. ( your PIR-1 should show revision 6 after update ) this revision sends all 4 keys correctly. )

http://www.promixis.com/forums/showthread.php?21281-PIR-1-Firmware-Update-Promixis-IR-Studio&highlight=studio

Please rerun the gir.keyboad(... ) function after the firmware update.

If you also want the button events to work download the updated PIR-1 plugin below.

Exit Girder fully.
Extract the files into the Girder plugins directory.
Restart Girder

Report the version number of the new PIR-1 plugin here. Make sure it's enabled. Now close the contacts.

jsl
May 29th, 2013, 05:08 PM
I'm getting closer. I upgraded the PIR-1 to Version 6 and with the new drivers I see all 4 inputs in the Logger. I also can learn the Event when I press the switch, however it doesn't seem that the system differentiates between the different events. For example, if I learn key1 for an action, if I activate key 3, the action is still triggered.

Ron
May 29th, 2013, 06:33 PM
Hmm that doesn't make much sense. Can you attach your gml?

jsl
May 29th, 2013, 07:15 PM
Here's a test gml with one action that is supposed to be triggered by key3. On my system all 4 keys trigger it as if it ignores the key and takes any input from the PIR.

Ron
May 29th, 2013, 07:22 PM
on the settings page of the PIR plugin, uncheck "use raw codes".

jsl
May 29th, 2013, 07:37 PM
That took care of it - everything is working great now! Thanks.

Ron
May 29th, 2013, 07:43 PM
Excellent!

jsl
June 13th, 2013, 07:57 PM
OK - I've got another issue with the PIR-1 (same PIR-1 but different PC). I'm using the Send CCF Action to learn IR codes. Sometimes when I try to learn an IR code, I can see that the hex code is being seen because it shows up in the status bar at the bottom of the Girder window, but it isn't showing up in the CCF box in the Send CCF so I can't save it. I'm using 5.0 with the 1.0.4 PIR-1 driver.
Any ideas what i have going on?
Thanks,
John

jsl
June 17th, 2013, 12:15 PM
Any thoughts?

Ron
June 17th, 2013, 12:20 PM
Did you try learning with IR Studio?

jsl
June 17th, 2013, 02:22 PM
It looks like IR Studio will pick up the signal - is there any way to copy the code into the Send CCF box automatically or do I need to copy and paste? It's strange because it only acts up sometimes. I haven't been able to figure out what makes the difference.

Ron
June 17th, 2013, 02:27 PM
I'm afraid it's copy and paste.

jsl
June 17th, 2013, 02:37 PM
Any idea why it works sometimes?

Ron
June 17th, 2013, 02:42 PM
Does IR Studio work sometimes or all the time?

jsl
June 17th, 2013, 03:06 PM
IR Studio seemed to work all of time - I just had to be careful where I positioned the remote relative to the PIR. I played around with it a little more by installing girder 5.1 over the version of 5.0 that I had been testing it with. It seems to be working more consistently. I'll keep working with it in this new setup and let you know what I find out. Thanks, John