View Full Version : Linux as Ethernet to serial bridge
Bjorn
07-24-2004, 10:36 PM
Hello,
I'm looking for a solution to bridge an ethernet connection
to a serial connection.
I have found a hardware solution, but haven't bought it yet.
I thought (hoped) there might be a Linux solution to the
problem, but I can't figure it out myselft.
I need to translate exactly what comes in on an ethernet to
go out to a serial port and reversed. The purpose is to
transmitt NC code from a PC to a NC machine over a long
distance.
Maybe it is not possible due to speed differences and buffer
problems but I thought I could ask.
Maybe this only requires a simple script by those who know
how to write them :-)
regards
Bjorn
Grant Edwards
07-24-2004, 10:36 PM
On 2003-12-09, Bjorn <fakeadress@home.com> wrote:
> I need to translate exactly what comes in on an ethernet to go
> out to a serial port and reversed. The purpose is to transmitt
> NC code from a PC to a NC machine over a long distance.
>
> Maybe it is not possible due to speed differences and buffer
> problems but I thought I could ask. Maybe this only requires a
> simple script by those who know how to write them :-)
netcat ought to be able to do what you want.
--
Grant Edwards grante Yow! Is this where people
at are HOT and NICE and they
visi.com give you TOAST for FREE??
Amanda L. Rossmiller
07-24-2004, 10:36 PM
hope you don't have alot of incoming ethernet traffic.
On Tue, 09 Dec 2003 14:39:30 GMT, "Bjorn" <fakeadress@home.com> wrote:
> I'm looking for a solution to bridge an ethernet connection
> to a serial connection.
http://linux.opennet.ru/base/cisco/eth_bridge.txt.html
--
/// Michael J. Tobler: motorcyclist, surfer, skydiver, \\\
\\\ and author: "Inside Linux", "C++ HowTo", "C++ Unleashed" ///
When a fellow says, "It ain't the money but the principle
of the thing," it's the money. - Kim Hubbard
James Knott
07-24-2004, 10:36 PM
Bjorn wrote:
> The purpose is to
> transmitt NC code from a PC to a NC machine over a long
> distance.
Define "long distance".
--
Fundamentalism is fundamentally wrong.
To reply to this message, replace everything to the left of "@" with
james.knott.
Bjorn
07-24-2004, 10:37 PM
Thank you for your link, but even if my russian is a bit rusty I think
this is how to configure a CISCO router to bridge from Ethernet to
Serial. Isnt' that right?
My idea was to use a low spec PC with linux to do the bridging.
/Bjorn
"mjt" <mjtobler@removethis_consultant.com> skrev i meddelandet
news:Q7nBb.7390$Ho3.3855@newsread1.news.atl.earthlink.net...
> On Tue, 09 Dec 2003 14:39:30 GMT, "Bjorn" <fakeadress@home.com> wrote:
>
> > I'm looking for a solution to bridge an ethernet connection
> > to a serial connection.
>
> http://linux.opennet.ru/base/cisco/eth_bridge.txt.html
>
> --
> /// Michael J. Tobler: motorcyclist, surfer, skydiver, \\\
> \\\ and author: "Inside Linux", "C++ HowTo", "C++ Unleashed" ///
> When a fellow says, "It ain't the money but the principle
> of the thing," it's the money. - Kim Hubbard
Bjorn
07-24-2004, 10:37 PM
With "NC machine" I mean a CNC controlled milling machine
for example. We have other milling machines that have a built in
ethernet card, but one of the machines isn't possible to upgrade.
My idea was to be able to use the same communication procedure
for all machines instead of two different.
In a Linux box I want something like
http://serial-ethernet.com/serial-ethernet/ipether232/serial-ethernet.html
Looking at the lower part of that homepage you will see a CNC
application example.
/Bjorn
"Floyd Davidson" <floyd@barrow.com> skrev i meddelandet
news:8765goci9n.fld@barrow.com...
> "Bjorn" <fakeadress@home.com> wrote:
> >Well, long distance... it's about 35m but the enviroment contains
> >lots of other noisy machinery that might disturb the signal.
> >I used a normal serial cable (shorter, 20m) before and it worked,
> >but speed wasn't so good.
> >So I want to put a Linux PC close to my NC machine with only
> >a short serial cable between them and hopefully get up to full
> >serial speed, 115Kbps.
>
> I'm not sure I've figured out yet what is being done. What is
> an "NC machine"? Does this machine *only* have serial port
> capability? And is 115Kbps the highest rate that it can work at?
>
> If that does describe what you have, then yes putting a Linux
> box next to it will allow you to run the RS-232 link at 115Kbps.
> If your environment is really obnoxious you can even use
> shielded cable if you keep the length very short. But *do* use
> cable intended for RS-232 (e.g., do *not* use twisted pair like
> CAT 5). If the cable can be less than 2m, even with shielding
> you'll be able to use 115Kbps.
>
> --
> Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
> Ukpeagvik (Barrow, Alaska) floyd@barrow.com
Floyd Davidson
07-24-2004, 10:37 PM
"Bjorn" <fakeadress@home.com> wrote:
>With "NC machine" I mean a CNC controlled milling machine
>for example. We have other milling machines that have a built in
>ethernet card, but one of the machines isn't possible to upgrade.
>My idea was to be able to use the same communication procedure
>for all machines instead of two different.
Ah. The significant point is that it can't use an ethernet card.
>In a Linux box I want something like
>http://serial-ethernet.com/serial-ethernet/ipether232/serial-ethernet.html
>Looking at the lower part of that homepage you will see a CNC
>application example.
I think you have a sound approach. Just use a computer with a
case that can be sealed up fairly tight electrically, and get
it as close to the serial port on the milling machine as you can.
With it that short, I'd go for shielded cable to start with.
The significance of cable intended for RS-232 is that it will
have thicker insulation on the individual wires, to keep them
farther appart from each other, thus there will be less
capacitive coupling between them. Don't use a cable meant for
something else.
Shielding the cable reduces the length/speed that you can use,
but improves the noise immunity.
At just a few feet, you should not have a problem at 115Kbps.
>"Floyd Davidson" <floyd@barrow.com> skrev i meddelandet
>news:8765goci9n.fld@barrow.com...
>> "Bjorn" <fakeadress@home.com> wrote:
>> >Well, long distance... it's about 35m but the enviroment contains
>> >lots of other noisy machinery that might disturb the signal.
>> >I used a normal serial cable (shorter, 20m) before and it worked,
>> >but speed wasn't so good.
>> >So I want to put a Linux PC close to my NC machine with only
>> >a short serial cable between them and hopefully get up to full
>> >serial speed, 115Kbps.
>>
>> I'm not sure I've figured out yet what is being done. What is
>> an "NC machine"? Does this machine *only* have serial port
>> capability? And is 115Kbps the highest rate that it can work at?
>>
>> If that does describe what you have, then yes putting a Linux
>> box next to it will allow you to run the RS-232 link at 115Kbps.
>> If your environment is really obnoxious you can even use
>> shielded cable if you keep the length very short. But *do* use
>> cable intended for RS-232 (e.g., do *not* use twisted pair like
>> CAT 5). If the cable can be less than 2m, even with shielding
>> you'll be able to use 115Kbps.
--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@barrow.com
James Knott
07-24-2004, 10:37 PM
Floyd Davidson wrote:
> I think you have a sound approach. Just use a computer with a
> case that can be sealed up fairly tight electrically, and get
> it as close to the serial port on the milling machine as you can.
> With it that short, I'd go for shielded cable to start with.
>
> The significance of cable intended for RS-232 is that it will
> have thicker insulation on the individual wires, to keep them
> farther appart from each other, thus there will be less
> capacitive coupling between them. Don't use a cable meant for
> something else.
>
> Shielding the cable reduces the length/speed that you can use,
> but improves the noise immunity.
>
For use over long distances or in a noisy environment, RS-442 or RS-485 are
far superior, because they use balanced pairs. Adapters are available to
convert to RS-232.
--
Fundamentalism is fundamentally wrong.
To reply to this message, replace everything to the left of "@" with
james.knott.
Helpful Observer
07-24-2004, 10:37 PM
"Bjorn" <fakeadress@home.com> wrote, variously:
|
| With "NC machine" I mean a CNC controlled milling machine,
| for example. We have other milling machines that have a built in
| Ethernet card, but one of the machines isn't possible to upgrade.
| ...
| In a Linux box I want something like
| http://serial-ethernet.com/serial-ethernet/ipether232/serial-ethernet.html
| > So I want to put a Linux PC close to my NC machine with only
| > a short serial cable between them and hopefully get up to full
| > serial speed, 115kbps.
| > ...Well, long distance... it's about 35m but the environment contains
| > lots of other noisy machinery that might disturb the signal....
Using a general-purpose machine running a general-purpose operating
system just to tunnel an asynchronous serial connection over
Ethernet/TCP/IP/Telnet is a lot of overhead.
While the "serial-ethernet" devices from "ipcas GmBH" (at the above
URL) appear, at first glance, to be uncomfortably Windows-centric to
a Linux guy, another vendor has a similar idea.
Lantronix makes several simple, little, plug-and-go products.
Several of them are intended precisely for industrial automation:
http://www.lantronix.com/products/ds/index.html
One of them can use a fiber-optic Ethernet medium for noise immunity:
http://www.lantronix.com/products/ds/coboxfliap/index.html
On the other hand, some potentially useful Linux-based software
is visible here:
http://www.linuxlots.com/~termpkg/
--
H.O.
Jim Richardson
07-24-2004, 10:38 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, 11 Dec 2003 06:42:36 GMT,
Bjorn <fakeadress@home.com> wrote:
> With "NC machine" I mean a CNC controlled milling machine
> for example. We have other milling machines that have a built in
> ethernet card, but one of the machines isn't possible to upgrade.
> My idea was to be able to use the same communication procedure
> for all machines instead of two different.
>
> In a Linux box I want something like
> http://serial-ethernet.com/serial-ethernet/ipether232/serial-ethernet.html
> Looking at the lower part of that homepage you will see a CNC
> application example.
>
Not a Linux solution, but pretty robust,
<http://www.bsicomputer.com/bsistore/aspx/accessory3.aspx?item=I/O-DE211&subcat=SERIAL%20TO%20ETHERNET%20SOLUTION>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/2S3Rd90bcYOAWPYRAlOOAKCa60izZP0Dw8MTl3yfv829rWEpEQCeMNa/
r74y8Op9yVS/41CSiLxUt2w=
=ylkG
-----END PGP SIGNATURE-----
--
Jim Richardson http://www.eskimo.com/~warlock
Rule 1: You can't cure stupid
Jimmy
07-24-2004, 10:41 PM
1 If you want to communicate between two serial ports, but utilize
Ethernet connection line, you can buy two Serial-Ethernet converters.
2 If you want to communicate between a Serial port and an Ethernet
port, you have to add a customized device and translate the message
between them.
We have a lot source code (C++ and C#) for doing this. One simple and
cheep solution is to use an x86-DOS based SBC with Serial and Ethernet
port. If you have all the protocol information about the Serial and
Ethernet part, we can make such a translation device working in few
days.
Look at the link to see more examples.
http://members.optushome.com.au/vmautomation/index.htm
Regards
vmautomation
Bjorn
07-24-2004, 10:43 PM
Thank you all for your advise
I will spend my christmas trying to get something working :-)
Have a nice holliday
/Bjorn
Lloyd Sumpter
07-24-2004, 10:46 PM
On Tue, 09 Dec 2003 14:39:30 +0000, Bjorn wrote:
> Hello,
>
> I'm looking for a solution to bridge an ethernet connection to a serial
> connection.
> I have found a hardware solution, but haven't bought it yet. I thought (hoped)
> there might be a Linux solution to the problem, but I can't figure it out
> myselft.
>
> I need to translate exactly what comes in on an ethernet to go out to a serial
> port and reversed. The purpose is to transmitt NC code from a PC to a NC machine
> over a long distance.
>
I do this kinda thing in electrical substations (can you say "electrical
interference?"). I'd recommend either fibre modems, or maybe RS485. If ethernet, I'd
still go fibre.
We almost never use a PC in our environments, and when we do, it's "industrially
hardened" and in a non-critical application.
Lloyd Sumpter
P&C Design, BCH Engineering
vBulletin v3.0.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.