gclib  437
Communications API for Galil controllers and PLCs
rhel7.md
1 # Red Hat 7 & CentOS 7 Linux {#rhel7}
2 
3 ##Tested versions
4 
5 This version of Linux has **x64/AMD64 Support Only**. Contact Galil if another version
6 is required for an application.
7 
8 See the \link installation \endlink page for supported versions.
9 
10 ##Installation
11 On Red Hat, gclib and \link gcaps \endlink are distributed in RPM repositories. The following steps can be performed to install.
12 
13 ### Download Galil's repository information
14 
15 Point a browser at http://www.galil.com/sw/pub/rhel/7/galilrpm-4-1.noarch.rpm and install the rpm.
16 This installs Galil's RPM repositories and can be done from the terminal with the following.
17 
18  $ wget http://www.galil.com/sw/pub/rhel/7/galilrpm-4-1.noarch.rpm
19  # rpm -Uvh galilrpm-4-1.noarch.rpm
20 
21 ### Install Packages
22 #### Install gclib
23 
24  # yum install gclib
25 
26 Approve "Installed size" and "Importing GPG key", if prompted.
27 
28 #### Install gcaps (optional)
29 
30 Following Linux's daemon naming conventions, gcaps is called *gcapsd* on Red Hat.
31 See the \link gcaps \endlink documentation for more information.
32 
33  # yum install gcapsd
34 
35 Verify that the systemd unit is running.
36 
37  $ systemctl is-active gcapsd
38  active
39 
40 ### Uninstall Packages
41 
42 If the packages need to be removed from the system, the following commands may be used.
43 
44 #### Uninstall gclib
45 
46  # yum remove gclib
47 
48 #### Uninstall gcaps
49 
50  # yum remove gcaps
51 
52 ##Serial Ports and USB
53 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.
54 
55 ###Determine group with access
56 
57  $ ls -l /dev/ttyUSB* /dev/ttyS*
58  crw-rw----. 1 root dialout 4, 64 Mar 3 16:39 /dev/ttyS0
59  crw-rw----. 1 root dialout 4, 65 Mar 3 16:39 /dev/ttyS1
60  crw-rw----. 1 root dialout 4, 66 Mar 3 16:39 /dev/ttyS2
61  crw-rw----. 1 root dialout 4, 67 Mar 3 16:39 /dev/ttyS3
62  crw-rw----. 1 root dialout 188, 0 Mar 6 11:08 /dev/ttyUSB0
63 
64 In the above listing, **dialout** is the group that needs to be joined. **uucp** is another common group that may be listed.
65 
66 ###Add the desired *username* to the group.
67 
68  $ sudo gpasswd -a username dialout
69  [sudo] password for username:
70  Adding user username to group dialout
71 
72 Log out and back in for change to take effect.
73 
74  $ groups
75  username wheel dialout
76 
77 gclib can now connect to serial and usb devices from user *username*.
78 
79 ##PCI Controllers
80 If using a Galil PCI controller, the PCI driver must be installed.
81 
82 ###Install prerequisites
83 
84  # yum update kernel
85 
86 ####Reboot
87 
88  # yum install kernel-devel-$(uname -r)
89  # yum install kernel-headers-$(uname -r)
90  # yum install gcc
91 
92 ###Extract source and build driver
93 
94  $ tar -xf /usr/share/doc/gclib/src/gclib_pci.tar.gz
95  $ make
96 
97 ###Copy module and add to kernel
98 
99  # cp galilpci.ko /lib/modules/$(uname -r)
100  # depmod
101  # modprobe galilpci
102 
103 ###Add galil group for access to PCI
104 
105  # groupadd -f -K GID_MIN=100 -K GID_MAX=499 galil
106  # cp 90-galilpci.rules /etc/udev/rules.d/
107  # udevadm control --reload-rules
108  # udevadm trigger
109  # usermod -a -G galil username #exchange "username" with actual user's name
110 
111 Logout and back in. The PCI hardware is now available for access.
112 
113  $ ls -l /dev/galil*
114  crw-rw---- 1 root galil 10, 56 Jun 9 11:07 /dev/galilpci0
115  $ echo -e "\x12\x16\r" > /dev/galilpci0
116  $ cat /dev/galilpci0
117  DMC1846 Rev 1.1a
118  :
119 
120 ##Documentation
121 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.
122 * http://www.galil.com/sw/pub/all/doc/gclib/html/
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_doc.tar.gz html
128  $ firefox html/index.html