wiki:USB

Version 1 (modified by krit, 3 years ago) (diff)

--

USB

Fix port usb Digitemp read Temperature, find out where the link find to ttyUSB0 or ttyUSB1

[root@rock rules.d]# ls -l /dev/serial/by-id/
total 0
lrwxrwxrwx 1 root root 13 Jun  1 02:53 usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0 -> ../../ttyUSB1
lrwxrwxrwx 1 root root 13 Jun  1 02:53 usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_2c67e783c72aea119cabbdfad0cd4f36-if00-port0 -> ../../ttyUSB0

Then, we config /etc/digitemp.conf to point to softlink file ttyUSB1. In this case, point to usb-Prolific_Technology_Inc.

[jpc@rock ~]$ cat /etc/digitemp.conf
#TTY /dev/ttyUSB1
TTY /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
READ_TIME 1000
LOG_TYPE 1
LOG_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F"
CNT_FORMAT "%b %d %H:%M:%S Sensor %s #%n %C"
HUM_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F H: %h%%"
SENSORS 1
ROM 0 0x28 0xFF 0x64 0x1E 0x39 0xE1 0x30 0x34
[jpc@rock ~]$

We can read Temperatue with

[jpc@rock ~]$ digitemp_DS9097 -a -q -c /etc/digitemp.conf
Jun 01 21:04:18 Sensor 0 C: 28.00 F: 82.40
[jpc@rock ~]$