Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

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\'
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #15 on: May 25, 2008, 12:00:45 PM »
Quote
Speelgoedmannetje wrote:
It doesn't work that way. On the site it's stated that the device works as a server in your network.

So there's no way for it to work unless the software knows that it is communicating with an ethernet device across a TCP/IP stack?

--
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 #16 on: May 25, 2008, 12:02:22 PM »
Quote
Speelgoedmannetje wrote:
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.

Well, the idea was to use just the Mac Mini :-( If there's no software solution for the Mac, then we might as well run the Windows software on a separate box.

I'll keep looking for equivalent Mac software. At least now I know it's definitely required. Cheers Speel.

--
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 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 #17 on: May 25, 2008, 12:12:08 PM »
Quote

motorollin wrote:
Quote
Speelgoedmannetje wrote:
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.


Well, the idea was to use just the Mac Mini :-( If there's no software solution for the Mac, then we might as well run the Windows software on a separate box.


I still have no idea what you were trying to do... but if you haven't already... get Parallels, in coherence mode it is unbelievable :-)

Quote

I'll keep looking for equivalent Mac software. At least now I know it's definitely required. Cheers Speel.


Hmmm...

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #18 on: May 25, 2008, 12:13:16 PM »
Say, Moto, you could do some programming, not? You could make such yourself. It's really not much work. I can't do it for you, unfortunately, because I don't have a mac. Maybe you could ask someone who has a mac. :-)
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 #19 on: May 25, 2008, 12:15:35 PM »
Quote

Speelgoedmannetje wrote:
Say, Moto, you could do some programming, not? You could make such yourself. It's really not much work. I can't do it for you, unfortunately, because I don't have a mac. Maybe you could ask someone who has a mac. :-)


Indeed... but first one would need to understand the problem...

Offline Speelgoedmannetje

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

bloodline wrote:
Quote

Speelgoedmannetje wrote:
Say, Moto, you could do some programming, not? You could make such yourself. It's really not much work. I can't do it for you, unfortunately, because I don't have a mac. Maybe you could ask someone who has a mac. :-)


Indeed... but first one would need to understand the problem...
Moto wants this, but then instead of running it on Windows, running it on MacOS. He asked whether this could be used directly without the OS involved.
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 #21 on: May 25, 2008, 12:22:25 PM »
@bloodline
We have Parallels and yes coherence is pretty cool. But we'd rather get it working on the Mac since AppleScript is perfect for writing the intelligence behind the system.

@speel
Yes I have done some programming, but nothing like this. It's the low-level stuff, actually capturing, manipulating and re-broadcasting the data that I struggle with.

--
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 #22 on: May 25, 2008, 12:29:27 PM »
Quote

motorollin wrote:
@speel
Yes I have done some programming, but nothing like this. It's the low-level stuff, actually capturing, manipulating and re-broadcasting the data that I struggle with.

--
moto
On the Linux side, it's a case of scripting (look for a bridging script on the internet to use as example), on the mac side I don't know, it might be as simple as changing properties of the telnet program to use TCP/IP.
Just have a look, it can be very simple. There are plenty of scripts and libraries to make your life very easy.
And if you don't understand stuff, well, we're here for you to help :-)
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 #23 on: May 25, 2008, 12:38:51 PM »
Quote

Speelgoedmannetje wrote:
Quote

bloodline wrote:
Quote

Speelgoedmannetje wrote:
Say, Moto, you could do some programming, not? You could make such yourself. It's really not much work. I can't do it for you, unfortunately, because I don't have a mac. Maybe you could ask someone who has a mac. :-)


Indeed... but first one would need to understand the problem...
Moto wants this, but then instead of running it on Windows, running it on MacOS. He asked whether this could be used directly without the OS involved.


Software that write to a serial port --> Software that encapsulates the Serial data into TCP packets --> MAC-Ethernet Port --> Ethernet wire --> Ethernet-BOX-Serial port -->Some device that wants to plug into a Serial port

Right?

Offline Speelgoedmannetje

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

bloodline wrote:

Software that write to a serial port --> Software that encapsulates the Serial data into TCP packets --> MAC-Ethernet Port --> Ethernet wire --> Ethernet-BOX-Serial port -->Some device that wants to plug into a Serial port

Right?
precisely :-)
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 #25 on: May 25, 2008, 12:44:42 PM »
Quote

