Connecting to external RS-232 device via UART #101
Replies: 9 comments 12 replies
-
Neat! I'm not sure which chip the official serial extension will use, but if it's the ever-so-common MAX3232, then the software for it will be merged in shortly. To that end, the infrastructure around extension boards will be introduced fairly soon, so that'll tell us a lot more about how the JetKVM team expect us to interact with the UART port. There hasn't been much investigation into the extension port and it's infrastructure yet, mostly waiting to see what the official implementation looks like. |
Beta Was this translation helpful? Give feedback.
-
I don't think the software would know or care if it's a MAXx232 or something else - it'd just be talking to a serial port, no? I don't disagree that it should become clearer when the software gets released, but if we're itchy in the meantime.... @MaffooClock, the other thing you could try (before or after verifying your adapter) would be to connect the RS232 side of it to a known-working RS232 port (could be a USB adapter) on a PC with a terminal emulator (minicom, PuTTY, etc). When you have it working, anything you send on the JetKVM side should appear in the terminal (and vice-versa) |
Beta Was this translation helpful? Give feedback.
-
For testing your custom cable, if you just jumper the TX and RX pins together (on the RS232 side), do you see anything? Whatever terminal app you're using will have to disable hardware flow control. (there's no CTS/RTS/etc pins). |
Beta Was this translation helpful? Give feedback.
-
Welp, tested my custom TTL to RS-232 cable -- worked perfectly. One of the tests included the JetKVM, of course, and I can confirm that The problem: the TX and RX pins on the "Chinesium KVM" are labeled backwards 🙄. Oh, and the baud rate is 115200, for anyone who cares. And now, sending Next step: learning some Go and adding a way to dispatch these command from the web UI. If I build this right, it would be compatible with the plugin system discussed in #9 (and related pull request #10), and be configurable so the user can specify how many inputs are available and what the associated serial command would be. |
Beta Was this translation helpful? Give feedback.
-
For what it's worth to anyone that might want it, I've whipped up a simple script to make it easy. I'm going to guess that this will work for any serial-connected external KVM manufactured by KCEVE (just set the #!/bin/sh
NUM_INPUTS=10
PORT=/dev/ttyS3
BAUD=115200
### Make sure the input number was supplied
if [ $# -ne 1 ]
then
echo "Usage: $0 <input>"
exit 1
fi
### Check that the argument is an integer
echo "$1" | grep -Eq '^-?[0-9]+$'
if [ $? = 1 ]
then
echo "Invalid argument: $1"
exit 1
fi
### Check that the argument is within range
if [ "$1" -lt 1 ] || [ "$1" -gt "$NUM_INPUTS" ]
then
echo "Input out of range: $1"
exit 1
fi
### Check if the serial port is already set to the correct baud (and set it if not)
stty -F $PORT | grep -q $BAUD
if [ $? = 1 ]
then
stty -F $PORT $BAUD
fi
### Convert integer to hex (in case we have more than 9 inputs)
I=$(printf "%X\n" $1)
### Send it!
echo "X${I},1\$" > $PORT For my purposes, having an SSH terminal open while I access the JetKVM web UI will satisfy my requirements to remotely view and control any of the 9 hosts connected to my external KVM. But I would like to see if I can add a component in the web UI to make it even easier... |
Beta Was this translation helpful? Give feedback.
-
Thanks for doing the legwork on this. I actually bought the parts to put together a UART to RS232 cable a few weeks ago but I've been too busy to actually put it all together. Glad it worked for you since this is what I wanted to do myself. |
Beta Was this translation helpful? Give feedback.
-
Hi @MaffooClock Can you post the final table with the actual working pin out please? |
Beta Was this translation helpful? Give feedback.
-
Update:I haven't tinkered with my JetKVM device in a while (I've used it and my Bash script via SSH, but no development), but I have been installing dev-channel updates as they become available. I wanted to report that the built-in Serial Console functionality in the web UI has been working for sending commands to my external KVM (connected with the custom cable I built). Not sure which one of the updates I've installed over the past few months gave me this ability, I only noticed it today. I just click the >_ Open Console button, then type the KVM command into the console that appears: So for anyone wanting to use JetKVM with an external KVM, and you have a serial connection between them, you can use this built-in feature to send the serial commands. The only issue I've had so far (app v0.4.1, sys v0.2.4) is sometimes the serial console will not take keyboard focus no matter what I click on (the WebRTC interface has it and is sending all keystrokes to the connected host). I have to click the Hide button to dismiss the serial console, re-open it, then I can use it again. But I know this is all still under heavy development, so it's not a complaint. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your work on this @MaffooClock I am having a terrible time with a particular network appliance. I guess you have updated the table to reflect your comments, has the photo been updated too? The reason I ask is it looks like there are no cables in pin 1 & 2? clip facing down and going from left to right? I also have the same chip and ordered from Amazon UK so wondering if I have the same issue, I order the same chip from a couple other sources just to test. Although my end goal might be different, but what im trying to do is make a RJ12 > MAX3232 > RJ45 Console connection. I have confirmed that on my network device from testing with a multimeter, pins 1 and 2 are at 9.8v and pin 3 at -9.8v. 4 and 5 are GND. To me these are certainly RS232 voltages. So im suspecting 3 is TX. This is the diagram provided by the vendor attached I have an eczoo and TEsmart switch and will also be giving these a go with the jetKVM. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I realize this product is in its infancy and not all features are present, and not all code and schematics have been made open-source yet, so I'm probably getting ahead of things, but...
I'm tinkering with using the extension port to communicate with an external KVM (manufactured of questionable Chinese quality by KCEVE) that supports switching inputs via serial control. My ultimate goal is to use the JetKVM to effectively convert the "standard" KVM into an IPKVM. The final solution will offer buttons in the web UI that I can click to switch the input on the external KVM.
I built a simple serial cable with a 6P6C RJ-11 and a MAX3232 transceiver, using the 3.3V on pin 4 to drive the MAX3232.
Here's the wiring:
While poking around the OS on the JetKVM, I see three
tty
devices:Note
22 May 2025: If you're new to this discussion, skip down to this comment.
I assume
ttyS3
is the UART pins on the Extension Port. Runningstty -F /dev/ttyS3 -a
shows that it's already set to a typical 9600/8/n/1, so it appears that I don't need to set anything (except maybe the baud, but I have no clue what the external device expects, so this is a decent start).The serial device on the other end expects commands like
X3,1$
orXA,1$
to switch inputs (input 3 or 10, respectively, for example). Seems easy enough. So the actual command I'm sending, escaped, is:Well, nothing happens. So, there must be a problem in one of these points: 1. Maybe `ttyS3` isn't the right device 2. I'm not formatting the message correctly 3. Wrong baud rate (this might be Try 'n' See™ until I figure out the right speed, as there is no documentation that I could find) 4. I got the TTL or RS-232 RX/TX backwards on the MAX3232 5. The manufacturer's command documentation is incorrect, or the TX/RX labels on the physical port are backwards 6. I'm missing something else and I'm not smart enough to think of itProbably the first thing to do would be to test my custom TTL to RS-232 cable -- I could use a Raspberry Pi for that:
So, no point in messing with the JetKVM until I perform the test on my custom cable. But meanwhile, I figured I'd start this discussion in case anyone might have some insight, or for anyone else interested in this who might want to follow along.
Beta Was this translation helpful? Give feedback.
All reactions