The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Applications (http://hintsforums.macworld.com/forumdisplay.php?f=5)
-   -   Serial Port Redirector (http://hintsforums.macworld.com/showthread.php?t=90008)

markashley 05-24-2008 02:26 PM

Serial Port Redirector
 
Hi all

Serial Port Redirectors for Windows create virtual COM ports which redirect to devices connected via Ethernet. Does anyone know if there is an equivalent for Mac OS X?

TIA
Mark

mclbruce 05-24-2008 03:08 PM

The Mac doesn't have COM ports as far as I know. It doesn't have much in the way of serial ports either, other than USB and modem ports. What kind of service do you want to redirect to a device on the Internet?

markashley 05-24-2008 03:37 PM

Well actually it's not an incoming service on a serial port. I have a piece of hardware which connects via Ethernet, and works with a serial port redirector on Windows which sets up a virtual COM port. So you can telnet to the virtual COM port and it redirects to the Ethernet device. That's what I'm trying to do on the Mac.

cwtnospam 05-24-2008 04:21 PM

What's wrong with telnet through ethernet? Have you read the man pages for telnet?

markashley 05-24-2008 04:26 PM

The telnet interface itself only seems to go to a configuration menu rather than allowing any control of the device. (telnet was given just as an example to demonstrate that the serial port is redirected to the Ethernet device) Also, I am writing an AppleScript to control the device so a terminal-based interface is not much good.

cwtnospam 05-24-2008 04:44 PM

Well then a COM port would just add another layer of complexity. You need to find out what needs to be done to control the device and do that. If not telnet, perhaps ssh?

NovaScotian 05-24-2008 05:33 PM

Mac OS X doesn't support networking over USB and it sounds like that's what you want to do.

dmaas 05-25-2008 02:53 AM

Serial Port Redirection
 
MultiCom bridges two communication ports together. The ports may be any combination of serial, TCP (client or server) and socket file (client or server). The author also has SerialParallels. This software may not be limited for use with virtual machines, but also Mac OS itself. SerialParallels connects to a socket and binds it to a real serial port ("virtual" ports work for me, too). Mac OS ususally needs a kext to bind to a port or create dev/tty.

markashley 05-25-2008 03:59 AM

@cwtnospam
It needs to be serial, as the device actually works on RS232 data. If I knew how the RS232 data were encapsulated and sent to the device then I could look in to how to replicate this and send directly to the device, but I have no idea how I would go about that. Replacing the Serial -> Ethernet software seems a more logical way of doing it.

@NovaScotian
Not networking as such. Just sending RS232 data via an Ethernet port. The data would actually go via an Ethernet port, not a USB port.

@dmaas
MultiCom looks promising. Had a quick look but couldn't figure out how to configure it. It seems to want me to select a real serial port, but I need an emulated one. Any ideas how I could go about doing this?


To clarify, this is how it works under Windows:

Software <-> virtual COM port <-> COM port redirector software <-> ethernet port <-> device

So the virtual COM port and the COM port redirector software are the components I need to implement on the Mac.

cwtnospam 05-25-2008 08:27 AM

I'm not clear on why you can telnet to the device through Windows, yet telnet from the terminal apparently connects but doesn't work. If you telnet to it from the terminal does the cursor change?

markashley 05-25-2008 08:31 AM

I can't use telnet to control the device, only configure it. The documentation for the device only details how to control it by sending hex bytes to a COM port. Since the device doesn't actually have a serial port, only Ethernet, the only way to control it is to send the hex bytes to a virtual com port which redirects, through software which presumably encapsulates it in TCP/IP, to the device's IP address. It is that software which captures the RS232 data, encapsulates it and re-transmits it, which we need to find for the Mac.

cwtnospam 05-25-2008 08:55 AM

What's the device? Perhaps you can use telnet to configure the device to communicate another way.

markashley 05-25-2008 10:07 AM

It's a home automation device. I'll check telnet again and see what can be done from there.

markashley 05-25-2008 10:14 AM

Unfortunately no control over the device via telnet :-(

cwtnospam 05-25-2008 10:18 AM

Have you tried ssh?

cwtnospam 05-25-2008 10:30 AM

This might be of some help.
http://www.macupdate.com/info.php/id/20440/serialport-x

markashley 05-25-2008 10:48 AM

It doesn't have an SSH server. Thanks for the link to SerialPort X. I am already using that to communicate with an LCD display connected to a USB serial port and it works well. I want to use it to communicate with the home automation box, but the problem is that it doesn't have a physical serial port. That's why I need a virtual one which redirects to the ethernet port.

cwtnospam 05-25-2008 11:08 AM

Well, maybe this can help.
http://www.macupdate.com/info.php/id/16590/hd-log
The problem is that PC serial com ports are so ancient that many PCs no longer even have them.

HazyJMac 05-25-2008 11:16 AM

I use some older equipment that requires the same set up. My solution was to run down to radioshack and buy a USB to Serial Port converter and use it via paralells. Works like a charm. I'm sure Boot Camp would work fine as well.

cwtnospam 05-25-2008 11:21 AM

Here's another possibility that looks promising:
http://www.macupdate.com/info.php/id/16828/c-kermit

Las_Vegas 05-25-2008 03:21 PM

Any device connected to a USB to serial port adapter could be directly communicated with using Z-Term. A very old program, but still effective.

dmaas 05-25-2008 05:59 PM

Quote:

Originally Posted by markashley (Post 471933)
@dmaas
MultiCom looks promising. Had a quick look but couldn't figure out how to configure it. It seems to want me to select a real serial port, but I need an emulated one. Any ideas how I could go about doing this?

Software <-> virtual COM port <-> COM port redirector software <-> ethernet port <-> device

So the virtual COM port and the COM port redirector software are the components I need to implement on the Mac.

Use a USB Serial Converter connected to KeySpan USB Server or something like a serial-to-Ethernet device as manufactured by www.WuT.de

If you have Parallels installed, you should already have a virtual COM Port. Else, you'd have to create one via Terminal by following this hint
http://www.macosxhints.com/article.p...30724135653825

MultiCom will then allow to Bridge the serial connection between your device and your virtual COM port
Or use interceptty with a synthax like
interceptty -q '@serial-server.example.com:4001' \
/dev/serial-server

dmaas 05-25-2008 06:39 PM

http://www.macosxhints.com/article.p...70111135928615

markashley 05-29-2008 08:02 AM

@dmaas
Could you explain in a bit more detail how that hint you linked to can be used to create a virtual serial port? That could solve all of our problems when combined with Multicom.

markashley 05-30-2008 01:46 PM

Here is the solution :)

Install socat from Darwinports. Launch socat with the following syntax:

socat GOPEN:/dev/ptyp0,ignoreeof TCP:10.0.1.93:10002

(Correct IP and port for whatever you are connecting to). Then configure application to send commands to /dev/ttyp0.


All times are GMT -5. The time now is 12:44 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.