Speelgoedmannetje wrote:
Quote

bloodline wrote:

Software that write to a serial port --> Software that encapsulates the Serial data into TCP packets --> MAC-Ethernet Port --> Ethernet wire --> Ethernet-BOX-Serial port -->Some device that wants to plug into a Serial port

Right?
precisely :-)


Ok then the problem is the encapsulation software... Which should be quite easy to write, as there are only two problems: It needs to fake a com port... easy enough to do with MacOSX, this is where its Unix roots show up... but we don't know the protocol that the ethernet/serial box uses... what is the format of the packets that it expects?!?

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #26 on: May 25, 2008, 12:55:53 PM »
Quote
bloodline wrote:
Software that write to a serial port --> Software that encapsulates the Serial data into TCP packets --> MAC-Ethernet Port --> Ethernet wire --> Ethernet-BOX-Serial port -->Some device that wants to plug into a Serial port

Right?

Almost :-)

Software that write to a serial port --> Software that encapsulates the Serial data into TCP packets --> MAC-Ethernet Port --> Ethernet wire --> Some device that wants to plug into an Ethernet port

I know what you're thinking - if it connects directly to the Ethernet port why not just write to it directly? Because we don't know how. And since there is already a way of writing to it using a terminal, or even using a script to write bytes to a serial port, we doing the same on the Mac would work.

--
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 #27 on: May 25, 2008, 12:57:57 PM »
Quote
Speelgoedmannetje wrote:
On the Linux side, it's a case of scripting (look for a bridging script on the internet to use as example), on the mac side I don't know,

Hmm, will look in to that! I bet the principle would be the same on the Mac since device drivers are exposed in much the same way (/dev/*)

Quote
Speelgoedmannetje wrote:
it might be as simple as changing properties of the telnet program to use TCP/IP.

Well we don't actually want to use telnet since we need it to be scriptable (input and output need to be considered).

Quote
Speelgoedmannetje wrote:
Just have a look, it can be very simple. There are plenty of scripts and libraries to make your life very easy.
And if you don't understand stuff, well, we're here for you to help :-)

Thanks :-)

--
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 #28 on: May 25, 2008, 12:59:03 PM »
Quote
bloodline wrote:
Ok then the problem is the encapsulation software... Which should be quite easy to write, as there are only two problems: It needs to fake a com port... easy enough to do with MacOSX, this is where its Unix roots show up...

Do you know how? I tried to find out how to spoof a com port but couldn't find anything.

Quote
bloodline wrote:
but we don't know the protocol that the ethernet/serial box uses... what is the format of the packets that it expects?!?

No idea. Would it help to snoop the com port under Windows and see what's being transmitted?

(Edit - I *really* need to do some revision... ;-) )

--
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 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 #29 from previous page: May 25, 2008, 01:16:38 PM »
quote]
motorollin wrote:
Quote
bloodline wrote:
Software that write to a serial port --> Software that encapsulates the Serial data into TCP packets --> MAC-Ethernet Port --> Ethernet wire --> Ethernet-BOX-Serial port -->Some device that wants to plug into a Serial port

Right?

Almost :-)

Software that write to a serial port --> Software that encapsulates the Serial data into TCP packets --> MAC-Ethernet Port --> Ethernet wire --> Some device that wants to plug into an Ethernet port
[/quote]


Ok... you've lost me again...

The device you want to use already has an ethernet port? then why bother with all this serial nonsense?

Let me try again:

Software ±±> Port : software taking to a serial port.
Software __> : Port : software taking to an Ethernet port.
Computer --> Device : connected via a serial cable.
Computer ==> Device : Connected via Ethernet.


So the basic set up would be:

Software ±±> Computer --> Device

Now you want to use Ethernet... I assumed that this was the setup:

Software ±±>Encapsulator software __> Computer ==>E2S-Box --> Device

But we are missing the Encapsulator software that wraps the data sent via serial into TCP packets to be converted back to serial data once it's reached the E2S Box...

But what you are saying is that the Device already plus into Ethernet...

Quote

I know what you're thinking - if it connects directly to the Ethernet port why not just write to it directly? Because we don't know how. And since there is already a way of writing to it using a terminal, or even using a script to write bytes to a serial port, we doing the same on the Mac would work.


So the device has both Serial an Ethernet... but you don't know how to access it via ethernet?

 Just fire up a Terminal and connect to its IP...?