Linux serial number monitor

obtain the manufacturer and product ID and serial number of the display

The goal is to obtain the manufacturer and product ID and the serial number of the display under the Linux platform. I eventually need to get this information in the program in C++. But I also accept the command line acquisition method.

How is the display connected? Is this for a generic platform where EDID can be expected to be available, or is it for an embedded platform with more specific requirements?

A display connected via a video output connector or a built-in display. For a generic platform where EDID can be expected to be available

2 Answers 2

Such information is available via /sys/class/drm subsystem. Tools such as xrandr use it extensively. Now, specifically there is directory for each display in this subsystem, with a file edid , Extended Display Identification Data.

On Debian-based systems there are two packages available, edid-decode and read-edid . Both seem to work alright, but on old and dated models read-edid seems to work well enough, whereas edid-decode returns errors:

EDID block does NOT conform to EDID 1.3! Detailed block string not properly terminated EDID block does not conform at all! Bad year of manufacture 

So I would recommend installing read-edid package. After you have installed, use parse-edid command as shown below:

The other command get-edid appears to connect to i2c bus and figures out automatically which displays are connected and what data is available. Now, of course this is no C++ method, but these two tools are likely written in C. Consider looking at their source code and note which libraries they use.

Источник

Shell serial number of laptop in ubuntu

Consider the last portion of the device hierarchy shown in the second example above: The name given to this device by the kernel (KERNELS==»1-4.5″) indicates that this device is plugged into the fifth port of a hub connected to port four on bus 1 (see this FAQ for more information on how to decode the sysfs usb device hierarchy). Solution 2: Although it would not help in this specific case, some adapters are assigned unique serial ids: An example adapter serial id: and udev rules would then contain: Source Solution 3: Have you looked at the contents of ?

Читайте также:  Astra linux руководство по эксплуатации

How to get serial number of my monitor?

With a Linux system (Ubuntu), you can use ddcprobe.

sudo apt-get install xresprobe 

You’ll see lots of info about your graphics card. Then at the end, you’ll see

monitorserial: xxxxxxx monitorname: xxxxxx monitorrange: xxxxxx 

Do you mean the Monitor Make and Model? You can not get the Monitor’s serial number, but you can get the make & model once X is running:

you can look for it in /var/log/Xorg.0.log , e.g. grep ‘—‘ /var/log/Xorg.0.log or in

There’s a software package called read-edid that should help you get to pretty much all information the monitor gives away. The separate tools are called get-edid and parse-edid :

Extract the Linux serial number without sudo, If you can install package hal (not installed by default on recent Ubuntu versions), this command will work for you as non-root: lshal | grep system.hardware.serial system.hardware.serial = ‘‘ (string)

How to distinguish between identical USB-to-serial adapters?

is there any way I can write a udev rule that fixes the name of each adapter based on which physical port on the hub the adapter is plugged into?

Yes there is, as it turns out. Consider the last portion of the device hierarchy shown in the second example above:

The name given to this device by the kernel (KERNELS==»1-4.5″) indicates that this device is plugged into the fifth port of a hub connected to port four on bus 1 (see this FAQ for more information on how to decode the sysfs usb device hierarchy). With some help from this guide to writing udev rules I came up with the following set of udev rules for my USB-to-serial-port converters:

KERNEL==»ttyUSB*», KERNELS==»1-8.1.5″, NAME=»ttyUSB0″
KERNEL==»ttyUSB*», KERNELS==»1-8.1.6″, NAME=»ttyUSB1″
KERNEL==»ttyUSB*», KERNELS==»1-8.1.1″, NAME=»ttyUSB2″
KERNEL==»ttyUSB*», KERNELS==»1-8.1.2″, NAME=»ttyUSB3″

These rules have one obvious disadvantage: they assume that all USB-to-serial converters will be plugged into the same hub («1-8.1.*»). If a USB to serial converter was plugged into another USB port it could be assigned the name «ttyUSB0» which would conflict with the naming scheme described above. However, since I leave all of the converters plugged into the hub I can live with this constraint.

Читайте также:  Astra linux синхронизация файлов

Although it would not help in this specific case, some adapters are assigned unique serial ids:

udevadm info -a -n /dev/ttyUSB1 | grep '' 

An example adapter serial id:

and udev rules would then contain:

SUBSYSTEM=="tty", ATTRS=="0403", ATTRS=="6001", ATTRS=="A6008isP", SYMLINK+="arduino" 

Have you looked at the contents of /dev/serial/by-id/ ? In a similar situation each device was assigned a unique persistent ID there (I’ll admit don’t know what it actually represents).

How to Check Your RAM on Ubuntu, It is installed by default on Ubuntu 18.04. Just reboot your Ubuntu machine and from the GRUB menu, select Memory test (memtest86+). You should see the following window. Now press F1 to go to Fail-Safe Mode. memtest86+ should start checking your RAM for errors as you can see from the screenshot below.

Find active serial ports in Windows Subsystem for Linux (WSL)

I created a solution combining both Powershell and WSL .

1.Create a Powershell script, comports.ps1:

$DeadComport = 3 $COMportList = [System.IO.Ports.SerialPort]::getportnames() if ($COMportList.Count -cgt 2) < Write-Output "Too many com-ports connnected! " Write-Host -NoNewline "Com-ports found:" $COMportList.Count >else < ForEach ($COMport in $COMportList) < $temp = new-object System.IO.Ports.SerialPort $COMport $portNr = $temp.PortName.SubString(3) if ($portNr -eq $DeadComport)< continue >Write-Output $portNr $temp.Dispose() > > 

— You can debug this code in PowerShell ISE and adjust it to meet your preference.

2.Create a bash script in WSL, comscript.sh:

Preferably in the home/your-username/bin folder, that makes the bash-script globally executable.

#!/bin/bash echo "Active com-port" powershell.exe -File "c:\your-folder\comports.ps1" 

Now you can just call comscript.sh and it will output the active comport, if more then one device is found it will throw an error message.

Be aware that I’m filtering out com-port 3, since it’s always there and active on my computer.

Xorg — How to get serial number of my monitor?, You can not get the Monitor’s serial number, but you can get the make & model once X is running: you can look for it in /var/log/Xorg.0.log , e.g. grep ‘—‘ /var/log/Xorg.0.log or in. There’s a software package called read-edid that should help you get to pretty much all information the monitor gives away. The separate …

Читайте также:  Linux openvpn конфигурация клиента

Источник

Get screen vendor and serial number under Linux

I have an instance of Gdk::Screen which represents a monitor connected to my computer. How can I read that monitor’s vendor ID and/or serial number? Getting the Vendor ID and Serial Number from an XScreen would also suffice. Reading the EDID of the Monitor would also suffice. Any ideas? Thanks!

2 Answers 2

I haven’t tested this out, but you should be able to look at the source of Gnome’s display configuration applet. It’s here:

The function get_display_name() looks promising. It looks like it uses code from libgnome-desktop, which is also viewable in the same git browser.

The EDID information usually is not passed on entirely by X11, but only those parts that matter for graphics renering, i.e. resolution, physical dimensions, stuff like that. It was possible to implement a X11 extension for this, but ATM there is no such one.

So you’ll have to query the EDID information otherwise. Doing it remotely is impossible, but for reading local machine information there are tools like read-edid. Also there may be graphics driver vendor specific extensions, to do this, for example NV-CONTROL of NVidia.

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.12.43529

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

Оцените статью
Adblock
detector