Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

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 on: 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...?

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #30 on: May 25, 2008, 01:23:15 PM »
Quote
bloodline wrote:
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?

Because there is no documentation on how to communicate directly over Ethernet. The documentation only tells you how to communicate with it via the virtual COM port.

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

I hoped that the ethernet to serial device would do that for us...

Quote
bloodline wrote:
But what you are saying is that the Device already plus into Ethernet...

Yes, but that doesn't help us for the reasons stated above.

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

It *only* has Ethernet, but yes, we don't know how to address it via ethernet other than via the virtual COM port which then somehow redirects to the ethernet port.

Quote
bloodline wrote:
 Just fire up a Terminal and connect to its IP...?

Tried that. Telnet in to it and get some kind of configuration console but no way of actually controlling it. SSH is rejected.

--
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 #31 on: May 25, 2008, 01:31:00 PM »
Quote

motorollin wrote:

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

I hoped that the ethernet to serial device would do that for us...



Wait... if your device has a serial port then plug it to the Mac with the USB serial port adaptors you have and write data directly to it via the /dev/xxx interface...?

Why can't I understand this? What's wrong with me? I'm going to get a drink...

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #32 on: May 25, 2008, 01:40:14 PM »
Quote
bloodline wrote:
Wait... if your device has a serial port then plug it to the Mac with the USB serial port adaptors you have and write data directly to it via the /dev/xxx interface...?

Why can't I understand this? What's wrong with me? I'm going to get a drink...

:lol:

I'll start again ;-)

The device has ONLY an Ethernet port. No serial port at all. Once it is on the network, you can telnet to it to do some config, but cannot actually control it this way.

Documentation for the device details only how to communicate with it by writing hex bytes to a serial port. Since the device doesn't actually have a serial port, you install the virtual COM port and write them to that. The virtual COM port then redirects the information to the device using TCP/IP through it's Ethernet port. This works - under Windows. I can't find any equivalent software for the Mac.

The idea of the ethernet to serial adapter was to replace the Windows software. So instead of writing hex bytes to a virtual COM port which translates them to TCP/IP and then to Ethernet, you write them to a real serial port to which you connect some hardware which encapsulates the data, and then connects to the device's Ethernet port. From what Speel said though, this won't work, which puts me back at square one looking for a way to do it in software.

I hope that makes sense - perhaps I should have been clearer to start 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 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 #33 on: May 25, 2008, 01:40:50 PM »
Quote

motorollin wrote:

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



When I started University, I decided that I had two options...

1. Spend a year Learning and cram an entire year's worth of Drinking into a single night...
2. Spend a year Drinking and cram an entire year's worth of Learning into a single night...

I decided that option 2 was much safer... ;-)

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 #34 on: May 25, 2008, 01:45:55 PM »
Quote

motorollin wrote:
Quote
bloodline wrote:
Wait... if your device has a serial port then plug it to the Mac with the USB serial port adaptors you have and write data directly to it via the /dev/xxx interface...?

Why can't I understand this? What's wrong with me? I'm going to get a drink...

:lol:

I'll start again ;-)

The device has ONLY an Ethernet port. No serial port at all. Once it is on the network, you can telnet to it to do some config, but cannot actually control it this way.

Documentation for the device details only how to communicate with it by writing hex bytes to a serial port. Since the device doesn't actually have a serial port, you install the virtual COM port and write them to that. The virtual COM port then redirects the information to the device using TCP/IP through it's Ethernet port. This works - under Windows. I can't find any equivalent software for the Mac.

The idea of the ethernet to serial adapter was to replace the Windows software. So instead of writing hex bytes to a virtual COM port which translates them to TCP/IP and then to Ethernet, you write them to a real serial port to which you connect some hardware which encapsulates the data, and then connects to the device's Ethernet port. From what Speel said though, this won't work, which puts me back at square one looking for a way to do it in software.

I hope that makes sense - perhaps I should have been clearer to start with :-)


Ok.. so what is really missing is basically the device driver software for the device... regardless of the fact that it's implemented as a virtual com port... this is simply the interface that is exposed to the controlling software....

No... you are screwed, and not in the good way :-)

You could capture the TCP/IP packets sent when issuing command and then disassemble them... but I fear that is more work than worth it... says the man who tried to run a PowerMac with no way to interface with it :-D

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #35 on: May 25, 2008, 01:46:46 PM »
Quote
bloodline wrote:
When I started University, I decided that I had two options...

1. Spend a year Learning and cram an entire year's worth of Drinking into a single night...
2. Spend a year Drinking and cram an entire year's worth of Learning into a single night...

I decided that option 2 was much safer... ;-)

Well I don't really drink, so my options are:

1. Spend a year learning
2. Spend a year doing nothing and cram an entire year's worth of learning into a single night

I've got an exam on Tuesday on the auditory system, genetic inheritance and embryological development of the head and neck. The first two I think I'm ok on, as I know the auditory system very well and genetics is all very logical anyway. Development of the head and neck is really dull, so I'm thinking of just winging it. I just feel guilty because I used revision as an excuse to get out of a tedious family event, so I feel like I really should be revising :lol:

--
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 #36 on: May 25, 2008, 01:49:46 PM »
Quote
bloodline wrote:
Ok.. so what is really missing is basically the device driver software for the device... regardless of the fact that it's implemented as a virtual com port... this is simply the interface that is exposed to the controlling software....

Yes, I suppose so.

Quote
bloodline wrote:
No... you are screwed, and not in the good way :-)

You could capture the TCP/IP packets sent when issuing command and then disassemble them... but I fear that is more work than worth it...

I agree, and it would be way above my head and too much trouble to learn if I'm honest. That's why I wanted to reproduce the Windows setup on the Mac - so I don't have to analyse what it's actually doing, just interface with it in the same way I did under Windows.

Quote
bloodline wrote:
says the man who tried to run a PowerMac with no way to interface with it :-D

I sometimes wonder what people who aren't geeks actually *do* with their lives... ;-)

--
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 #37 on: May 25, 2008, 01:52:57 PM »
Quote

motorollin wrote:
Quote
bloodline wrote:
Wait... if your device has a serial port then plug it to the Mac with the USB serial port adaptors you have and write data directly to it via the /dev/xxx interface...?

Why can't I understand this? What's wrong with me? I'm going to get a drink...

:lol:

I'll start again ;-)

The device has ONLY an Ethernet port. No serial port at all. Once it is on the network, you can telnet to it to do some config, but cannot actually control it this way.

Documentation for the device details only how to communicate with it by writing hex bytes to a serial port. Since the device doesn't actually have a serial port, you install the virtual COM port and write them to that. The virtual COM port then redirects the information to the device using TCP/IP through it's Ethernet port. This works - under Windows. I can't find any equivalent software for the Mac.

The idea of the ethernet to serial adapter was to replace the Windows software. So instead of writing hex bytes to a virtual COM port which translates them to TCP/IP and then to Ethernet, you write them to a real serial port to which you connect some hardware which encapsulates the data, and then connects to the device's Ethernet port. From what Speel said though, this won't work, which puts me back at square one looking for a way to do it in software.
Ah, if the device actually has an ethernet port, this'd make things more easy. You only need to know the protocol of that device, then. But it sounds strange to me that you can do so little with telnet :-? You must be able to do everything with telnet, because telnet is dedicated to do everything; including scripts, running programs, etcetera.
If you plug this converter to your Apple's com-port, you can attach it directly using a cross-link cable. Still, you need the protocol. But all this fuss is not necessary.
-edit-Oh, ehm and the device needs to be able to interact with the  ethernet-to-comport adapter, and since it doesn't know the protocol of that adapter, so, that's a no-go anyway.
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 #38 on: May 25, 2008, 01:55:44 PM »
Quote

motorollin wrote:
Quote
bloodline wrote:
When I started University, I decided that I had two options...

1. Spend a year Learning and cram an entire year's worth of Drinking into a single night...
2. Spend a year Drinking and cram an entire year's worth of Learning into a single night...

I decided that option 2 was much safer... ;-)

Well I don't really drink, so my options are:


I drink. Oh boy do I drink... I drink to forget... I drink to cope... I drink out of boredom... I drink out of depression... I drink out of habit... I drink because I can... I drink because I can always find an excuse to drink.

Suffice to say... I like a drink...

Quote

1. Spend a year learning


Waste of time... I've spent over 6 months learning German... and yet I'm still crap... I say learning is pointless.

Quote

2. Spend a year doing nothing and cram an entire year's worth of learning into a single night


Sounds like a good plan... and since you learned just before the Exam... you're less likely to forget it... makes sense really!! Lets crack open a beer and celebrate!

Quote

I've got an exam on Tuesday on the auditory system, genetic inheritance and embryological development of the head and neck. The first two I think I'm ok on, as I know the auditory system very well and genetics is all very logical anyway. Development of the head and neck is really dull, so I'm thinking of just winging it.


It's not that dull... you just need to find what bit is the most interesting and focus on that...

Quote

I just feel guilty because I used revision as an excuse to get out of a tedious family event, so I feel like I really should be revising :lol:


Never feel guilty about avoiding your family... you owe them nothing!!! :madashell:

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 #39 on: May 25, 2008, 02:01:18 PM »
Quote

Speelgoedmannetje wrote:
Quote

motorollin wrote:
Quote
bloodline wrote:
Wait... if your device has a serial port then plug it to the Mac with the USB serial port adaptors you have and write data directly to it via the /dev/xxx interface...?

Why can't I understand this? What's wrong with me? I'm going to get a drink...

:lol:

I'll start again ;-)

The device has ONLY an Ethernet port. No serial port at all. Once it is on the network, you can telnet to it to do some config, but cannot actually control it this way.

Documentation for the device details only how to communicate with it by writing hex bytes to a serial port. Since the device doesn't actually have a serial port, you install the virtual COM port and write them to that. The virtual COM port then redirects the information to the device using TCP/IP through it's Ethernet port. This works - under Windows. I can't find any equivalent software for the Mac.

