<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[REXYGEN Community Forum / HMI on Raspberry Pi]]></title>
	<link rel="self" href="https://www.rexygen.com/oldforum/extern.php?action=feed&amp;tid=283&amp;type=atom"/>
	<link href="http://www.rexygen.com/oldforum/viewtopic.php?id=283"/>
	<updated>2016-11-29T16:33:03Z</updated>
	<generator>FluxBB</generator>
	<id>http://www.rexygen.com/oldforum/viewtopic.php?id=283</id>
	<entry>
		<title type="html"><![CDATA[Re: HMI on Raspberry Pi]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1264#p1264"/>
		<content type="html"><![CDATA[<p>Awesome, your REX.HMI.setTargetUrl example did the job, except I had to change it to the following to eliminate all errors:</p><div class="codebox"><pre><code>REX.HMI.setTargetUrl(&#039;ws://192.168.1.1:8008/rex&#039;,true);</code></pre></div><p>Thanks for your help.</p>]]></content>
		<author>
			<name><![CDATA[alex]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=120</uri>
		</author>
		<updated>2016-11-29T16:33:03Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1264#p1264</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: HMI on Raspberry Pi]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1229#p1229"/>
		<content type="html"><![CDATA[<p>Hello Alex,</p><div class="quotebox"><blockquote><div><p>1) When you download the executive and HMI to the target (Raspberry PI), where are the .html files saved? I can&#039;t find them anywhere.</p></div></blockquote></div><p>There are two ways to feed the built-in webserver of RexCore with HMI (HTML) files:</p><ol class="alpha"><li><p>When you press <em> Compile &amp; Download </em> button in the RexDraw all the HMI files from the <em>HMIDir</em> directory (see the documentation for the <a href="https://www.rexcontrols.com/media/2.50.1/doc/ENGLISH/MANUALS/BRef/HMI.html" rel="nofollow">HMI</a> block) are packed and downloaded as one <em>/rex/rexcore/hmi.rex</em> file. </p></li><li><p>If you want to add some additional files (large images, some configuration files, etc.) you can copy them manually to the&#160; <em>/rex/www</em> directory on the target device. These files are available as a static content independent of the current executive running on the target.</p></li></ol><div class="quotebox"><blockquote><div><p>2) I want to allow only some of the HMI files to be viewed from the internet? I thought I could do this with a separate webserver (nginx) using port 8080 and copying all HTML source files to that folder. The files display fine, but they aren&#039;t actually connecting to the Rex Core (error message &quot;connecting to WS server failed). I know I can just port forward my router to 8008, but I don&#039;t want to make all HMI files available online, only some of them.</p></div></blockquote></div><p>The HMI is communicating with the target device over the WebSocket. You can serve all the HMI files from arbitrary webserver but you have to redirect the WebSocket connection. You can setup some proxy in the NGINX server or you can change the URL where the HMI is connecting to. </p><ul><li><p>If you have HMI from the RexHMI Designer, you can simply change the &#039;target_url&#039; option. (e.g. Your NGINX server is running on the 192.168.1.1:8080 so you set <em>target_url</em> to 192.168.1.1:8008, which is where the webserver of RexCore is listening)</p></li><li><p>If you use WebBuDi or WebWatch you have to enable the <em>script</em> tag and call the <em>REX.HMI.setTargetUrl</em> function in each generated *.html file in the HMIDir directory. (See the example bellow)</p><ol class="decimal"><li><p>Create you HMI</p></li><li><p>Edit all the *.html file in the <em>./hmi/</em> directory</p></li><li><p>Disable the auto-generation of the HMI by unchecking the <em>GenerateWebWatch</em> and <em>GenerateRexHMI</em> option in the <em>HMI</em> function block</p></li><li><p>Compile and Download your executive</p></li></ol></li></ul><div class="codebox"><pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
    REX.HMI.init = function(){
        REX.HMI.setTargetUrl(&#039;ws://192.168.1.1:8008&#039;,true);
    }
&lt;/script&gt;</code></pre></div>]]></content>
		<author>
			<name><![CDATA[osevera]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=5</uri>
		</author>
		<updated>2016-11-20T23:07:55Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1229#p1229</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[HMI on Raspberry Pi]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1224#p1224"/>
		<content type="html"><![CDATA[<p>Hello,</p><p>I have two questions:</p><p>1) When you download the executive and HMI to the target (Raspberry PI), where are the .html files saved? I can&#039;t find them anywhere.</p><p>2) I want to allow only some of the HMI files to be viewed from the internet? I thought I could do this with a separate webserver (nginx) using port 8080 and copying all HTML source files to that folder. The files display fine, but they aren&#039;t actually connecting to the Rex Core (error message &quot;connecting to WS server failed). I know I can just port forward my router to 8008, but I don&#039;t want to make all HMI files available online, only some of them.</p><p>I am using v2.50 RexDraw and v2.50 RexCore.</p>]]></content>
		<author>
			<name><![CDATA[alex]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=120</uri>
		</author>
		<updated>2016-11-20T16:16:13Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1224#p1224</id>
	</entry>
</feed>
