I am hoping that you're able to help me I am trying to understand how use the /proc file system or profile settings. I am trying to write a script which pulls the temp of the CPU and a list of peripherals attached to a SUSE device. This would be using native functionality rather than a tool. Is there a path of sorts to the variable for temp of the CPU and a list of attached devices?
Hopefully it makes sense.
Regards
QuinsUK
To get temp use "sensors":
$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +63.0°C (high = +105.0°C, crit = +105.0°C)
Core 1: +60.0°C (high = +105.0°C, crit = +105.0°C)
or look at the /sys/class/hwmon/
$ cd /sys/class/hwmon/hwmon0/device/
{ cat temp3_label; cat temp3_input; }
Core 1
58000
For attached devices:
lspci - List PCI:
$ lspci
00:00.0 Host bridge: Intel Corporation 82G35 Express DRAM Controller (rev 03)
00:02.0 VGA compatible controller: Intel Corporation 82G35 Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation 82G35 Express Integrated Graphics Controller (rev 03)
00:19.0 Ethernet controller: Intel Corporation 82566DC Gigabit Network Connection (rev 02)
00:1a.0 USB controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 02)
lsscsi - List scsi devices:
$ lsscsi
[3:0:0:0] disk ATA ST3500418AS CC38 /dev/sda
[4:0:0:0] cd/dvd SONY DVD RW DRU-190A 1.63 /dev/sr0
lsusb - List usb buses and device details:
$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
hwinfo — all at once
Related
I am running Vmware vm with Ubuntu 18 OS on a Window 10 system. A USB bluetooth device is plug in this Machine. Now I want to control this bluetooth device in Ubuntu 18 VM, but failed.
In Ubuntu VM, I can get bluetooth hardware info through:
# hcitool scan
Scanning ...
70:EF:00:D0:AE:05 ****
3C:CD:57:2C:94:4F ****
14:DE:39:E5:B2:F8 ****
48:01:C5:06:DC:A2 ****
# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 005: ID 0e0f:0008 VMware, Inc.
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
root#turnbig:~# lshw | grep Blue -C 10
*-usb:1
description: USB hub
product: VMware Virtual USB Hub
vendor: VMware, Inc.
physical id: 2
bus info: usb#2:2
version: 1.00
capabilities: usb-1.10
configuration: driver=hub slots=7 speed=12Mbit/s
*-usb
description: Bluetooth wireless interface
product: Virtual Bluetooth Adapter
vendor: VMware
physical id: 1
bus info: usb#2:2.1
version: 1.00
serial: 000650268328
capabilities: bluetooth usb-2.00
configuration: driver=btusb speed=12Mbit/s
But when i try to connect to other BT devices, it failed with "Device 3C:CD:57:2C:94:4F not available", 3C:CD:57:2C:94:4F is a target bluetooth device to connect:
# bluetooth
bluetooth = on
# bluetoothctl
[NEW] Controller 44:AF:28:F5:2B:D3 ***** [default]
Agent registered
[bluetooth]# info 3C:CD:57:2C:94:4F
Device 3C:CD:57:2C:94:4F not available
[bluetooth]# connect 3C:CD:57:2C:94:4F
Device 3C:CD:57:2C:94:4F not available
I can connect to this BT device through host machine (Window 10)
thanks for any comment.
Question fixed, original solution is post here.
To use a USB bluetooth from VMware guest OS, we can not share bluetooth to guest, we should connect the removeable bluetooth device to guest directly.
I have one development board attached via USB to my Linux machine. For the sake of debugging I want to monitor the serial port. My problem is that I don't know how understand which serial port should I monitor.
When running lsusb in the terminal, I see
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0461:4e1d Primax Electronics, Ltd
Bus 001 Device 004: ID 0d28:0204 NXP LPC1768
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 046d:c019 Logitech, Inc. Optical Tilt Wheel Mouse
Bus 003 Device 002: ID 03f0:c511 Hewlett-Packard
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The device I am interested in is the NXP LPC1768,so it is "attached" to Bus01, device 04. However, which port should I monitor to read the serial port of that NXP LPC1768 device?
When running dmesg | grep tty, I see
[ 0.000000] console [tty0] enabled
[ 97.204143] cdc_acm 1-1.2:1.1: ttyACM0: USB ACM device
but this still doesn't give me that information I am looking for.
When I used Windows, I would go to the Device manager, Ports tab, see the COM port associated to the device and use software like Putty for monitoring the serial port.
Do you how can I do that in Linux?
I'm sorry if this question has been asked before but I've searched for an hour and still couldn't find the answer..
My problem is that I don't know how understand which serial port should I monitor.
If this "one development board" is recognized as a USB gadget by your Linux PC, then there will be syslog entries.
Disconnect the board, wait 15 seconds, then connect the board.
Use the commands dmesg | tail to review the end of the syslog.
You might get something like this:
$ dmesg | tail
[ 2094.481014] usb 1-1: Product: EDBG CMSIS-DAP
[ 2094.481019] usb 1-1: Manufacturer: Atmel Corp.
[ 2094.481023] usb 1-1: SerialNumber: ATML0000001351195199
[ 2095.033449] hidraw: raw HID events driver (C) Jiri Kosina
[ 2095.038550] cdc_acm 1-1:1.1: ttyACM0: USB ACM device
[ 2095.038874] usbcore: registered new interface driver cdc_acm
[ 2095.038877] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 2095.112372] usbcore: registered new interface driver usbhid
[ 2095.112376] usbhid: USB HID core driver
[ 2095.237686] hid-generic 0003:03EB:2111.0001: hiddev0,hidraw0: USB HID v1.11 Device [Atmel Corp. EDBG CMSIS-DAP] on usb-0000:00:1d.7-1/input0
$
The first three lines shown relate to the completion of the low-level USB protocol.
The remaining seven lines are the USB device installation.
It's the fifth line that's salient, as that indicates that the attached board implements the USB CDC (Communications Device Class) ACM (Abstract Control Model) to emulate a serial port.
If the SBC does connect as a serial device (e.g. /dev/ttyACM0 ), then you can use a terminal emulator program, such as minicom or puTTY.
$ minicom --device /dev/ttyACM0
When running dmesg | grep tty, I see
[ 0.000000] console [tty0] enabled
[ 97.204143] cdc_acm 1-1.2:1.1: ttyACM0: USB ACM device
but this still doesn't give me that information I am looking for.
Actually that is the information that you need (assuming this device is for your SBC).
ADDENDUM
When I tried to access it with putty, I got the error message "Unable to open connection Unable to access serial port".
Presumably the device node ttyACM is owned by root and the group dialout:
$ ls -l /dev/ttyACM*
crw-rw---- 1 root dialout 166, 0 Sep 22 15:54 /dev/ttyACM0
Verify that your username belongs to the dialout group (so that you have access to this device).
$ whoami
george
$ grep dialout </etc/group
dialout:x:20:george
If your username is not a member of the dialout group, then use the administrative (or system tool) program of your Linux distro to add your username to dialout. Or see https://unix.stackexchange.com/questions/14354/read-write-to-a-serial-port-without-root or https://askubuntu.com/questions/112568/how-do-i-allow-a-non-default-user-to-use-serial-device-ttyusb0
I am trying to interface Point Grey Bumblebee2 stero camera with the nvida tegra tk1 using PCI express. Nvidia board detects the PCI express.
lspci
00:00.0 PCI bridge: NVIDIA Corporation Device 0e12 (rev a1)
01:00.0 FireWire (IEEE 1394): LSI Corporation FW643 [TrueFire] PCIe 1394b Controller (rev 08)
02:00.0 PCI bridge: NVIDIA Corporation Device 0e13 (rev a1)
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
But it cannot find the Point Grey camera
lsusb
Bus 002 Device 004: ID 046d:c018 Logitech, Inc. Optical Wheel Mouse
Bus 002 Device 003: ID 03f0:0024 Hewlett-Packard KU-0316 Keyboard
Bus 002 Device 002: ID 03f0:2824 Hewlett-Packard
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
After thorough debugging, I found out that current kernel on nvida tegra tk1 doesn't have firewire1394 driver. So, I need to know which kernel I can recompile to use firewire1394 driver.
The stock Linux kernel 3.10.40 does not have a firewire1394 driver. So, I added a firewire1394 driver.
The "Grinch" kernel adds 1394 support. The Grinch kernel is available from: https://devtalk.nvidia.com/default/topic/823132/embedded-systems/-customkernel-the-grinch-21-3-4-for-jetson-tk1-developed/
I followed the instructions and finally I have the firewire1394 driver installed and loaded.
To install CUDA and OpenCV4Tegra, one can then use application manager and then unchecked the linux and flushed option.
Objective
I'm trying to programmatically find out on which physical slot a particular PCIe device is connected. The premise is that I have the PCI-ID of a card that is surely occupying a slot, and the solution would be finding out which one.
Note that I'm only interested in working on the PCI Express bus, although the device identification/enumeration process I think is the same as the old PCI.
Attempt
The SMBIOS contains information about the motherboard slots available. It is possible to examine this information from the linux command line:
$ sudo dmidecode -t slot
# dmidecode 2.11
SMBIOS 2.7 present.
Handle 0x003A, DMI type 9, 17 bytes
System Slot Information
Designation: PCIEX16_1
Type: x16 PCI Express x16
Current Usage: In Use
Length: Short
ID: 1
Characteristics:
3.3 V is provided
Opening is shared
PME signal is supported
Bus Address: 0000:03:02.0
Handle 0x003B, DMI type 9, 17 bytes
System Slot Information
Designation: PCIEX16_2
Type: x8 PCI Express x8
Current Usage: In Use
Length: Short
ID: 2
Characteristics:
3.3 V is provided
Opening is shared
PME signal is supported
Bus Address: 0000:04:02.2
Handle 0x003C, DMI type 9, 17 bytes
System Slot Information
Designation: PCIEX16_3
Type: x16 PCI Express x16
Current Usage: In Use
Length: Short
ID: 3
Characteristics:
3.3 V is provided
Opening is shared
PME signal is supported
Bus Address: 0000:05:03.0
However, I can't find any device in the PCI bus (lspci) that has a PCI ID of 0000:03:02.0, 0000:04:02.2 or 0000:05:03.0. What I know by manual inspection is the following:
Card 0000:03:00.0 is in the first slot. The PCI bridge appears to be 0000:00:02.0
Card 0000:04:00.0 is in the second slot. The PCI bridge appears to be 0000:00:02.2
Card 0000:05:00.0 is in the third slot. The PCI bridge appears to be 0000:00:03.0
So a pattern emerges here. From the SMBIOS structure, the bus number is the one given to the card that is plugged in but the device/function numbers are the same as the corresponding PCI bridge.
Is this pattern just a coincidence in my motherboard or there is a rationale behind? It is an Asus motherboard, with an AMI BIOS. I've read that some BIOSes do not provide accurate information about their slots so I would like to know how much generality I can achieve.
Any hint or pointer to reference documentation is also greatly appreciated.
You may find the lspci command helpful. Here's a sample output:
# lspci -v -t
-[0000:00]-+-00.0 Intel Corporation 5500 I/O Hub to ESI Port
+-01.0-[01]--+-00.0 Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
| \-00.1 Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
+-03.0-[02]--+-00.0 Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
| \-00.1 Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
+-07.0-[04]----00.0 LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator]
+-09.0-[05]----00.0 LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator]
+-14.0 Intel Corporation 7500/5520/5500/X58 I/O Hub System Management Registers
+-14.1 Intel Corporation 7500/5520/5500/X58 I/O Hub GPIO and Scratch Pad Registers
+-14.2 Intel Corporation 7500/5520/5500/X58 I/O Hub Control Status and RAS Registers
+-1a.0 Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4
+-1a.1 Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5
+-1a.7 Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2
+-1c.0-[03]----00.0 LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator]
+-1d.0 Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1
+-1d.1 Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2
+-1d.7 Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1
+-1e.0-[06]----03.0 Matrox Electronics Systems Ltd. MGA G200eW WPCM450
+-1f.0 Intel Corporation 82801IB (ICH9) LPC Interface Controller
\-1f.2 Intel Corporation 82801IB (ICH9) 2 port SATA Controller [IDE mode]
I'm having a builddroot assembled busybox distribution running on my micro.
It all works well so far but I realized one thing. When I boot my box up and
I do an lsusb I see this:
# lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 003: ID 12d1:14ac Huawei Technologies Co., Ltd.
Bus 001 Device 004: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x
Composite Device
and I have following links:
ttyUSB0 ttyUSB1 ttyUSB2 ttyUSB3
buyt none of those links seem to go to Device 0004 but if I replug the
CP210x device, I get this:
# lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 003: ID 12d1:14ac Huawei Technologies Co., Ltd.
Bus 001 Device 005: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x
Composite Device
and these links:
ttyUSB0 ttyUSB1 ttyUSB2 ttyUSB3 ttyUSB4
and now ttyUSB4 is linking to my Device 005 why do I need to replug my
device in order to get a working symlink? That's not what I want? :(
How can I fix this? The cp210x module is compiled into the kernel (not
attached as a separate module) - any suggestions?
This for some reason just stop happening probably due to the fact that we're only using one usb device now. Inodes would have been a solution but got never implemented in our system.