<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MMM-Remote-Control {fix monitor on&#x2F;off} tvservice --&gt; vcgencmd]]></title><description><![CDATA[<p dir="auto">As was documented in <a href="https://forum.magicmirror.builders/topic/6617/mmm-motion-detection-fixed-monitor-on-off-tvservice-vcgencmd">this</a> 8 month old thread, users having issues with the screen remaining blank after a MONITORON event solved the problem by replacing the exec statement to <em>tvservice</em> to instead exec <em>vcgencmd</em> in node_helper.js.</p>
<p dir="auto">The below solution was posted -<br />
Change:</p>
<pre><code>activateMonitor: function () {
    if (this.config.turnOffDisplay) {
      // Check if hdmi output is already on
      exec("/opt/vc/bin/tvservice -s").stdout.on("data", function(data) {
        if (data.indexOf("0x120002") !== -1)
          exec("/opt/vc/bin/tvservice --preferred &amp;&amp; chvt 6 &amp;&amp; chvt 7", null);
      });
    }
  },

  deactivateMonitor: function () {
    if (this.config.turnOffDisplay) {
      exec("/opt/vc/bin/tvservice -o", null);
    }
  },
</code></pre>
<p dir="auto">WIth:</p>
<pre><code> activateMonitor: function () {
   if (this.config.turnOffDisplay) {
     // Check if hdmi output is already on
     exec("vcgencmd display_power 1").stdout.on("data", function(data) {
       if (data.indexOf("0x120002") !== -1)
         exec("/opt/vc/bin/tvservice --preferred &amp;&amp; chvt 6 &amp;&amp; chvt 7", null);
     });
   }
 },

 deactivateMonitor: function () {
   if (this.config.turnOffDisplay) {
     exec("vcgencmd display_power 0", null);
   }
 },
</code></pre>
<p dir="auto">However, the node_helper.js language has now changed since the above post to now be:</p>
<pre><code>		if (query.action === "MONITORON")
		{
			exec("tvservice --preferred &amp;&amp; sudo chvt 6 &amp;&amp; sudo chvt 7", opts, function(error, stdout, stderr){ self.checkForExecError(error, stdout, stderr, res); });
			return true;
		}
		if (query.action === "MONITOROFF")
		{
			exec("tvservice -o", opts, function(error, stdout, stderr){ self.checkForExecError(error, stdout, stderr, res); });
			return true;
		}
</code></pre>
<p dir="auto">I’ve little experience with js coding, and wondered if anyone had already updated the above vcgencmd calls to work with the now current node_helper language?  Or if someone could suggest what that language would now be so I don’t break anything ignorantly futzing around?</p>
<p dir="auto">(Of course, the optimum would be to have a config option officially added to Remote-Control to have the option of using <em>tvservice</em> (as the default), or <em>vcgencmd</em> for those of us that <em>tvservice</em> doesn’t work so well for…)</p>
<p dir="auto">Many thanks for any help provided.</p>
<p dir="auto">(Using RPI Zero W / Raspbian Stretch Lite / Dell monitor via HDMI / serveronly mode)</p>
]]></description><link>https://forum.magicmirror.builders/topic/9257/mmm-remote-control-fix-monitor-on-off-tvservice-vcgencmd</link><generator>RSS for Node</generator><lastBuildDate>Mon, 15 Jun 2026 21:04:44 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/9257.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Dec 2018 21:27:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MMM-Remote-Control {fix monitor on&#x2F;off} tvservice --&gt; vcgencmd on Fri, 14 Dec 2018 06:29:13 GMT]]></title><description><![CDATA[<p dir="auto">I should have searched around. This was recently solved with a fork by BKeyport to Remote-Control <a href="https://github.com/BKeyport/MMM-Remote-Control/blob/master/README.md" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
]]></description><link>https://forum.magicmirror.builders/post/48146</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/48146</guid><dc:creator><![CDATA[max64]]></dc:creator><pubDate>Fri, 14 Dec 2018 06:29:13 GMT</pubDate></item></channel></rss>