Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
In windows redirect RS232 Serial Port traffic (in+out) to TCP port. Its possible to connect with telnet to tcp-port. Short circuit COM pin 2+3 (in+out) to do loop-back test of connection without device attached, see
del log\*.log
rem Dependent on Hub4Com
rem Hub4Com Project page and download
rem Parent com0com project page (unused)
rem some trouble-shootting that helped me:
rem set TRACE_OPTIONS=--trace-file=log\com.log --create-filter=trace,com,com --trace-file=log\tcp.log --create-filter=trace,tcp,tcp --trace-file=log\telnet.log --create-filter=trace,telnet,telnet
rem One of the log-files is always empty so my trace lines are probably not correct, but I do get both ends
set TRACE_OPTIONS=--trace-file=log\com.log --trace-file=log\comEscParsed.log --create-filter=trace,com,com --trace-file=log\tcp.log --create-filter=trace,tcp,tcp --trace-file=log\telnet.log --create-filter=trace,telnet,telnet
set TRACE_OPTIONS2=--create-filter=trace,comEscParsed,com
rem Connect with 115200, 1 stop, no parity
hub4com %TRACE_OPTIONS% --create-filter=escparse,com,parse %TRACE_OPTIONS2%--create-filter=purge,com,purge --create-filter=pinmap,com,pinmap:"--rts=cts --dtr=dsr --break=break" --create-filter=linectl,com,lc:"--br=remote --lc=remote" --add-filters=0:com --create-filter=telnet,tcp,telnet:"--comport=server --suppress-echo=yes" --create-filter=lsrmap,tcp,lsrmap --create-filter=pinmap,tcp,pinmap:"--cts=cts --dsr=dsr --dcd=dcd --ring=ring" --create-filter=linectl,tcp,lc:" --br=local --lc=local" --add-filters=1:tcp --octs=off --baud=115200 "COM1" --use-driver=tcp "*7000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.