48 | | To setup a new console user (this is something only admins can do), do the following as `root@robideau`: |
| 48 | === Overview === |
| 49 | |
| 50 | To ensure the proper device is connected to the proper path on reboots, we maintain a udev configuration here: |
| 51 | |
| 52 | /etc/udev/rules.d/z25_persistent_usb_serial.rules |
| 53 | |
| 54 | A sample entry is: |
| 55 | |
| 56 | {{{ |
| 57 | SUBSYSTEMS=="usb", ENV{ID_SERIAL}=="FTDI_FT232R_USB_UART_ST161539",SYMLINK+="ttyUSBmalaka" |
| 58 | }}} |
| 59 | |
| 60 | This means, create a symlink called /dev/ttyUSBmalaka for the device with the serial number "FTDI_FT232R_USB_UART_ST161539" |
| 61 | |
| 62 | The first step is to figure out which serial number is used by the cable you are using. |
| 63 | |
| 64 | The second step is to create the right rule the creates a consistent symlink based on that serial number. |
| 65 | |
| 66 | The third step is to create a cereal-admin entry pointing to the symlink. |
| 67 | |
| 68 | === Actual steps === |
| 69 | |
| 70 | First, plug your server or device into an un-used port on one of our USB serial adapters. |
| 71 | |
| 72 | Second, as root run `cereal-admin list` and note all the cereal instance named "test." These are the un-allocated ones. |
| 73 | |
| 74 | Next, login with the username `pdu-console@console.mayfirst.org`. This user has access to all the un-allocated cereal instances. |
| 75 | |
| 76 | As `pdu-console`, run `cereal attach <instance>` (replace instance with test0, test4, etc.). Run through all the available instances until you find yours. |
| 77 | |
| 78 | When you find yours, figure out the mapping. test0 is connected to /dev/ttyUSB0, test4 is /dev/ttyUSB4, etc. Run: `ls -l /dev/serial/by-id/` and figure out which id is pointing to the device that is yours. |
| 79 | |
| 80 | Then, edit `/etc/udev/rules.d/z25_persistent_usb_serial.rules` - adding a line with your id and a human name. |
| 81 | |
| 82 | Restart udev and re-trigger creation of symlinks with `systemctl restart udev && udevadm trigger -s tty`. |
| 83 | |
| 84 | Lasly, to setup a new console user (this is something only admins can do), do the following as `root@robideau`: |