Jul 23rd, 2014, 4:00pm
   FabulaTech Forum
   Serial Port Solutions
   Serial Port Splitter
(Moderators: Andrew, InnaWhite, George_White)
   Proper Configuration
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Print Print
   Author  Topic: Proper Configuration  (Read 912 times)
kelangfei
FabulaTech Forum Newbie
*





   
View Profile

Gender: male
Posts: 3
Proper Configuration
« on: Oct 18th, 2007, 2:43pm »
Quote Quote Modify Modify

My application is infrared pc remote control, the output of which not only will control the pc but will also send out infrared signals to control any infrared capable device from the pc. To this end I have cobbled together a chain of software and hardware components the latest, and very crucial of which is Serial Splitter.  
 
First a short technical picture then my questions about Serial Splitter.  
1. Home brew IR receiver built as per the specs of Alessio Sangalli of lnx.manoweb.com. Attached to the serial port using DCD RST and GND pins of a straight thru subd9 cable.
2. Winlirc attached to COM1 on the PC to decode individual remote control button pushes. It appears to be the only software capable of reliable decoding, my home brew effort not withstanding.  
3. AutoHotkey to tie the decoded button presses to any software on the pc.  
4. Custom PHP software invoked by autohotkey to write data to COM1 sending that data to a PIC chip via the TX and GND pins of the same cable as #1. GND is shared. The PIC is mounted on a breadboard right now and conrols 3 LEDs just to prove that the signal gets there. The effect of all this is to make it appear that I can control a computer peripheral with an IR remote control.  Therefore, theoretically by extension, when I reprogram the PIC and replace the LEDs with an infrared transmitter or RF transmitter I should be able to control any infrared  or RF device I choose from the PC. (Surely someone else has already done this a more efficient manner)
 
Currently Authotkey is being tied in to marry Winlirc to the PHP application.  
 
Serial Splitter is required because it solves the problem of contention for COM1 between Winlirc and the PHP application.  I want only one cable because, ultimately, the IR receiver and (IR or RF) transmitter will be housed together in one convenient unit.
 
Hope the above was not to windy. Now the Serial Splitter questions.  
Within Serial Splitter COM1 is set to 2400 baud, 8 bits, no parity, 1 stop bit, no flow control. This matches the PHP application setting which must agree with the PIC capability, limited right now by a 4 mhz oscillator. Winlirc is optimized  at 115000 baud. It seems that sharing COM1 is the best choice.  I tried the "split serial ports" option but my PHP application would not recognize the virtual COM. Is that an appropriate choice? Should I have rebooted after setting up the virtual COM? Also, between Winlirc and PHP should I start the program with the lower baud rate first. I had what appeared to be contention problems  when I started Winlirc before PHP.  
In summary I don't know how to optimize Serial Splitter.
 
That's enough for now. Thanks in advance for the time you have taken to read this.
 
K
IP Logged
Andrew
FabulaTech Forum Moderator
FabulaTech Forum Senior Member
*****






   
View Profile WWW

Gender: male
Posts: 427
Re: Proper Configuration
« Reply #1 on: Oct 19th, 2007, 3:31am »
Quote Quote Modify Modify

Hi,
Thanks for such detailed information.
OK, both features "Split" and "Share" provides the same functionality (almost the same). "Split" feature is more flexible.
For example, if you share COM1, the first application opens COM1 and configure it (baudrate, flow control and so on). Then the second application opens COM1 but it's not allowed to configure port settings. Only first one can accomplish that.
Also only first application controls like DTR and RTS. The second application is not allowed to control them. So that's why you need to choose carefully, which application to start first,  Winlirc or PHP.
 
But if you use "Split" feature, you can specify exactly what port will control signals. I don't know why PHP doesn't see virtual COM ports. They appears as usual serial ports for applications. Please try to use the smallest numbers of virtual COM ports (e.g. split COM1 to virtual COM2 and virtual COM3). Then use COM2 by PHP and COM3 by Winlirc.
 
