| gclib 307 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 See the \link installation \endlink page for supported versions.
7
8
9 ##Installation
10 ###Create a temporary variable for Ubuntu version
11
12 uver=$(lsb_release -r | cut -f 2); echo $uver
13 14.04
14
15 ###Install Galil's public certificate
16
17 $ wget http://www.galil.com/sw/pub/ubuntu/$uver/GALIL-PUB-KEY
18 $ sudo apt-key add GALIL-PUB-KEY
19
20 ###Get Galil's apt sources list
21
22 $sudo wget http://www.galil.com/sw/pub/ubuntu/$uver/galil.list -O /etc/apt/sources.list.d/galil.list
23 $sudo apt-get update
24
25 ###Install Package
26
27 $sudo apt-get install gclib
28
29 ###Uninstall Package
30
31 To uninstall gclib.
32
33 $sudo apt-get remove gclib
34
35 ##Installed files
36 * The gclib shared object files
37 * /usr/lib/libgclibo.so
38 * /usr/lib/libgclib.so
39 * The gclib header files
40 * /usr/include/gclib_errors.h
41 * /usr/include/gclibo.h
42 * /usr/include/gclib.h
43 * /usr/include/gclib_record.h
44 * gclib documentation tarball
45 * /usr/share/doc/gclib/gclib_129_doc.tar.gz
46 * Example source tarball
47 * /usr/share/doc/gclib/src/gclib_129_examples.tar.gz
48 * Source files to modify/rebuild libgclibo.so
49 * /usr/share/doc/gclib/src/gclibo_129_src.tar.gz
50 * GalilTools Communication Library (gcl) wrapper
51 * /usr/share/doc/gclib/src/gclib_129_gcl.tar.gz
52 * PCI driver files
53 * /usr/share/doc/gclib/src/gclib_129_pci.tar.gz
54
55
56 ##Serial Ports and USB
57 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.
58
59 ###Determine group with access
60
61 $ ls -l /dev/ttyUSB* /dev/ttyS*
62 crw-rw----. 1 root dialout 4, 64 Mar 3 16:39 /dev/ttyS0
63 crw-rw----. 1 root dialout 4, 65 Mar 3 16:39 /dev/ttyS1
64 crw-rw----. 1 root dialout 4, 66 Mar 3 16:39 /dev/ttyS2
65 crw-rw----. 1 root dialout 4, 67 Mar 3 16:39 /dev/ttyS3
66 crw-rw----. 1 root dialout 188, 0 Mar 6 11:08 /dev/ttyUSB0
67
68 In the above listing, **dialout** is the group that needs to be joined. **uucp** is another common group that may be listed.
69
70 ###Add the desired *username* to the group.
71
72 $ sudo gpasswd -a username dialout
73 [sudo] password for username:
74 Adding user username to group dialout
75
76 Log out and back in for change to take effect.
77
78 $ groups
79 username wheel dialout
80
81 gclib can now connect to serial and usb devices from user *username*.
82
83 ##PCI Controllers
84 If using a Galil PCI controller, the PCI driver must be installed.
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 html
119 The following allows viewing of the html docs from the installation.
120
121 $ tar -xzf /usr/share/doc/gclib/gclib_132_doc.tar.gz html
122 $ firefox html/index.html
123
124 ###Offline pdf
125 There may be a pdf shipped in the package. The following allows viewing of the pdf docs from the installation.
126
127 $ tar -xzf /usr/share/doc/gclib/gclib_132_doc.tar.gz gclib_132.pdf
128 $ evince gclib_132.pdf