简体   繁体   English

如何确定Linux中监视器/电视的电源状态

[英]How to determine the power status of a monitor/TV in Linux

I asked this same question a few months ago, but I've run into another roadblock and I'm hoping someone will have a flash of insight. 几个月前我问了同样的问题,但是我遇到了另一个障碍,我希望有人会有一些见解。 The is the previous thread: Detecting if the monitor is powered off 这是前一个主题: 检测显示器是否已关闭电源

I'm trying to figure out the power status of a monitor, in particular a TV that is plugged in via HDMI. 我正在试图找出显示器的电源状态,特别是通过HDMI插入的电视。 I'm running Ubuntu 10.10 with nVidia ION video cards. 我正在使用nVidia ION视频卡运行Ubuntu 10.10。 These PCs will be running some digital signage and I need to make sure the power is on to the TV during business hours. 这些PC将运行一些数字标牌,我需要确保在工作时间电视接通电源。 I have a working Python script controlling an IR transmitter to turn the TV off and on. 我有一个工作的Python脚本控制IR发射器关闭和打开电视。 The last piece of the puzzle is to know the current state of the TV. 最后一块拼图是了解电视的当前状态。

In my previous thread, I found I could use ddccontrol to get information from the monitor. 在我之前的帖子中,我发现我可以使用ddccontrol从监视器获取信息。 That worked great for a traditional Asus monitor plugged in via HDMI. 这对于通过HDMI插入的传统华硕显示器非常有用。 However, the Vizio TV says it doesn't support DDC. 然而,Vizio TV表示它不支持DDC。

I've also tried using get-edid to get live resolution and color information, but that fails to return any information from the TV. 我也尝试使用get-edid获取实时分辨率和颜色信息,但无法从电视返回任何信息。

I've tried udevadm monitor but an event only fires on the initial monitor plugin. 我尝试过udevadm monitor但事件只会在初始监视器插件上触发。

I have a feeling that the nVidia drivers are blocking these calls to the monitor, but I can't confirm that. 我有一种感觉,nVidia驱动程序阻止了对显示器的这些调用,但我无法确认。

Ultimately, all I'm looking for is a single byte of information that changes when the monitor turns off. 最终,我正在寻找的只是一个字节的信息,当显示器关闭时会发生变化。

EDIT: So, I'm coming to the conclusion that this may not be possible. 编辑:所以,我得出结论,这可能是不可能的。 At least not consistently possible across various combinations of video cards and monitors/TVs. 至少在视频卡和显示器/电视的各种组合中不一致。 The next idea I have is to monitor power usage on an outlet. 我的下一个想法是监控插座的电源使用情况。 I first looked at Kill A Watts, but they are completely stand alone. 我首先看了Kill A Watts,但他们完全独立。 After several hours of searching, I came across Digi and their XBee radios. 经过几个小时的搜索,我遇到了Digi和他们的XBee无线电。 I ordered one of XBee's Smart Plugs from Digi and a XBee radio and USB adapter from Spark Fun. 我从Digi订购了一个XBee智能插头,从Spark Fun订购了一个XBee收音机和USB适配器。 My current plan is to use a Python script that polls the Smart Plug for power usage. 我目前的计划是使用Python脚本来轮询智能插头的电源使用情况。

The plug and radio were kind of expensive. 插头和收音机很贵。 Does anybody know of a power meter that plugs in? 有人知道插入的功率计吗? Everything I found was wireless. 我发现的一切都是无线的。 I'd like to be able to connect to it via USB, ethernet, or serial. 我希望能够通过USB,以太网或串口连接到它。

EDIT 2: I could never get the XBee plug to work. 编辑2:我永远无法让XBee插件工作。 It's incredibly difficult to configure the plug unless you buy one of Digi's gateways. 除非您购买Digi的网关,否则配置插头非常困难。

I ended up building my own current sensor. 我最终建立了自己的电流传感器。 It's Arduino based and cost about $60 in parts. 这是基于Arduino的,部分成本约为60美元。 I wrote about it here: http://trafficlightads.net/2011/09/06/an-arduino-current-sensor/ 我在这里写到: http//trafficlightads.net/2011/09/06/an-arduino-current-sensor/

I have a couple of Watts up? 我有几个瓦特了吗? .Net models that have USB and Ethernet for monitoring devices and controlling devices. .Net模型,具有USB和以太网,用于监控设备和控制设备。 The .Net model adds Ethernet and an internal relay to turn the attached device on and off. .Net型号增加了以太网和内部继电器,可以打开和关闭连接的设备。 This could be used to eliminate the possibility of IR being blocked and not being able to transition the state of the TV. 这可以用于消除IR被阻挡的可能性并且不能转换TV的状态。

Watts up? 瓦特了吗? .Net Product Link .Net产品链接

They aren't cheap, but they are well-built. 它们并不便宜,但它们构造精良。 I recommend getting the international model if you want the most flexibility in outlet type. 如果您想在插座类型中获得最大的灵活性,我建议您购买国际型号。 This allows you to use your own in and out cords. 这允许您使用自己的输入和输出线。 In the USA model the input cord is hard-wired/integrated. 在美国型号中,输入线是硬连线/集成的。

Good luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM