gclib  307
Communications API for Galil controllers and PLCs
 All Data Structures Files Functions Variables Typedefs Macros Pages
fedora.md
1 # Fedora Linux {#fedora}
2 
3 ##Tested versions
4 
5 See the \link installation \endlink page for supported versions.
6 
7 
8 ##Installation
9 On Fedora, gclib is distributed in an RPM repository. The following steps can be performed to install gclib.
10 
11 ### Download Galil's repository information
12 
13 * Point a browser at http://www.galil.com/sw/pub/fedora/galilrpm-1-1.noarch.rpm and install the rpm.
14  * This step installs Galil's RPM repositories and only needs to be done once.
15 
16 <!--- sudo wget http://www.galil.com/sw/pub/fedora/galil.repo -O /etc/yum.repos.d/galil.repo -->
17 
18 ### Install Package
19 Install gclib package, approve "Installed size" and "Importing GPG key", if prompted.
20 
21  $ sudo yum install gclib
22 
23 ### Uninstall Package
24 To uninstall gclib.
25 
26  $ sudo yum remove gclib
27 
28 ##Installed files
29 * The gclib shared object files
30  * /usr/lib/libgclibo.so
31  * /usr/lib/libgclib.so
32 * The gclib header files
33  * /usr/include/gclib_errors.h
34  * /usr/include/gclibo.h
35  * /usr/include/gclib.h
36  * /usr/include/gclib_record.h
37 * gclib documentation tarball
38  * /usr/share/doc/gclib/gclib_129_doc.tar.gz
39 * Example source tarball
40  * /usr/share/doc/gclib/src/gclib_129_examples.tar.gz
41 * Source files to modify/rebuild libgclibo.so
42  * /usr/share/doc/gclib/src/gclibo_129_src.tar.gz
43 * GalilTools Communication Library (gcl) wrapper
44  * /usr/share/doc/gclib/src/gclib_129_gcl.tar.gz
45 * PCI driver files
46  * /usr/share/doc/gclib/src/gclib_129_pci.tar.gz
47 
48 
49 
50 ##Serial Ports and USB
51 If access to the serial ports or USB (e.g. DMC-4103) is desired through gclib, the following will provide steps to join the correct access group. If using USB, be sure the controller is powered and the usb is plugged in before beginning.
52 
53 ###Determine group with access
54 
55  $ ls -l /dev/ttyUSB* /dev/ttyS*
56  crw-rw----. 1 root dialout 4, 64 Mar 3 16:39 /dev/ttyS0
57  crw-rw----. 1 root dialout 4, 65 Mar 3 16:39 /dev/ttyS1
58  crw-rw----. 1 root dialout 4, 66 Mar 3 16:39 /dev/ttyS2
59  crw-rw----. 1 root dialout 4, 67 Mar 3 16:39 /dev/ttyS3
60  crw-rw----. 1 root dialout 188, 0 Mar 6 11:08 /dev/ttyUSB0
61 
62 In the above listing, **dialout** is the group that needs to be joined. **uucp** is another common group that may be listed.
63 
64 ###Add the desired *username* to the group.
65 
66  $ sudo gpasswd -a username dialout
67  [sudo] password for username:
68  Adding user username to group dialout
69 
70 Log out and back in for change to take effect.
71 
72  $ groups
73  username wheel dialout
74 
75 gclib can now connect to serial and usb devices from user *username*.
76 
77 ##PCI Controllers
78 If using a Galil PCI controller, the PCI driver must be installed.
79 
80 ###Install prerequisites
81 
82  $ sudo yum install kernel-devel-$(uname -r)
83  $ sudo yum install kernel-headers-$(uname -r)
84  $ sudo yum install gcc
85 
86 ###Extract source and build driver
87 
88  $ tar -xf /usr/share/doc/gclib/src/gclib_202_pci.tar.gz
89  $ make
90 
91 ###Copy module and add to kernel
92 
93  $ sudo cp galilpci.ko /lib/modules/$(uname -r)
94  $ sudo depmod
95  $ sudo modprobe galilpci
96 
97 ###Add galil group for access to PCI
98 
99  $ sudo groupadd -f -K GID_MIN=100 -K GID_MAX=499 galil
100  $ sudo cp 90-galilpci.rules /etc/udev/rules.d/
101  $ sudo udevadm control --reload-rules
102  $ sudo udevadm trigger
103  $ sudo usermod -a -G galil username #exchange "username" with actual user's name
104 
105 Logout and back in. The PCI hardware is now available for access.
106 
107  $ ls -l /dev/galil*
108  crw-rw---- 1 root galil 10, 56 Jun 9 11:07 /dev/galilpci0
109  $ echo -e "\x12\x16\r" > /dev/galilpci0
110  $ cat /dev/galilpci0
111  DMC1846 Rev 1.1a
112  :
113 
114 ##Documentation
115 The documentation is left as a tarball to minimize disk usage. The latest release version of the user manual is available at the following link.
116 * http://www.galil.com/sw/pub/all/doc/gclib/html/
117 
118 ###Offline pdf
119 The following allows viewing of the pdf docs from the installation.
120 
121  $ tar -xzf /usr/share/doc/gclib/gclib_132_doc.tar.gz gclib_132.pdf
122  $ evince gclib_132.pdf
123 
124 ###Offline html
125 The following allows viewing of the html docs from the installation.
126 
127  $ tar -xzf /usr/share/doc/gclib/gclib_132_doc.tar.gz html
128  $ firefox html/index.html