So I have an issue that I can't really think of a reason why it would be happening. I have an Arduino Mega connected on Serial3 to a RS232 breakout board with a male DB9 connector on it. I then have two female breakout boards connected. One is connected to the RS232 breakout board and the other to a Cisco DB9 to roll over cable, which is connected to my Cisco Switch, or if it is, it is being ignored.

For some reason no data sent from the Arduino is making it to the Cisco switch that I can tell. I did confirm that it is sending data using a USB to DB9 adapter and PUTTY. I can send and receive data from both the Arduino and PUTTY correctly to the other.

I can receive data from the switch perfectly. Cisco's default settings are the same as the Arduino's, 9600, 8bits, no parity, 1 stop bit etc...

I can also connect the switch to the USB to DB9 adapter directly and send and receive fine through it / PUTTY as well.

Does anyone have any suggestions why I'd be able to send data to and from Putty, but only receive data from the switch, or why the data going to the switch is failing?

Arduino Setup

void setup() {
  Serial.begin(9600, SERIAL_8N1);
  Serial3.begin(9600, SERIAL_8N1);

void loop() {
  // read from Serial3, write to Serial
  if (Serial3.available()) {
    int inByte = Serial3.read();
  // read from Serial, write to Serial3
  if (Serial.available()) {
    int inByte = Serial.read();
  Serial3.println(); // Added just to test if a cr could be passed
  Serial3.write(98); // Added just to test if a character could be directory passed
  Serial3.write(10); // Added just to test if a cr could be passed
  • Consider in band verses out of band flow control.
    – st2000
    Oct 15 '16 at 13:22
  • Is there such a thing as inb vs oob for a serial console connection? This isn't on the internal network of the switch in any way but the console port. Oct 15 '16 at 16:01
  • Ug, I can't answer in the comments as I'm running out of characters... See my Answer. We'll just have to change the Answer to match the actual problem once you solve it later...
    – st2000
    Oct 15 '16 at 16:18
  • It seems you have demonstrated that the Arduino is transmitting, so this is more likely a fit for a networking equipment site than the Arduino one. Looking at line ending cases was a good idea, you might look there a little more, or make sure you are using the same putty or Arduino serial monitor settings in both the PC-switch test and the PC-Arduino-switch experiment, ie, don't use putty for one and the serial monitor for the other. Oct 15 '16 at 16:38
  • Of course your "Added just to test" would break any meaningful traffic by inserting these extra characters between those of the intended message, and if the source data is keeping the PC-Arduino link full potentially make the Arduino-switch one fall behind. Presumably you also tried without those llines. Oct 15 '16 at 16:41

Assuming this is a flow control problem:

Is there such a thing as inb vs oob for a serial console connection? This isn't on the internal network of the switch in any way but the console port

It assumed this is a managed switch and the traffic on the console port has nothing to do with the traffic going through the switch. Rather this is likely a port to the computer inside the switch. Such a port might be able to use RTS/CTS/DSR or X-on / and X-off.

If this is a flow control problem, consider first looking for thumb switches on the back of the switch to see if the method used for flow control over the console port can be selected. If that is not possible, consider simply hardwiring the out of band flow control pins to always allow for data to flow. At 9600 baud, a dedicated Aruidno should be able to keep up.

Refer to the 9 pin connector in this chart to find the out of band flow control pins.

  • This is unlikely to be the answer. Flow control usually means the receiver allowing, or impeding the transmitter. An Arduino ignorant of it would transmit blindly, and there's little reason why a switch not heavily burdened by previous traffic from the Arduino would be trying to suspend incoming data. In the other direction, if the switch where looking for flow control inputs it wouldn't send, but it apparently is is sending. Oct 15 '16 at 16:35
  • Good point. So what do you think? Cross over cable confusion? Like switching Rx & Tx or DTE & DTC? Maybe a difference in the EOL (End Of Line) character? Could be that Putty is tolerant of different EOL characters and works with both while they don't work with each other?
    – st2000
    Oct 15 '16 at 17:20
  • Swapped wiring seems unlikely given that something is allegedly received from the switch. In terms of line endings, it would not be the terminal program's "tolerance" but rather what it transmits. If the same terminal program is used for both tests that should not be the issue either, but we don't know that the same program was used for both the direct and arduino-in-the-middle tests. Oct 15 '16 at 17:30
  • Yeah I don't think this is what I need but thank you for the reply. Also these switches don't have anything like that on the back, you change all the serial connection settings on the switch itself when you are connected to it, but this needs to work with stock switch settings to be useful for what I need. Very few people every change these settings on Cisco routers and switches since they usually just use console to configure network settings, and then all times after that connect with telnet or ssh. Oct 15 '16 at 19:32

Could be a voltage problem. You're using an TTL->RS232 Adapter as far as I can tell from the picture, which is absolutely necessary. Arduino only gives out TTL Signal Level, which would not be "understood" by the Cisco Switch, which works on RS232 / Serial Voltage Level (which is a lot higher). However, maybe the RS232 Converter Module is faulty. You could check the output voltage level with a Multimeter and see if it actually is in the required range (http://www.radio-electronics.com/info/telecommunications_networks/rs232/signals-voltages-levels.php).

Also connecting ground correctly is important, but that should be ok on your setup :).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.