| 1 |
-------------------------------------------------------------------------------- |
| 2 |
Quick-Start Guide for libticables2 set-up |
| 3 |
-------------------------------------------------------------------------------- |
| 4 |
|
| 5 |
An issue with this library, on GNU/Linux, is properly setting up access to |
| 6 |
devices. The *nix family, to which GNU/Linux belongs, is less insecure than old |
| 7 |
Windows versions because it heavily relies on separation and permissions... but |
| 8 |
as a consequence, it becomes harder to use in some situations. |
| 9 |
|
| 10 |
This document describes methods for manual setup of access to cables and |
| 11 |
calculators on the parallel, serial and USB cables. |
| 12 |
|
| 13 |
On the first run, you may want to run your program as root. This way, you will |
| 14 |
be almost sure to run it successfully. |
| 15 |
On the long run, you should of course run your program as a regular |
| 16 |
(non-privileged) user, and for this, you need to take care of permissions, as |
| 17 |
explained by this document. |
| 18 |
|
| 19 |
|
| 20 |
-------------------------------------------------------------------------------- |
| 21 |
ParallelLink cable |
| 22 |
-------------------------------------------------------------------------------- |
| 23 |
|
| 24 |
The node is '/dev/parportX". You must have r/w permissions on this device, and |
| 25 |
the device must not be locked exclusively by any other parallel port driver |
| 26 |
(such as some CUPS drivers for parallel port printers) - otherwise libticables2 |
| 27 |
won't be able to acquire and use the port. |
| 28 |
This can be done by: |
| 29 |
- giving up r/w permissions to others (chmod ugo+rw /dev/parport?) or, better, |
| 30 |
- adding your user to the group 'lp' (edit /etc/group and add your |
| 31 |
username after the ':'). |
| 32 |
Example 1: |
| 33 |
crw-rw-rw- 1 root lp 99, 0 2005-02-26 07:39 parport0 |
| 34 |
Example 2: |
| 35 |
lp:x:7:romain |
| 36 |
- On some distributions (e.g. Fedora 12), an alternative, groupless setup |
| 37 |
detailed below can also be used. |
| 38 |
|
| 39 |
If you have a parallel port printer, for libticables2 to work, you may need to |
| 40 |
stop the CUPS printing service (the way to do this depends on your distribution) |
| 41 |
and unload the 'lp' kernel module (`rmmod lp` as root), so as to liberate the |
| 42 |
exclusive lock on the parallel port held by CUPS / the printer driver. |
| 43 |
|
| 44 |
|
| 45 |
-------------------------------------------------------------------------------- |
| 46 |
BlackLink & GrayLink cables |
| 47 |
-------------------------------------------------------------------------------- |
| 48 |
|
| 49 |
The node is '/dev/ttySx". You must have r/w permissions on this device. |
| 50 |
This can be done by: |
| 51 |
- giving up r/w permissions to others (chmod ugo+rw /dev/ttyS0) or, better, |
| 52 |
- adding your user to the group 'dialout' (edit /etc/group and add your |
| 53 |
username after the ':'). |
| 54 |
Example 1: |
| 55 |
crw-rw-rw- 1 root dialout 4, 64 2006-02-08 13:40 /dev/ttyS0 |
| 56 |
Example 2: |
| 57 |
dialout:x:20:romain |
| 58 |
- On some distributions (e.g. Fedora 12), an alternative, groupless setup |
| 59 |
detailed below can also be used. |
| 60 |
|
| 61 |
|
| 62 |
-------------------------------------------------------------------------------- |
| 63 |
Groupless setup for udev >= 143 with udev-acl and ConsoleKit / systemd |
| 64 |
-------------------------------------------------------------------------------- |
| 65 |
|
| 66 |
On most modern distributions, it is possible to set up the system so that the |
| 67 |
user physically in front of the computer, if any, gets access to what's assumed |
| 68 |
to be his/her calculator automatically. The exact procedure used to vary |
| 69 |
depending on the individual distribution and its age, but seems to have become |
| 70 |
stable for years. The following procedure works for systems using udev 143 or |
| 71 |
newer with udev-acl enabled, such as Fedora 12. |
| 72 |
|
| 73 |
How udev-acl works is that a nice system service called ConsoleKit keeps track |
| 74 |
of what user(s) is/are currently logged in locally. The udev-acl tool uses this |
| 75 |
information to hand out ACLs for these devices to those users. |
| 76 |
|
| 77 |
To use this setup, create a /etc/udev/rules.d/69-libticables.rules file with |
| 78 |
the contents listed below. |
| 79 |
ACTION!="add", GOTO="libticables_end" |
| 80 |
|
| 81 |
# serial device (assume TI calculator) |
| 82 |
KERNEL=="ttyS[0-3]", ENV{ID_PDA}="1" |
| 83 |
# parallel device (assume TI calculator) |
| 84 |
SUBSYSTEM=="ppdev", ENV{ID_PDA}="1" |
| 85 |
# SilverLink |
| 86 |
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e001", ENV{ID_PDA}="1" |
| 87 |
# TI-84+ DirectLink |
| 88 |
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e003", ENV{ID_PDA}="1" |
| 89 |
# TI-89 Titanium DirectLink |
| 90 |
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e004", ENV{ID_PDA}="1" |
| 91 |
# TI-84+ SE DirectLink |
| 92 |
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e008", ENV{ID_PDA}="1" |
| 93 |
# TI-Nspire DirectLink |
| 94 |
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e012", ENV{ID_PDA}="1" |
| 95 |
|
| 96 |
LABEL="libticables_end" |
| 97 |
|
| 98 |
IMPORTANT NOTE: |
| 99 |
* on 143 <= udev <= 165, replace ENV{ID_PDA}="1" by ENV{ACL_MANAGE}="1". |
| 100 |
|
| 101 |
|
| 102 |
-------------------------------------------------------------------------------- |
| 103 |
Old group-based setup for the SilverLink and DirectLink cables |
| 104 |
-------------------------------------------------------------------------------- |
| 105 |
|
| 106 |
This is mentioned for historical purposes, as it worked for years on Debian and |
| 107 |
derivative distros using udev. It uses a POSIX group. You should use the |
| 108 |
group-less setup described above instead. |
| 109 |
|
| 110 |
Like the group-less setup, it requires adding a set of udev rules. |
| 111 |
|
| 112 |
To use this setup, create a /etc/udev/rules.d/20-ticables.rules file with |
| 113 |
the contents listed below. |
| 114 |
# SilverLink |
| 115 |
ACTION=="add", SUBSYSTEM=="usb_device", ATTR{idVendor}=="0451", |
| 116 |
ATTR{idProduct}=="e001", MODE="0660", GROUP="plugdev" |
| 117 |
# TI-84+ DirectLink |
| 118 |
ACTION=="add", SUBSYSTEM=="usb_device", ATTR{idVendor}=="0451", |
| 119 |
ATTR{idProduct}=="e003", MODE="0660", GROUP="plugdev" |
| 120 |
# TI-89 Titanium DirectLink |
| 121 |
ACTION=="add", SUBSYSTEM=="usb_device", ATTR{idVendor}=="0451", |
| 122 |
ATTR{idProduct}=="e004", MODE="0660", GROUP="plugdev" |
| 123 |
# TI-84+ SE DirectLink |
| 124 |
ACTION=="add", SUBSYSTEM=="usb_device", ATTR{idVendor}=="0451", |
| 125 |
ATTR{idProduct}=="e008", MODE="0660", GROUP="plugdev" |
| 126 |
# TI-Nspire DirectLink |
| 127 |
ACTION=="add", SUBSYSTEM=="usb_device", ATTR{idVendor}=="0451", |
| 128 |
ATTR{idProduct}=="e012", MODE="0660", GROUP="plugdev" |
| 129 |
|
| 130 |
The template relies on a group called 'plugdev'. If it doesn't exist, you will |
| 131 |
have to create it or choose another group which matches better your system. |
| 132 |
|
| 133 |
You will have to add the user to the group 'plugdev' (by using one of the |
| 134 |
user/group management tools, or editing /etc/group + /etc/gshadow to add your |
| 135 |
username after the ':'). For example, the line will become: |
| 136 |
|
| 137 |
plugdev:x:46:romain |