From: Cigol C <linuxppp@indiainfo.com>



Procedure for installing the rs485 Driver in Linux
--------------------------------------------------

i) First untar the ip_over_rs485.tgz using command `tar xvzf ip_over_rs485.tgz` in your working directory.
ii) Now issue  `locate modversions.h` for locating the modversions.h file in the source directory. Typically for
 a 2.4.2-2 kernel the output is as follows:
/usr/include/linux/modversions.h
/usr/src/linux-2.4.2/include/linux/modversions.h
iii) Now open the Makefile and change the location of modversions.h to `/usr/src/linux-2.4.2/include/linux/modve
rsions.h` and source include as `/usr/src/linux-2.4.2/include`. Note for different kernel source directory make appropriate change.
iv)After successful compilation check whether rs485.o object file is created.
v)Issue setserial -a in root mode to get the irq and iobase details of your serial port.
Ex `/bin/setserial -a /dev/ttyS0`
vi) For iobase=0x3f8 and irq = 4 issue insmod commad as show below in the slave terminal.
`/sbin/insmod -mv rs485.o iobase=0x2f8 irq=4 nodeid=1`
For master node id is 0. Check with `/sbin/lsmod` whether the module rs485.o is loaded.
vii) The whole idea of this driver is to create an interface ip for each master-slave interface since rs485
supports only half duplex communication. Hence the next step is to associate an ip and point to point ip
address for master-slave communication.
viii) In master by default from rs00 - rs14 interfaces are created. From rs01 interfaces can be used for
point to point communiation between slaves. Use ifconfig to associate point to point ip address on rs01.
For ex:
`ifconfig rs01 10.4.7.177 pointopoint 10.4.7.176`
ix) In slave do the same and set an IP address on rs00.
For ex:
`ifconfig rs00 10.4.7.176 pointopoint 10.4.7.177`
Note the point to point IP address is the IP address of the other.
x) Issue `/sbin/ifconfig -a` to verify the interface commands issued.
Ex:

#/sbin/ifconfig rs00
rs00      Link encap:Serial Line IP
          inet addr:190.4.7.177  P-t-P:190.4.7.176  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP  MTU:150  Metric:1
          RX packets:17277 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17257 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10


Do the same is master and verify the results.
xi) Now your done with interface configuration and start IP applications to check the IP over Rs485.
For ex:Issue ping command
`ping 10.4.7.177` in the slave terminal for checking the connection.

Please contact the following address for any feedbacks.
Author:Ronald Schmidt
Address:Ronald Schmidt <ronsc@ronsc.de>

