gclib  386
Communications API for Galil controllers and PLCs
 All Data Structures Files Functions Variables Typedefs Macros Pages
ubuntu.md
1 # Ubuntu Linux {#ubuntu}
2 
3 
4 ##Tested versions
5 
6 This version of Linux has **x64/AMD64 Support Only**. Contact Galil if another version
7 is required for an application.
8 
9 See the \link installation \endlink page for supported versions.
10 
11 
12 ##Installation
13 ###Create a temporary variable for Ubuntu version
14 
15  $ uver=$(lsb_release -r | cut -f 2); echo $uver
16  16.04
17 
18 ###Install Galil's public certificate
19 
20  $ wget http://www.galil.com/sw/pub/ubuntu/$uver/GALIL-PUB-KEY
21  # apt-key add GALIL-PUB-KEY
22 
23 ###Get Galil's apt sources list
24 
25  # wget http://www.galil.com/sw/pub/ubuntu/$uver/galil.list -O /etc/apt/sources.list.d/galil.list
26  # apt-get update
27 
28 ###Install Package
29 
30 ####Install gclib
31 
32  # apt-get install gclib
33 
34 #### Install gcaps on 16.04 and better (optional)
35 
36 Following Linux's daemon naming conventions, gcaps is called *gcapsd* on Ubuntu.
37 See the \link gcaps \endlink documentation for more information.
38 
39  # apt-get install gcapsd
40 
41 Verify that the systemd unit is running.
42 
43  $ systemctl is-active gcapsd
44  active
45 
46 ###Uninstall Package
47 
48 If the packages need to be removed from the system, the following commands may be used.
49 
50 ####Uninstall gclib
51 
52  # apt-get remove gclib
53 
54 ####Uninstall gcaps
55 
56  # apt-get remove gcapsd
57 
58 ##Serial Ports and USB
59 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.
60 
61 ###Determine group with access
62 
63  $ ls -l /dev/ttyUSB* /dev/ttyS*
64  crw-rw----. 1 root dialout 4, 64 Mar 3 16:39 /dev/ttyS0
65  crw-rw----. 1 root dialout 4, 65 Mar 3 16:39 /dev/ttyS1
66  crw-rw----. 1 root dialout 4, 66 Mar 3 16:39 /dev/ttyS2
67  crw-rw----. 1 root dialout 4, 67 Mar 3 16:39 /dev/ttyS3
68  crw-rw----. 1 root dialout 188, 0 Mar 6 11:08 /dev/ttyUSB0
69 
70 In the above listing, **dialout** is the group that needs to be joined. **uucp** is another common group that may be listed.
71 
72 ###Add the desired *username* to the group.
73 
74  $ sudo gpasswd -a username dialout
75  [sudo] password for username:
76  Adding user username to group dialout
77 
78 Log out and back in for change to take effect.
79 
80  $ groups
81  username wheel dialout
82 
83 gclib can now connect to serial and usb devices from user *username*.
84 
85 ##PCI Controllers
86 If using a Galil PCI controller, the PCI driver must be installed.
87 
88 ###Extract source and build driver
89 
90  $ tar -xf /usr/share/doc/gclib/src/gclib_pci.tar.gz
91  $ make
92 
93 ###Copy module and add to kernel
94 
95  $ sudo cp galilpci.ko /lib/modules/$(uname -r)
96  $ sudo depmod
97  $ sudo modprobe galilpci
98 
99 ###Add galil group for access to PCI
100 
101  $ sudo groupadd -f -K GID_MIN=100 -K GID_MAX=499 galil
102  $ sudo cp 90-galilpci.rules /etc/udev/rules.d/
103  $ sudo udevadm control --reload-rules
104  $ sudo udevadm trigger
105  $ sudo usermod -a -G galil username #exchange "username" with actual user's name
106 
107 Logout and back in. The PCI hardware is now available for access.
108 
109  $ ls -l /dev/galil*
110  crw-rw---- 1 root galil 10, 56 Jun 9 11:07 /dev/galilpci0
111  $ echo -e "\x12\x16\r" > /dev/galilpci0
112  $ cat /dev/galilpci0
113  DMC1846 Rev 1.1a
114  :
115 
116 ##Documentation
117 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.
118 * http://www.galil.com/sw/pub/all/doc/gclib/html/
119 
120 ###Offline html
121 The following allows viewing of the html docs from the installation.
122 
123  $ tar -xzf /usr/share/doc/gclib/gclib_doc.tar.gz html
124  $ firefox html/index.html
125 
126 ###Offline pdf
127 There may be a pdf shipped in the package. The following allows viewing of the pdf docs from the installation.
128 
129  $ tar -xzf /usr/share/doc/gclib/gclib_doc.tar.gz gclib_132.pdf
130  $ evince gclib.pdf