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