Home AMX User Forum AMX General Discussion
Options

RS232 Insanity. Help!

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?
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'";
...

Comments

  • Options
    Does the Rx LED flash?

    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?
  • Options
    youstrayoustra Posts: 135
    Thanks for responding.

    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?
  • Options
    try connecting with a cable with only pins 2, 3 and 5 connected. the RS-Port of the netlinx master is not quite the same as the computers RS-Port, as the computer doesn't have RS-485/422 capability. there might be some Pin 8 or sth. connected to GND internally, which may cause communication problems in just one direction
  • Options
    youstra wrote:
    The RX doesn't flash, but it's so quick, that doesn't surprise me.

    My experience is that the Rx LED will always flash, even when receiving junk. I would guess that the cable is somehow faulty.
  • Options
    DHawthorneDHawthorne Posts: 4,584
    Though the advice to only connect pins 2,3, &5 is usually good, it is possible that this device requires hardware handshaking and a connection on 7 & 8 as well (at a minimum). The behavior described is consistent with that; a serial port on a computer provides the signals by default, even if the PC end is not requiring it.
  • Options
    ericmedleyericmedley Posts: 4,177
    DHawthorne wrote:
    Though the advice to only connect pins 2,3, &5 is usually good, it is possible that this device requires hardware handshaking and a connection on 7 & 8 as well (at a minimum). The behavior described is consistent with that; a serial port on a computer provides the signals by default, even if the PC end is not requiring it.

    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.
  • Options
    youstrayoustra Posts: 135
    First of all - thanks everyone for your ideas. No fix yet, but I have more info. I'm hoping one of you has a better grasp of the fundamentals.

    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?
  • Options
    joelwjoelw Posts: 175
    youstra wrote:
    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).

    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.
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    By default Netlinx comm ports will not receive data unless you do one of the following.

    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.
    wrote:
    I used my toolkit to jumper DTR to lite it up.
    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.
  • Options
    joelwjoelw Posts: 175
    Joe Hebert wrote:
    1) SEND_COMMAND dNetlinxSerialPort,?RXON? in the ONLINE event for dNetlinxSerialPort

    This is a good point.
    Joe Hebert wrote:
    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.

    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.
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    joelw wrote:
    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.
    And you may not require hardware handshaking for streams of continuous data as with some of the devices I?ve dealt with. As you stated it all depends on the device. When you loop back RTS/CTS on the device side it just creates an immediate self satisfying reply to a request by the device to send data. In other words, there is no way for the device side to out run me (me being the AMX side) so go ahead and send me data whenever you want, I?ll be ready for you.

    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.
    joelw wrote:
    It's not bad practice to wire for it and implement it.
    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.
  • Options
    joelwjoelw Posts: 175
    Joe Hebert wrote:
    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.
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    Hey Bill,

    Did you get comms going with the NCI? Where do you pick one of these up, Ebay?

    Thanks,
    Joe
  • Options
    youstrayoustra Posts: 135
    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.
  • Options
    Ok this is a strange one, but I got it to work.

    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.
  • Options
    GSLogicGSLogic Posts: 562
    youstra wrote:
    Joe,I think someone else has done this successfully - search the forums for NetCallerID.
    I just plugged the 9 pin pre-molded cable (only 5 pins used) that comes with the NetCallerID in the Netlinx rs232 port and it worked. Are you using a different cable?
  • Options
    There is voltage on the DTR pin of the 9-pin port, but it's not actually part of the RS232 portion of the port. I think it's TX+ on the 422 portion. Could possibly work fine forever, but I didn't want to take the chance. Jumping it to RTS assures voltage all the time.

    Kevin D.
Sign In or Register to comment.