* Re: Setup pppd over rs-485 point-to-point
2017-03-17 3:18 Setup pppd over rs-485 point-to-point Woody Wu
@ 2017-03-17 3:57 ` Mike O'Connor
2017-03-17 4:42 ` Woody Wu
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Mike O'Connor @ 2017-03-17 3:57 UTC (permalink / raw)
To: linux-ppp
On 17/03/2017 1:48 PM, Woody Wu wrote:
> Hi,
>
> I want to setup pppd to connect a Linux laptop to an embedded Linux
> device. The Linux box connected to a rs-232 to rs485 converter, then
> the convert connected via a two-wire rs-485 cable to the embedded
> Linux device's rs-485 port.
>
This generally will not work as rs-485 is half duplex, the issue is that
the switching time between transmit and receive will mean loss of data,
how ever RS-422 will work.
> On the otherhand, I can make success with similar commands when two
> devices connected with rs-232. So I guess, this failure was because
> the rs-485 is half-duplex. But I searched google, people seemed say
> pppd should work over a point-to-point rs-485 connection. So I want
> to get help from your experts.
>
I've not done any searches but I can not see how it could ever work. PPP
is a an async meaning it can transmit and receive at any time.
> Thanks in advance.
> -woody
Mike
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Setup pppd over rs-485 point-to-point
2017-03-17 3:18 Setup pppd over rs-485 point-to-point Woody Wu
2017-03-17 3:57 ` Mike O'Connor
@ 2017-03-17 4:42 ` Woody Wu
2017-03-17 5:49 ` Mike O'Connor
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Woody Wu @ 2017-03-17 4:42 UTC (permalink / raw)
To: linux-ppp
On 03/17/2017 11:45 AM, Mike O'Connor wrote:
> On 17/03/2017 1:48 PM, Woody Wu wrote:
>> Hi,
>>
>> I want to setup pppd to connect a Linux laptop to an embedded Linux
>> device. The Linux box connected to a rs-232 to rs485 converter, then
>> the convert connected via a two-wire rs-485 cable to the embedded
>> Linux device's rs-485 port.
>>
> This generally will not work as rs-485 is half duplex, the issue is that
> the switching time between transmit and receive will mean loss of data,
> how ever RS-422 will work.
>
>> On the otherhand, I can make success with similar commands when two
>> devices connected with rs-232. So I guess, this failure was because
>> the rs-485 is half-duplex. But I searched google, people seemed say
>> pppd should work over a point-to-point rs-485 connection. So I want
>> to get help from your experts.
>>
> I've not done any searches but I can not see how it could ever work. PPP
> is a an async meaning it can transmit and receive at any time.
>> Thanks in advance.
>> -woody
> Mike
>
One of the search result is this:
"http://linux-ppp.vger.kernel.narkive.com/Xcw4wgUF/ppp-over-rs-485", in
which Karthik mentioned he has success with the rs-485 point to point
connect although he still has problem with multi-drop bus. To me, I
only has interests in point-to-point and hope there exits a solution.
-woody
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Setup pppd over rs-485 point-to-point
2017-03-17 3:18 Setup pppd over rs-485 point-to-point Woody Wu
2017-03-17 3:57 ` Mike O'Connor
2017-03-17 4:42 ` Woody Wu
@ 2017-03-17 5:49 ` Mike O'Connor
2017-03-17 5:50 ` Woody Wu
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Mike O'Connor @ 2017-03-17 5:49 UTC (permalink / raw)
To: linux-ppp
Hi Woody
> One of the search result is this:
> "http://linux-ppp.vger.kernel.narkive.com/Xcw4wgUF/ppp-over-rs-485",
> in which Karthik mentioned he has success with the rs-485 point to
> point connect although he still has problem with multi-drop bus. To
> me, I only has interests in point-to-point and hope there exits a
> solution.
>
> -woody
>
Reading that post, its clear to me that the original poster was probably
not actually able to use rs485. IE he had made a mistake in testing.
Its just not going to work.
Mike
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Setup pppd over rs-485 point-to-point
2017-03-17 3:18 Setup pppd over rs-485 point-to-point Woody Wu
` (2 preceding siblings ...)
2017-03-17 5:49 ` Mike O'Connor
@ 2017-03-17 5:50 ` Woody Wu
2017-03-17 12:05 ` James Carlson
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Woody Wu @ 2017-03-17 5:50 UTC (permalink / raw)
To: linux-ppp
On 03/17/2017 01:37 PM, Mike O'Connor wrote:
> Hi Woody
>> One of the search result is this:
>> "http://linux-ppp.vger.kernel.narkive.com/Xcw4wgUF/ppp-over-rs-485",
>> in which Karthik mentioned he has success with the rs-485 point to
>> point connect although he still has problem with multi-drop bus. To
>> me, I only has interests in point-to-point and hope there exits a
>> solution.
>>
>> -woody
>>
> Reading that post, its clear to me that the original poster was probably
> not actually able to use rs485. IE he had made a mistake in testing.
>
> Its just not going to work.
>
> Mike
>
Well... it looks like there is no solution. It's bad to me, but thank
you anyway!
-Woody
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Setup pppd over rs-485 point-to-point
2017-03-17 3:18 Setup pppd over rs-485 point-to-point Woody Wu
` (3 preceding siblings ...)
2017-03-17 5:50 ` Woody Wu
@ 2017-03-17 12:05 ` James Carlson
2017-03-17 15:13 ` Michael Richardson
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: James Carlson @ 2017-03-17 12:05 UTC (permalink / raw)
To: linux-ppp
On 03/16/17 23:18, Woody Wu wrote:
> Hi,
>
> I want to setup pppd to connect a Linux laptop to an embedded Linux
> device. The Linux box connected to a rs-232 to rs485 converter, then the
> convert connected via a two-wire rs-485 cable to the embedded Linux
> device's rs-485 port.
[...]
> On the otherhand, I can make success with similar commands when two
> devices connected with rs-232. So I guess, this failure was because the
> rs-485 is half-duplex. But I searched google, people seemed say pppd
> should work over a point-to-point rs-485 connection. So I want to get
> help from your experts.
I see evidence of other problems in your trace as well. The PC is
receiving its own transmissions, which is very bad, and is the proximate
cause of the failure. It means that the converter device you're using
has local echo enabled. If there's some way to turn off local echo, you
may get a little further. Check the manufacturer's documentation for
that converter. This shouldn't happen:
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xb3a3da0c> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xb3a3da0c> <pcomp> <accomp>]
But even though that caused this failure, I don't think it's the root
problem. As another poster said, it's not going to work like this.
Two-wire TIA-485 is indeed half-duplex. There are protocols designed
for use on it (MODBUS is one example), but right in the introduction to
RFC 1661 (PPP), it says that you need full-duplex by design.
I think it would be possible to make it work on a half-duplex link, but
it wouldn't be simple or terribly efficient. The two schemes I can
imagine are:
- Use a master-slave type of relationship. This means having one end
(perhaps the PC in this case) sending some sort of signal (I suggest
using back-to-back flags; two 0x7E in a row) to let the slave side
know it should send something if it has it, or to send an empty
packet. The master then just periodically polls for data or sends
what it has.
- Use something like ALOHA or CSMA. Both of these require some means
of knowing that your transmitted message has been garbled by a
collision so that you can back off and retry. That might require
some electrical work on your part.
--
James Carlson 42.703N 71.076W <carlsonj@workingcode.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Setup pppd over rs-485 point-to-point
2017-03-17 3:18 Setup pppd over rs-485 point-to-point Woody Wu
` (4 preceding siblings ...)
2017-03-17 12:05 ` James Carlson
@ 2017-03-17 15:13 ` Michael Richardson
2017-03-19 14:40 ` Woody Wu
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Michael Richardson @ 2017-03-17 15:13 UTC (permalink / raw)
To: linux-ppp
[-- Attachment #1: Type: text/plain, Size: 788 bytes --]
Woody Wu <narkewoody@gmail.com> wrote:
> I want to setup pppd to connect a Linux laptop to an embedded Linux
> device. The Linux box connected to a rs-232 to rs485 converter, then
> the convert connected via a two-wire rs-485 cable to the embedded Linux
> device's rs-485 port.
Depending upon what you really want to do (is it run ppp? Or is it, get IP
connectivity?), you may want to look at:
https://datatracker.ietf.org/doc/draft-ietf-6lo-6lobac/
There is some userspace code out there from Carsten I think.
--
] Never tell me the odds! | ipv6 mesh networks [
] Michael Richardson, Sandelman Software Works | network architect [
] mcr@sandelman.ca http://www.sandelman.ca/ | ruby on rails [
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Setup pppd over rs-485 point-to-point
2017-03-17 3:18 Setup pppd over rs-485 point-to-point Woody Wu
` (5 preceding siblings ...)
2017-03-17 15:13 ` Michael Richardson
@ 2017-03-19 14:40 ` Woody Wu
2017-03-19 14:43 ` Woody Wu
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Woody Wu @ 2017-03-19 14:40 UTC (permalink / raw)
To: linux-ppp
On 03/17/2017 08:05 PM, James Carlson wrote:
> On 03/16/17 23:18, Woody Wu wrote:
>> Hi,
>>
>> I want to setup pppd to connect a Linux laptop to an embedded Linux
>> device. The Linux box connected to a rs-232 to rs485 converter, then the
>> convert connected via a two-wire rs-485 cable to the embedded Linux
>> device's rs-485 port.
> [...]
>> On the otherhand, I can make success with similar commands when two
>> devices connected with rs-232. So I guess, this failure was because the
>> rs-485 is half-duplex. But I searched google, people seemed say pppd
>> should work over a point-to-point rs-485 connection. So I want to get
>> help from your experts.
>
> I see evidence of other problems in your trace as well. The PC is
> receiving its own transmissions, which is very bad, and is the proximate
> cause of the failure. It means that the converter device you're using
> has local echo enabled. If there's some way to turn off local echo, you
> may get a little further. Check the manufacturer's documentation for
> that converter. This shouldn't happen:
>
> sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xb3a3da0c> <pcomp> <accomp>]
> rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xb3a3da0c> <pcomp> <accomp>]
Thank you James. I think the converter should be fine, without echo,
since I remembered before the ppp setup, I tested it with mimicom on
both devices and did not recognized any 'echo' behavior. But I like to
double check it when I come to office next Monday.
>
> But even though that caused this failure, I don't think it's the root
> problem. As another poster said, it's not going to work like this.
>
> Two-wire TIA-485 is indeed half-duplex. There are protocols designed
> for use on it (MODBUS is one example), but right in the introduction to
> RFC 1661 (PPP), it says that you need full-duplex by design.
>
> I think it would be possible to make it work on a half-duplex link, but
> it wouldn't be simple or terribly efficient. The two schemes I can
> imagine are:
>
> - Use a master-slave type of relationship. This means having one end
> (perhaps the PC in this case) sending some sort of signal (I suggest
> using back-to-back flags; two 0x7E in a row) to let the slave side
> know it should send something if it has it, or to send an empty
> packet. The master then just periodically polls for data or sends
> what it has.
Does this mean I hava to change the pppd source code or even the Linux
kernel?
>
> - Use something like ALOHA or CSMA. Both of these require some means
> of knowing that your transmitted message has been garbled by a
> collision so that you can back off and retry. That might require
> some electrical work on your part.
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Setup pppd over rs-485 point-to-point
2017-03-17 3:18 Setup pppd over rs-485 point-to-point Woody Wu
` (6 preceding siblings ...)
2017-03-19 14:40 ` Woody Wu
@ 2017-03-19 14:43 ` Woody Wu
2017-03-20 11:07 ` James Carlson
2017-03-21 3:16 ` Woody Wu
9 siblings, 0 replies; 11+ messages in thread
From: Woody Wu @ 2017-03-19 14:43 UTC (permalink / raw)
To: linux-ppp
On 03/17/2017 11:13 PM, Michael Richardson wrote:
>
> Woody Wu <narkewoody@gmail.com> wrote:
> > I want to setup pppd to connect a Linux laptop to an embedded Linux
> > device. The Linux box connected to a rs-232 to rs485 converter, then
> > the convert connected via a two-wire rs-485 cable to the embedded Linux
> > device's rs-485 port.
>
> Depending upon what you really want to do (is it run ppp? Or is it, get IP
> connectivity?), you may want to look at:
>
> https://datatracker.ietf.org/doc/draft-ietf-6lo-6lobac/
>
> There is some userspace code out there from Carsten I think.
Michael, the 6lobac you mentioned looks exactly what I needed. But it
looks a quite new standard and no a real implementation on Linux or
Windows, right?
>
> --
> ] Never tell me the odds! | ipv6 mesh networks [
> ] Michael Richardson, Sandelman Software Works | network architect [
> ] mcr@sandelman.ca http://www.sandelman.ca/ | ruby on rails [
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Setup pppd over rs-485 point-to-point
2017-03-17 3:18 Setup pppd over rs-485 point-to-point Woody Wu
` (7 preceding siblings ...)
2017-03-19 14:43 ` Woody Wu
@ 2017-03-20 11:07 ` James Carlson
2017-03-21 3:16 ` Woody Wu
9 siblings, 0 replies; 11+ messages in thread
From: James Carlson @ 2017-03-20 11:07 UTC (permalink / raw)
To: linux-ppp
On 03/19/17 10:40, Woody Wu wrote:
>
>
> On 03/17/2017 08:05 PM, James Carlson wrote:
>> - Use a master-slave type of relationship. This means having one end
>> (perhaps the PC in this case) sending some sort of signal (I suggest
>> using back-to-back flags; two 0x7E in a row) to let the slave side
>> know it should send something if it has it, or to send an empty
>> packet. The master then just periodically polls for data or sends
>> what it has.
>
> Does this mean I hava to change the pppd source code or even the Linux
> kernel?
I don't think it would necessarily require pppd source changes (though
it's possible someone might want to add an option to control the
feature), but it'd certainly require substantial kernel changes to add
the logic to do the signaling and timing elements.
--
James Carlson 42.703N 71.076W <carlsonj@workingcode.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Setup pppd over rs-485 point-to-point
2017-03-17 3:18 Setup pppd over rs-485 point-to-point Woody Wu
` (8 preceding siblings ...)
2017-03-20 11:07 ` James Carlson
@ 2017-03-21 3:16 ` Woody Wu
9 siblings, 0 replies; 11+ messages in thread
From: Woody Wu @ 2017-03-21 3:16 UTC (permalink / raw)
To: linux-ppp
On 03/17/2017 08:05 PM, James Carlson wrote:
> On 03/16/17 23:18, Woody Wu wrote:
>> Hi,
>>
>> I want to setup pppd to connect a Linux laptop to an embedded Linux
>> device. The Linux box connected to a rs-232 to rs485 converter, then the
>> convert connected via a two-wire rs-485 cable to the embedded Linux
>> device's rs-485 port.
> [...]
>> On the otherhand, I can make success with similar commands when two
>> devices connected with rs-232. So I guess, this failure was because the
>> rs-485 is half-duplex. But I searched google, people seemed say pppd
>> should work over a point-to-point rs-485 connection. So I want to get
>> help from your experts.
>
> I see evidence of other problems in your trace as well. The PC is
> receiving its own transmissions, which is very bad, and is the proximate
> cause of the failure. It means that the converter device you're using
> has local echo enabled. If there's some way to turn off local echo, you
> may get a little further. Check the manufacturer's documentation for
> that converter. This shouldn't happen:
>
> sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xb3a3da0c> <pcomp> <accomp>]
> rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xb3a3da0c> <pcomp> <accomp>]
Thank you James. I think the converter should be fine, without echo,
since I remembered before the ppp setup, I tested it with mimicom on
both devices and did not recognized any 'echo' behavior. But I like to
double check it when I come to office next Monday.
>
> But even though that caused this failure, I don't think it's the root
> problem. As another poster said, it's not going to work like this.
>
> Two-wire TIA-485 is indeed half-duplex. There are protocols designed
> for use on it (MODBUS is one example), but right in the introduction to
> RFC 1661 (PPP), it says that you need full-duplex by design.
>
> I think it would be possible to make it work on a half-duplex link, but
> it wouldn't be simple or terribly efficient. The two schemes I can
> imagine are:
>
> - Use a master-slave type of relationship. This means having one end
> (perhaps the PC in this case) sending some sort of signal (I suggest
> using back-to-back flags; two 0x7E in a row) to let the slave side
> know it should send something if it has it, or to send an empty
> packet. The master then just periodically polls for data or sends
> what it has.
Does this mean I hava to change the pppd source code or even the Linux
kernel?
>
> - Use something like ALOHA or CSMA. Both of these require some means
> of knowing that your transmitted message has been garbled by a
> collision so that you can back off and retry. That might require
> some electrical work on your part.
>
^ permalink raw reply [flat|nested] 11+ messages in thread