Please let me know results.
 
Thanks!
IP Logged

Andrew Scott

FabulaTech
===================
http://www.fabulatech.com
kelangfei
FabulaTech Forum Newbie
*





   
View Profile

Gender: male
Posts: 3
Re: Proper Configuration
« Reply #2 on: Oct 20th, 2007, 2:38pm »
Quote Quote Modify Modify

Hello Andrew:
 
Great response time on your part!!
 
Here are my findings after a few hours of testing.  
 
In share mode the PHP piece works well.  
 
In split mode the PHP piece works for one iteration then the virtual COM is tied up. At this point I cannot disable Serial Splitter or remove the ports even when there are no tasks running and no processes active which are using COM1.  I have checked and rechecked the program code (only a few lines - don't want to do anything very complicated at this point) to make sure the COM port is being closed after each iteration.  I have used a few different approaches and always it is PHP which fails and puts a lock on the COM port. There's much research for me to do here.  
 
As far as the button sensitivity issue is concerned, under sharing, multiple (2-4) button presses are needed before Winlirc recognizes the signal whereas with Serial Splitter disabled Winlirc is consistently very sensitive.
 
You would think, from my description, I am very dissatisfied with Serial Splitter  but that is far from the case. I have tested many other serial splitter softwares and none comes close to achieving for my particular situation what Serial Splitter does. I still have 12 days left on my trial before I have to make a decision. What works now is satisfactory to ME but would not be satisfactory if I should want to bundle this application up for commercial purposes.
 
I cannot, of course, render a verdict at this point.   I've never worked with serial port development before so there's still a lot to understand. There are too many variables in my area of responsibility to point fingers with surety. Most notable of these are the laptop I am running the application on, the nature of PHP and the handheld remote that I am using. Replacing any of those three with something else may make a world of difference.  
 
Thanks for your help. I'll let you know my progress.
 
K
IP Logged
Andrew
FabulaTech Forum Moderator
FabulaTech Forum Senior Member
*****






   
View Profile WWW

Gender: male
Posts: 427
Re: Proper Configuration
« Reply #3 on: Oct 21st, 2007, 12:57pm »
Quote Quote Modify Modify

Hi Kelangfei!
 
Thanks for reply.
First of all, we are highly interested in resolving that issue.
So, let's see what happens on COM ports.
Could you please reproduce the issue in "Split" configuration, but launch PortMon before, and we'll see serial traffic.
 
http://www.microsoft.com/technet/sysinternals/utilities/portmon.mspx
 
Please use the following portmon setting:
Edit -> Max Output Bytes -> 1024
Options -> Show Time [x]
Options -> Show Hex [x]
Options -> Clock Time [ ]
 
1) Launch portmon
2) Configure Portmon to capture data from physical COM port and both virtual COM ports: Capture -> Ports -> COM1, COM2, COM3
3) Reproduce issue
4) Save log file and send us to support at fabulatech
 
Thanks!
IP Logged

Andrew Scott

FabulaTech
===================
http://www.fabulatech.com
kelangfei
FabulaTech Forum Newbie
*





   
View Profile

Gender: male
Posts: 3
Re: Proper Configuration
« Reply #4 on: Oct 21st, 2007, 6:21pm »
Quote Quote Modify Modify

Andrew -  
 
Sorry to spoil your investigation but I have found the solution. Port monitor showed the php program issuing a command to the operating system setting the parameters of the com3 port. It suddenly dawned on me that I should be setting the parameters to com1 (or maybe this command is not necessary altogether since Serial Splitter has already done it). I changed the command to the operating system to set the parameters for com1 and left the open statement pointing to com3. Works perfectly and it even appears that the button sensitivity on the hand held remote is better. It appears that split is a better solution than share but both work.  
 
I am posting this solution on the forum in the remote possibility that it will be useful to someone else.  
 
K
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Print Print

« Previous topic | Next topic »