The idea of the ethernet to serial adapter was to replace the Windows software. So instead of writing hex bytes to a virtual COM port which translates them to TCP/IP and then to Ethernet, you write them to a real serial port to which you connect some hardware which encapsulates the data, and then connects to the device's Ethernet port. From what Speel said though, this won't work, which puts me back at square one looking for a way to do it in software.
Ah, if the device actually has an ethernet port, this'd make things more easy. You only need to know the protocol of that device, then. But it sounds strange to me that you can do so little with telnet :-? You must be able to do everything with telnet, because telnet is dedicated to do everything; including scripts, running programs, etcetera.


I don't believe the device is actually being controlled via the Serial interface.
The virtual com device, is probably not just encapsulating the commands issued via serial... I expect it's is interpreting the serial commands and then issuing proprietary control packets... that would mean Telnet would not control the device.

The fact that it is controlled via virtual com device is a red herring...

Quote

If you plug this converter to your Apple's com-port, you can attach it directly using a cross-link cable. Still, you need the protocol. But all this fuss is not necessary.




Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #40 on: May 25, 2008, 02:58:27 PM »
Quote
Speelgoedmannetje wrote:
Ah, if the device actually has an ethernet port, this'd make things more easy. You only need to know the protocol of that device, then.

I will try to run a packet sniffer on the Ethernet port and have a look at the traffic. Might give some clue.

Quote
Speelgoedmannetje wrote:
But it sounds strange to me that you can do so little with telnet :-? You must be able to do everything with telnet, because telnet is dedicated to do everything; including scripts, running programs, etcetera.

Ok, well I'll have another look at the telnet services on the device just in case I missed something.

Quote
Speelgoedmannetje wrote:
If you plug this converter to your Apple's com-port, you can attach it directly using a cross-link cable. Still, you need the protocol. But all this fuss is not necessary.
-edit-Oh, ehm and the device needs to be able to interact with the  ethernet-to-comport adapter, and since it doesn't know the protocol of that adapter, so, that's a no-go anyway.

Shame - that would have made things a LOT easier.

--
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 #41 on: May 25, 2008, 03:02:32 PM »
Quote
bloodline wrote:
Suffice to say... I like a drink...

So I can see! I would probably drink a lot more if I wasn't painfully obvious of its effects...

Quote
bloodline wrote:
Waste of time... I've spent over 6 months learning German... and yet I'm still crap... I say learning is pointless.

Well, 6 months isn't enough time to learn a language, and I bet you have improved. So it's not pointless, it just takes time. But, of course you know that really ;-)

Quote
bloodline wrote:
Quote

2. Spend a year doing nothing and cram an entire year's worth of learning into a single night

Sounds like a good plan... and since you learned just before the Exam... you're less likely to forget it... makes sense really!! Lets crack open a beer and celebrate!

I can afford to forget it TBH - it's superfluous. Which makes it even more frustrating having to learn it just to get through the exam :roll:

Quote
bloodline wrote:
It's not that dull... you just need to find what bit is the most interesting and focus on that...

Well the process as a whole is fascinating, and so complex it is both beautiful and terrifying. But learning by rote which pharyngeal arches develop in to which structures and how they are innervated *is* pretty dull.

Quote
bloodline wrote:
Never feel guilty about avoiding your family... you owe them nothing!!! :madashell:

They're not even my family - they're the in-laws!

--
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 #42 on: May 25, 2008, 03:05:08 PM »
Quote
bloodline wrote:
I don't believe the device is actually being controlled via the Serial interface.
The virtual com device, is probably not just encapsulating the commands issued via serial... I expect it's is interpreting the serial commands and then issuing proprietary control packets... that would mean Telnet would not control the device.

The fact that it is controlled via virtual com device is a red herring...

Then for now I will disregard the serial aspect and concentrate on working out what is happening post-encapsulation. If I can work that out, maybe I can start thinking about a way to create those data myself. Presumably that would require low-level access to the TCP/IP stack? ("Here is a packet of data I have manually created. Send it please...")

--
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 #43 on: May 25, 2008, 03:34:13 PM »
Quote

motorollin wrote:
Quote
bloodline wrote:
I don't believe the device is actually being controlled via the Serial interface.
The virtual com device, is probably not just encapsulating the commands issued via serial... I expect it's is interpreting the serial commands and then issuing proprietary control packets... that would mean Telnet would not control the device.

The fact that it is controlled via virtual com device is a red herring...

Then for now I will disregard the serial aspect and concentrate on working out what is happening post-encapsulation.


Remember, this is just my theory... If you can Telent, that make sure you explore that avenue FULLY!!

But yes... I think the solution... if there is one, will come from examining the packets.

Quote

If I can work that out, maybe I can start thinking about a way to create those data myself. Presumably that would require low-level access to the TCP/IP stack? ("Here is a packet of data I have manually created. Send it please...")


Well, if it is a fixed function device... then you could easily build a library of packets that correspond to the commands you issue...

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #44 from previous page: May 25, 2008, 03:38:06 PM »
Quote

bloodline wrote:

Never feel guilty about avoiding your family... you owe them nothing!!! :madashell:
What have you people always against family? I love my family, and vice versa (aunts still treat me as the benjamin of the family :oops:)
And the canary said: \'chirp\'