RS232 Insanity. Help!
youstra
Posts: 135
I've never had an issue like this. I'm hoping it's just some idiotic oversight.
I have a NetCallerID (NCI) box pushing the caller id info over RS232.
When I connect hyperterm to the NCI, incoming calls show up fine.
When I connect hyperterm to Netlinx 232 port and send the same string that NCI issues, Netlinx sees it fine.
When I connect NCI box directly to Netlinx, Netlinx sees nothing. With or w/o null modem.
All protocols match (as verified by Hyperterm settings and behavior). I've tried on an NXI and NXC-COM2 port. All cables are identical in the two setups. The only add to the NCI->Netlinx setup is the null modem, and I tried 2 different ones of those.
Port init code is below - anyone have any idea what's going on?
I have a NetCallerID (NCI) box pushing the caller id info over RS232.
When I connect hyperterm to the NCI, incoming calls show up fine.
When I connect hyperterm to Netlinx 232 port and send the same string that NCI issues, Netlinx sees it fine.
When I connect NCI box directly to Netlinx, Netlinx sees nothing. With or w/o null modem.
All protocols match (as verified by Hyperterm settings and behavior). I've tried on an NXI and NXC-COM2 port. All cables are identical in the two setups. The only add to the NCI->Netlinx setup is the null modem, and I tried 2 different ones of those.
Port init code is below - anyone have any idea what's going on?
DATA_EVENT[dNetlinxSerialPort] { ONLINE: { if (bDebug) send_string 0, "'Caller ID Online'" send_command dNetlinxSerialPort,"'SET BAUD 4800,N,8,1 485 Disable'" send_command dNetlinxSerialPort, "'XOFF'"; send_command dNetlinxSerialPort, "'HSOFF'"; ...
0
Comments
Have you tried swapping the cables?
Can you see the strings in NS2 Notifications?
Have you tried using a different port on the NetLinx? Do you know that the port works?
The RX doesn't flash, but it's so quick, that doesn't surprise me.
As I said, I can send text to the Netlinx COM port from a pc with hyperterminal fine, so I can get inbound RS232 at the same protocol (4800 baud, N81, no handshake).
I've tried with different cables and COM ports on different devices (NXI and NXF-Mini).
I had been relying on debug statements, but I'll check string notifications when I'm on-site tmw.
Thanks again for your insight.
Anyone else out there have any similar experience?
My experience is that the Rx LED will always flash, even when receiving junk. I would guess that the cable is somehow faulty.
You also might have to make a jumper from pins 7,8 on the Device connection side. Some Panasonic Plasma's need this. It's the issue Dave described.
New info:
When I connect the NCI device to hyperterminal on a PC, it works fine, regardless of handshaking. I tried it w/ hyperterminal set to None, Xon/Xoff and Hardware. In each case it worked. Also, my RS232 tester showed RTS and DTR lit up when plugged into the PC side.
When connected to Netlinx, I put HSON, which lights up RTS. I used my toolkit to jumper DTR to lite it up. When the phone rings, the NCI side shows RD lit briefly (which is confusing to me since I figured it'd light TD).
I've tried a bunch of combinations, but I'm just flailing around at this point with no win. Does the hyperterminal scenario make sense to anyone? What wiring config and NXC-COM2 config would best fit the situation?
The electrical circuit must do something like this to work:
TxD -> RxD
RxD -> TxD
GND -> GND
RTS -> CTS
CTS -> RTS
Perhaps with nothing connected to the caller id box, watch with your volt meter which pin wiggles with incoming call. Then use this as the reference point for the rest of the pin out.
You most likely can safely ignore DSR and DTR. There's only a few devices I've ran across in the past 15+ years that required something on DTR to work. PictureTel 4000 CODEC, and IIRC an Elmo slide to video converter.
1) SEND_COMMAND dNetlinxSerialPort,?RXON? in the ONLINE event for dNetlinxSerialPort
2) The existence of a STRING handler in the DATA_EVENT for dNetlinxSerialPort.
3) CREATE_BUFFER in DEFINE_START
Next I would try a 3 wire setup between your PC and the NCI using only pins 2,3, and 5 as REBUID_EVENT suggested. Cross pins 2 and 3 if necessary. If you can use a 3 wire cable between your PC and the NCI then you can use that same exact cable between Netlinx and the NCI. (If you want to test to see which line is transmit and which is receive, put a volt meter between ground (pin 5 to the - of your meter) and pin 2 and then pin 3. The line that idles at around -12V or so is the transmit pin)
If you can?t get a 3 wire cable to work between your PC and the NCI then hardware handshaking will probably be needed as Dave mentioned. So far I?ve never had to actually implement hardware handshaking. If the device needed handshaking then I?ve always been able to get by by just looping back pins 7 and 8 on the device side as Eric mentioned.
The init code you originally posted looks fine.
You don?t want to do that. You can play around with the RTS and CTS lines if you want but you can?t mess with the DSR and DTR lines if you are connecting to an RS-232 device.
Let us know how it goes.
This is a good point.
RTS/CTS is very important on devices that have a small receive buffer. It depends on the device. RTS/CTS is the regulator to ensure buffer sizes are not overflowed etc. This shows up as dropped packets, intermittent communication, etc.
If you're doing simple basic string exchanges with little to no volume, you may never really require RTS/CTS.
It's not bad practice to wire for it and implement it.
Not so the other way around though. I?ll typically create a queue and throttle commands going out to the device so I don?t overrun it. Either a command does not go out until it receives a response from the previous command or there will be some minimum time between commands or something else depending on the device.
Not at all. I just haven?t run into a situation yet where I needed to. But just because I haven?t needed to doesn?t mean a darn thing. Maybe I haven?t played with the right toys. Bottom line I think is that there is no one size fits all answer.
Yep. Add it to the bag of tricks, and know when to pull it out.
Did you get comms going with the NCI? Where do you pick one of these up, Ebay?
Thanks,
Joe
Not yet - had to set it aside and move on to something else for a while. You can get the boxes for about $15 on ebay. Com worked fine on Hyperterm, but I haven't gotten it to work on AMX yet. I'm sure I'm just overlooking something. I think someone else has done this successfully - search the forums for NetCallerID.
It comes with a pre-molded serial plug on the end. If you look closely, there's only 5 pins inside,
PIN 5 GREEN GROUND
PIN 2 ORANGE RX
PIN3 WHITE TX
PIN 4 BROWN DTR
PIN 7 BLUE RTS
Playing around I found the CID box will work without RTS hooked up, but will not send anything if it does not see DTR. So the trick for shorting 7&8 or DSR & DTR together would work if there was actually anything to short to.
AMX doesn't provide DTR, but the box is only looking for voltage, not using it. So I ran the RTS wire from AMX to pins 7 & 4 on the box, and the normal 2,3, & 5.
Working great here.
Kevin D.
Kevin D.