public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: RS485 communicatio
@ 2003-03-13 16:56 Ed Vance
  2003-03-13 17:46 ` Richard B. Johnson
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Ed Vance @ 2003-03-13 16:56 UTC (permalink / raw)
  To: 'Linux PPP'; +Cc: linux-serial, 'linux-kernel'

On Wed, Mar 12, 2003 at 10:15 PM, linuxppp@indiainfo.com wrote:
> Hi all,
> am currently working on PPP over serial interface (RS485) in 
> linux 2.4.2-2. I believe RS485 half duplex system and hence 
> only one can transmit at a time. And for RS485 we basicaly 
> use Master-Slave or Primary-Secondary kind of communication. 
> I don't know how to achieve the same using PPP since i need 
> to have max of 10 nodes connected via serial interface. I 
> tested with two nodes using PPP daemon it works fine. 
> Following are the commands i issued
> 
> In PPP server: 
> $usr/sbin/pppd -detach crtscts 10.10.10.100:10.10.10.101 
> 115200 /dev/ttyS0 &
> 
> In PPP client side : 
> $/usr/sbin/pppd call ppp-start 
> where ppp-start file is copied into directory /etc/ppp/peers/ 
> that had the following
> 
> -detach /dev/ttyS0 115200 crtscts
> noauth
> 
> This point to point communication worked fine with RS485 
> interface. If i had to connect one more node what i need to 
> do. Please clarify with the following 
> 
> i) Whether the existing pppd takes care of the RS485 with 
> multi node , if so how do i manage giving commands
> ii) If there is no direct support how do i go ahead. Is there 
> any other layer 2 protocol allows me to acheive TCP/IP 
> communicattion over RS485 which is my ultimatum.
> 
> I will be grateful if anybody of them could help me with my 
> current problem.
> 

I believe Point-to-Point Protocol only supports point-to-point symmetric
links. Don't think there is any multi-point support in the protocol. IIRC,
PPP also requires a full duplex link, which is not available on an RS-485
link with more than two stations, even if it is a 4-wire link. 

I don't know of an easy way around this fundamental limitation.

Maybe somebody on the kernel list has a suggestion.

Cheers

---------------------------------------------------------------- 
Ed Vance              edv (at) macrolink (dot) com
Macrolink, Inc.       1500 N. Kellogg Dr  Anaheim, CA  92807
----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 20+ messages in thread
* RE: RS485 communication
@ 2003-03-17  5:41 Cigol C
  2003-03-20 23:09 ` Robert White
  0 siblings, 1 reply; 20+ messages in thread
From: Cigol C @ 2003-03-17  5:41 UTC (permalink / raw)
  To: cfowler, rwhite
  Cc: EdV, 'Linux PPP', linux-serial, 'linux-kernel'


Thannks for the info. Can i acheive IP over RS485 if i use SOCK_PACKET. I need some more info on this if u could provide that. If this option is set in the socket call will i have an option the choose the hardware interface.

----- Original Message ----- 
From: Chris Fowler 
Date: 15 Mar 2003 10:42:53 -0500 
To: Robert White 
Subject: RE: RS485 communication 

