PDA

View Full Version : Can the PIR-1 do this?



Mugsy
October 13th, 2013, 04:05 PM
(Please excuse me if this question is in the wrong place.)

I'm looking at purchasing a PIR-1 to control a TV from across the room. My needs are simple: Use the computer to change channels and turn the TV on/off using a Task Scheduler.

I don't need to control the PC itself via remote, and I don't need to control anything other than the TV.

Except for the USB cable, this needs to be wireless. No "extender" wire going from the PIR-1 to the TV's IR sensor. And it needs to be easy to program (I plan to just send CLI commands from the Windows Task Scheduler or possibly write a VB app.)

And of course... Does the PIR-1 come with software to learn my existing IR remote?

Thx.

Ron
October 13th, 2013, 06:11 PM
If the line of sight isn't blocked you can do that with the PIR-1 and the PIR-1 plain "C" SDK (SDK available from our site for free) You can learn using the Free IR Studio, available from this forum.

Distance varies with the device under control. I have some pieces that I can control from 50 feet away (pointing accurately).

Mugsy
October 14th, 2013, 06:29 AM
Great, thanks. I placed my order this morning.

I need to control a wall-mounted TV in a hospital room for my mother, who is currently paralyzed.

Ron
October 14th, 2013, 07:07 AM
Thank you for your order. It will ship today.

dan_miles86
November 9th, 2013, 06:45 PM
I'm in the same situation as Mugsy, my PIR-1 just arrived. I'm finding running the cmd line a bit slow on repeat; is their any examples of how to use the SDK in VB? I don't think I'm clever enough to work out how to wrap pir-1.h for VB to be able to understand it, and likewise not smart enough to write the how app in C.

Mugsy
November 10th, 2013, 05:30 AM
Hey Dan, not sure if I can help, but give me some info on what it is you're trying to do and I'll give it a shot.

The provided C++ source code simply creates the Command Line app that you already find "too slow", so I don't think rewriting the code will make much of a difference. You can't transmit codes any faster than the software already does.

dan_miles86
November 11th, 2013, 03:22 PM
Hi Mugsy,

This issues is i'm using the Shell command in VBA to run the command line for each IR code I want to send. The delay is in launching and initializing the separate application for every time.

I can see in main.cpp that it includes the pir-1.h file, to send a command it calls pir_open, pir_sendCCF then pir_close.

What I don't understand is how (if at all) I can call these directly from VB, removing the need to shelling the command line all the time.

Thanks,

Dan.

Mugsy
November 11th, 2013, 04:22 PM
Is there a particular reason you are using VBA?

Depending upon what you are trying to do, for me, the solution was simply to create BATch files that are simply called by a scheduling program (the built-in Windows Scheduler doesn't always work with bat files.)

Example (saved as "num01.bat". I renamed the exe as "pirlib.exe"):

rem Send "1"
pirlib 3 3 "0000 0049 0000 001A 00E0 00E3 001B 0072 001B 0072 001B 0072 001B 0072 001B 0039 001B 0039 001B 0072 001B 0072 001B 0039 001B 0039 001B 0039 001B 0072 001B 0039 001B 0039 001B 0039 001B 0039 001B 0072 001B 0072 001B 0039 001B 0039 001B 0072 001B 0072 001B 0072 001B 0039 001B 01C0"
Which is the same as pressing the "1" button on my remote.

dan_miles86
November 11th, 2013, 05:05 PM
I'm trying to use a IIS server running VB ASPX pages to act as a remote control.

Therefore each page controls the devices in each room and can be navigated to by any web-enabled device. A lot of devices I'm using are RS232 so these have been no problem; however some are IR only hence the need for this.

Calling the command line works for individual commands like turning on the TV because there is an inherent delay in the TV turning on which is longer than the time taken the for command line to finish. However it comes unstuck when changing the volume for example. To get from full volume to 0 I would need to send 100 volume down commands meaning the command line would have to fully execute 100 times....

I find it a bit mad that the examples are C++ as I'm sure most amateur/home developers are much more at home in VB!

Ron
November 11th, 2013, 06:52 PM
The examples are in plain C so that any other language can consume it.

I believe all the info you might need should be on these pages:
http://msdn.microsoft.com/en-us/library/26thfadc%28VS.100%29.aspx
http://msdn.microsoft.com/en-us/library/ac7ay120.aspx
http://msdn.microsoft.com/en-us/library/fzhhdwae.aspx


I'm happy to help with this as much as I can.

dan_miles86
November 16th, 2013, 04:56 PM
Thanks for the response Ron.

Unfortunately its not making a great deal of sense to me!

I don't suppose you know any any examples that have been created or even any chance of getting an VB template added to the SDK?!

Ron
November 18th, 2013, 07:29 AM
I'll see what I can do however we currently don't have much free development time. So I'm not sure when I'll be able to squeeze it in.

dan_miles86
November 18th, 2013, 07:35 AM
Thanks Ron :)

I'm sure it would be of help to many others as well; there seems to be lots of people using the USB UIRT with VB so I'm sure some would switch to the PIR if there is a VB example.

Ron
November 18th, 2013, 07:38 AM
You're welcome.