gclib  437
Communications API for Galil controllers and PLCs
pi.md
1 # Raspberry Pi {#pi}
2 
3 ##Tested versions
4 
5 See the \link installation \endlink page for supported versions.
6 
7 ##Installation
8 
9 ###Create a temporary variable for OS version
10 
11  $ os=$(lsb_release -r -s)
12  $ echo $os
13  9.8
14 
15 The number printed must be in the \link installation \endlink list of
16 supported operating systems.
17 
18 ###Install Galil's public certificate
19 
20  $ wget http://www.galil.com/sw/pub/raspbian/$os/GALIL-PUB-KEY
21  $ sudo apt-key add GALIL-PUB-KEY
22 
23 ###Get Galil's apt sources list
24 
25  $sudo wget http://www.galil.com/sw/pub/raspbian/$os/galil.list -O /etc/apt/sources.list.d/galil.list
26  $sudo apt-get update
27 
28 ###Install Package
29 
30  $sudo apt-get install gclib
31 
32 ###Uninstall Package
33 
34 To uninstall gclib.
35 
36  $sudo apt-get remove gclib
37 
38 
39 ##Serial Ports and USB
40 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.
41 
42 ###Determine group with access
43 
44  $ ls -l /dev/ttyUSB* /dev/ttyS*
45  crw-rw----. 1 root dialout 4, 64 Mar 3 16:39 /dev/ttyS0
46  crw-rw----. 1 root dialout 4, 65 Mar 3 16:39 /dev/ttyS1
47  crw-rw----. 1 root dialout 4, 66 Mar 3 16:39 /dev/ttyS2
48  crw-rw----. 1 root dialout 4, 67 Mar 3 16:39 /dev/ttyS3
49  crw-rw----. 1 root dialout 188, 0 Mar 6 11:08 /dev/ttyUSB0
50 
51 In the above listing, **dialout** is the group that needs to be joined. **uucp** is another common group that may be listed.
52 
53 ###Check the user's group
54 
55 The default *pi* username is already a member of dialout.
56 
57  $ groups
58  pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi
59 
60 ###If needed, add the desired *username* to the group.
61 
62  $ sudo gpasswd -a username dialout
63  [sudo] password for username:
64  Adding user username to group dialout
65 
66 Log out and back in for change to take effect.
67 
68  $ groups
69  username wheel dialout
70 
71 gclib can now connect to serial and usb devices from user *username*.
72 
73 ##Documentation
74 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.
75 * http://www.galil.com/sw/pub/all/doc/gclib/html/
76 
77 ###Offline html
78 The following allows viewing of the html docs from the installation, in the GUI mode.
79 
80  $ tar -xzf /usr/share/doc/gclib/gclib_doc.tar.gz html
81  $ epiphany html/index.html