> I think using SOCK_PACKET an an ethernet chip may be the best choice. 
> You can use IP or you can use RWP (Rober White Protocol). 
> 
> 
> On Sat, 2003-03-15 at 03:07, Robert White wrote: 
> > Yes, that, but that is only part of it. 
> > 
> > The RS485 is a proper bus, so this custom program (or programs) will have to 
> > act as full bus arbiters and a kind of router. Each PPP daemon must receive 
> > ONLY the data that its peer daemon transmits. That means that each slave 
> > must know to ignore the data not destined for it. Further, the master, 
> > which would have multiple PPP instances running on it, will need to decide 
> > which of those instances get which of the receiving bytes. 
> > 
> > So just like an Ethernet transceiver puts a protocol frame around the data 
> > to get it to the destination, the transport program will have to put 
> > envelopes around the data. THEN the master transport program will tell each 
> > slave when and how many of its envelopes it may send. The only way that can 
> > work (because there is no "ring" you can't pass a "token") is for the master 
> > to ask each slave in turn: "Got anything to send?" 
> > 
> > This usually devolves to a sequence of "#1, say your piece", "#2 say your 
> > piece" etc. That is a very bad performance model. 
> > 
> > So every frame of data will need to be arbitrarily wide, meaning a length 
> > code, and will need an in-multiplexor address. 
> > 
> > So the master, for instance, will say "slave 1, go". The slave 1 will send 
> > a packet (not necessarily a PPP packet, as the multiplexor will have 
> > overhead data etc.) 
> > 
> > The master will look at the address and decide which local pty the data is 
> > for and send it there. (Think a simple byte pump here) 
> > 
> > When that pty has response data, and when the master says "slave 0 (e.g. me) 
> > go" it will frame a message that slave #1 will receive and put through to 
> > its local pty. Slave 1 also has the job of ignoring data for slaves 2 
> > through N and the Master (Slave 0). 
> > 
> > In short, he has to write a distributed application that pumps data into and 
> > out of a broadcast medium, and makes sure that each participant gets only 
> > the data intended for itself. (This is what both the Ethernet hardware 
> > layer, and the IP protocols do.) 
> > 
> > In communications you almost always put protocols inside of protocols to 
> > some significant depth. 
> > 
> > For instance, when you play Unreal Tournament 2003: 
> > Unreal Tournament's data is carried by UDP, 
> > The UDP is carried by IP, 
> > The IP is carried by the Ethernet hardware access layer (raw Ethernet), 
> > Those packets may go to your cable modem which either wraps the Ethernet 
> > hardware packets or decodes them and reencodes the IP into whatever it 
> > does. 
> > 
> > >From there, if your cable modem is doing PPPoE there are even more layers. 
> > 
> > This guy will only have to write a multiplexing layer, but it won't be fun. 
> > 
> > Then again, the Ethernet people have done all that, which is why it is 
> > cheaper and easier to just get the Ethernet hardware and use it. 
> > 
> > Rob. 
> > 
> > -----Original Message----- 
> > From: Chris Fowler [mailto:cfowler@outpostsentinel.com] 
> > Sent: Thursday, March 13, 2003 3:31 PM 
> > To: Robert White 
> > Cc: Ed Vance; 'Linux PPP'; linux-serial@vger.kernel.org; 'linux-kernel' 
> > Subject: RE: RS485 communication 
> > 
> > 
> > Are you saying that for him to to use PPPD that he will have to write a 
> > program that will run on a master and tell all the slave nodes when they 
> > can transmit their data. In this case it would be ppp data. Hopfully 
> > in block sizes that are at least the size of the MTU ppp is running. 
> > 
> > Chris 
> > 
> 
> 
> - 
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in 
> the body of a message to majordomo@vger.kernel.org 
> More majordomo info at http://vger.kernel.org/majordomo-info.html 
-- 
______________________________________________
http://www.indiainfo.com
Now with POP3/SMTP access for only US$14.95/yr

Powered by Outblaze

^ permalink raw reply	[flat|nested] 20+ messages in thread
* RS485 communication
@ 2003-03-24 11:43 Cigol C
  2003-03-25  3:23 ` Paul Mackerras
  0 siblings, 1 reply; 20+ messages in thread
From: Cigol C @ 2003-03-24 11:43 UTC (permalink / raw)
  To: linux-serial, linux-ppp; +Cc: redhat-ppp-list, linux-kernel

Hi all,
Regarding RS485 communication I thank all of them for their responses. I finally decided to write a custom Layer 2 char driver or protocol to pave way for my IP over RS485 communication. I will like to get some inputs/docs/references on linux-ppp implementation. ISo am in the process of browsing the PPP code and exploring the interface it has with the serial driver which is crucial for me. Regarding this I request for more clarity on following: 
i) Linux PPP interface with IP: Registration, Packet send/receive/close
ii) Linux PPP interface with serial driver:Registration, Packet send/receive/close
iii) Linux PPP server configuration and initial sequence of working. i.e. associating a IP address with serial device and ppp0

I will be grateful if somebody could help me on this.
Thanks and Best Regards
Karthik
-- 
______________________________________________
http://www.indiainfo.com
Now with POP3/SMTP access for only US$14.95/yr

Powered by Outblaze

^ permalink raw reply	[flat|nested] 20+ messages in thread
[parent not found: <20030324143723.11625.qmail@indiainfo.com>]

end of thread, other threads:[~2003-03-25  3:13 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-13 16:56 RS485 communicatio Ed Vance
2003-03-13 17:46 ` Richard B. Johnson
2003-03-13 22:54 ` RS485 communication Robert White
2003-03-13 23:30   ` Chris Fowler
2003-03-15  8:07     ` Robert White
2003-03-15 15:42       ` Chris Fowler
2003-03-15 12:46     ` David Woodhouse
2003-03-16  0:56       ` Alan Cox
2003-03-16 10:05         ` David Woodhouse
2003-03-16 10:35           ` Russell King
2003-03-16 10:51             ` David Woodhouse
2003-03-15 19:46 ` RS485 communicatio Pavel Machek
2003-03-16 19:57   ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2003-03-17  5:41 RS485 communication Cigol C
2003-03-20 23:09 ` Robert White
2003-03-20 23:17   ` Chris Fowler
2003-03-21  2:48     ` Robert White
2003-03-24 11:43 Cigol C
2003-03-25  3:23 ` Paul Mackerras
     [not found] <20030324143723.11625.qmail@indiainfo.com>
2003-03-24 16:41 ` Joachim Franek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox