Welcome, Guest. Please login or register.

Author Topic: Connecting Ethernet device to serial port  (Read 6492 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Connecting Ethernet device to serial port
« on: May 24, 2008, 10:16:52 PM »
I've got a device which connects via Ethernet, and then has software which emulates a serial port and bridges the virtual serial port to the ethernet device. You then send commands to the virtual serial port and they are received by the ethernet device.

The software is only for Windows, and I want to use it with a Mac. Unfortunately I can't find an equivalent. I do, however, have a couple of USB serial ports which work on the Mac. Does anyone know whether those Ethernet to Serial adapters which allow networking through a serial port would allow me to communicate with the ethernet device through a real serial port?

Here is a link to the COM port redirector software for Windows if it helps.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #1 on: May 24, 2008, 10:33:45 PM »
Seems all right to me, PC side has serial emulation, and RS232 is RS232, there's not much fuss about that. You only have to know the baud rate, start/stop bits, parity and whether it uses XON/XOFF.
RS232 on wikipedia
And the canary said: \'chirp\'
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Connecting Ethernet device to serial port
« Reply #2 on: May 24, 2008, 10:39:22 PM »
Quote

motorollin wrote:
I've got a device which connects via Ethernet, and then has software which emulates a serial port and bridges the virtual serial port to the ethernet device. You then send commands to the virtual serial port and they are received by the ethernet device.

The software is only for Windows, and I want to use it with a Mac. Unfortunately I can't find an equivalent. I do, however, have a couple of USB serial ports which work on the Mac. Does anyone know whether those Ethernet to Serial adapters which allow networking through a serial port would allow me to communicate with the ethernet device through a real serial port?

Here is a link to the COM port redirector software for Windows if it helps.

--
moto


I honestly can't follow that you are trying to do here!!!


MacUSB-->Serial-->Ethernet-->Serial-->Some Device


 :-?

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #3 on: May 25, 2008, 08:54:02 AM »
@speel
Wouldn't it depend on what that software is doing? Presumably it wraps the RS232 commands inside Ethernet packets. Are you quite sure a hardware device would do something similar?

@bloodline
The original way (under Windows) is:

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

We need to do:

Software <-> real serial port <-> ethernet to serial adapter (hardware) <-> device

So what I don't know is whether the ethernet to serial adapter will carry out the same functions on the RS232 data as the COM port redirector software. Sure the RS232 data within might be the same, but it may be encapsulated differently.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #4 on: May 25, 2008, 09:28:19 AM »
Quote

bloodline wrote:
Quote

motorollin wrote:
I've got a device which connects via Ethernet, and then has software which emulates a serial port and bridges the virtual serial port to the ethernet device. You then send commands to the virtual serial port and they are received by the ethernet device.

The software is only for Windows, and I want to use it with a Mac. Unfortunately I can't find an equivalent. I do, however, have a couple of USB serial ports which work on the Mac. Does anyone know whether those Ethernet to Serial adapters which allow networking through a serial port would allow me to communicate with the ethernet device through a real serial port?

Here is a link to the COM port redirector software for Windows if it helps.

--
moto


I honestly can't follow that you are trying to do here!!!


MacUSB-->Serial-->Ethernet-->Serial-->Some Device


 :-?
Program wants to communicate with Com port device -> OS device driver transforms it into ethernet packages -> being send to ethernet to com device -> which transforms it to rs232 communication with the com port device.
And the canary said: \'chirp\'
 

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #5 on: May 25, 2008, 09:34:24 AM »
Quote

motorollin wrote:
@speel
Wouldn't it depend on what that software is doing? Presumably it wraps the RS232 commands inside Ethernet packets. Are you quite sure a hardware device would do something similar?
RS232 is mainly a hardware protocol. A software protocol for RS232 would be something like kermit, or telnet. And I'm indeed quite sure it can handle it. It's all pretty straight-forward. It explicitly uses windows, which has a software layer for RS232 communication. So, with this layer, any communication system can be used, as long as a 1on1 communication stream can be established.
And the canary said: \'chirp\'
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #6 on: May 25, 2008, 09:58:23 AM »
@speel
Sounds good. If I understand you (and I might not - I'm at the edge of my knowledge about this stuff) if it works with kermit/telnet, which wrap RS232 commands in Ethernet, then it will work with a hardware adapter, which takes the RS232 data from a real port and wrap it in Ethernet before re-broadcasting it. Right?

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #7 on: May 25, 2008, 10:51:06 AM »
Quote

motorollin wrote:
@speel
Sounds good. If I understand you (and I might not - I'm at the edge of my knowledge about this stuff) if it works with kermit/telnet, which wrap RS232 commands in Ethernet, then it will work with a hardware adapter, which takes the RS232 data from a real port and wrap it in Ethernet before re-broadcasting it. Right?

--
moto
Kinda, except that RS232 doesn't have commands, since it's an hardware layer. Let's say, a program asks windows to send this or that data over the serial port. The program lets Windows send it over TCP/IP to the dedicated device (which has a dedicated IP adress, which the program is aware of). This device has a com port of it's own, and sends the data over a null-modem to the device.
And the canary said: \'chirp\'
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #8 on: May 25, 2008, 10:53:40 AM »
Would the application need to know the IP address if the conversion is done in hardware? What I mean is, if the serial <-> Ethernet converter has its own TCP/IP stack and DHCP server (some do) then couldn't it receive raw RS232 data destined for a serial port from an app with no knowledge of the IP address, and then package it up and send it to the IP address it allocated to the Ethernet device?

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #9 on: May 25, 2008, 11:00:49 AM »
Quote

motorollin wrote:
Would the application need to know the IP address if the conversion is done in hardware? What I mean is, if the serial <-> Ethernet converter has its own TCP/IP stack and DHCP server (some do) then couldn't it receive raw RS232 data destined for a serial port from an app with no knowledge of the IP address, and then package it up and send it to the IP address it allocated to the Ethernet device?

--
moto
It doesn't receive raw RS232 data, since it's TCP, so that means it's in packages. I guess this program uses it's own IP port and it's own protocol 'inside' TCP/IP.
If it'd be done the way you say, it'd send the data to the very first router your computer is connected to, and this router discards the data because it doesn't recognise it as TCP/IP data.
And the canary said: \'chirp\'
 

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #10 on: May 25, 2008, 11:15:54 AM »
Btw. May I be so free to ask what you'll be using it for?
And the canary said: \'chirp\'
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #11 on: May 25, 2008, 11:22:04 AM »
Now I'm really confused... I'm not talking about connecting the Ethernet device through a router or any other kind of intranet. Just a cat5 cable going directly from the Ethernet device in to the serial adapter, then a serial cable from the other side of the adapter to the serial port of the computer.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #12 on: May 25, 2008, 11:33:23 AM »
Quote
Speelgoedmannetje wrote:
Btw. May I be so free to ask what you'll be using it for?

It's a home automation device which connects via Ethernet. As I said the software for Windows sets up a virtual serial port which you can connect to directly using hyperterminal or use software like HomeSeer. The virtual COM port automatically redirects to the device connected via Ethernet (but you have to tell it the correct IP address).

Since this software doesn't work on the Mac, I want to replace it with hardware. I have a USB RS232 port, so just need a device which will connect to it and have an Ethernet port to which I can connect the home automation hardware, allowing me to send the same commands I would type in to hyperterminal on the PC to the Mac's serial port.

--
moto

Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #13 on: May 25, 2008, 11:38:30 AM »
Quote

motorollin wrote:
Now I'm really confused... I'm not talking about connecting the Ethernet device through a router or any other kind of intranet. Just a cat5 cable going directly from the Ethernet device in to the serial adapter, then a serial cable from the other side of the adapter to the serial port of the computer.

--
moto
It doesn't work that way. On the site it's stated that the device works as a server in your network.
And the canary said: \'chirp\'
 

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #14 on: May 25, 2008, 11:50:06 AM »
Quote

motorollin wrote:
Quote
Speelgoedmannetje wrote:
Btw. May I be so free to ask what you'll be using it for?

It's a home automation device which connects via Ethernet. As I said the software for Windows sets up a virtual serial port which you can connect to directly using hyperterminal or use software like HomeSeer. The virtual COM port automatically redirects to the device connected via Ethernet (but you have to tell it the correct IP address).

Since this software doesn't work on the Mac, I want to replace it with hardware. I have a USB RS232 port, so just need a device which will connect to it and have an Ethernet port to which I can connect the home automation hardware, allowing me to send the same commands I would type in to hyperterminal on the PC to the Mac's serial port.

--
moto

hm, you WILL need a specific program on your mac to redirect the serial data to TCP/IP data. But maybe you could configure the hyperterminal in such a way, that it can communicate over TCP/IP. Then you can use a simple PC with a com port and linux installed on it, and let iptables 'bridge' all incoming data (TCP/IP data stripped) to the com-port, and all com-port data be send to your own computer.
And the canary said: \'chirp\'