<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — How Arduino can know if Bluethoot RemoteXY App is connected .]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=587&amp;type=atom" />
	<updated>2018-09-29T13:46:55Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=587</id>
		<entry>
			<title type="html"><![CDATA[Re: How Arduino can know if Bluethoot RemoteXY App is connected .]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1831#p1831" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>effevalerio@iol.it wrote:</cite><blockquote><p>and I confirm ;&nbsp; variable &quot;RemoteXY.connect_flag&quot; don&#039;t&nbsp; change with&nbsp; BT status....</p><p>Valerio</p></blockquote></div><p>One of my applications is for controlling two SKY TV boxes.&nbsp; They feed what I call &quot;Green Zone&quot; and &quot;Red Zone&quot; in a sports bar.</p><p>So my channel selection panel has a large LED behind the buttons, which I colour Green when the interface is switched to &quot;Green Zone&quot;, and Red when switched to &quot;Red Zone&quot;.&nbsp; However, if the RemoteXY.connect_flag goes OFF, I colour the LED Blue. And it all works as expected, except that the connect_flag does not come back on again, after it has gone off.</p><p>This can happen because they use the same iPad for their P.O.S. terminal, so thay switch between the apps, and RemoteXY can lose connection.</p><p>Everyone who uses the app knows to &quot;Stop&quot; it, and &quot;Start&quot; it again to restore the correct Green/Red status, which is only displayed if connect_flag is true.</p><p>One thing that strikes me is - how are you testing the flag ?</p><p>If you use...</p><p>if (RemoteXY.connect_flag = 1) { .....</p><p>...that single &quot;=&quot; is the assignment operator, so it will turn the connect_flag on, and the &quot;if&quot; statement will <span class="bbu">always</span> evaluate as true.</p><p>The correct syntax is ...</p><p>if (RemoteXY.connect_flag == 1) { .....</p><p>I always read the == as &quot;is equal to&quot;, and it helps to ensure I use the correct syntax</p>]]></content>
			<author>
				<name><![CDATA[Daba]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=630</uri>
			</author>
			<updated>2018-09-29T13:46:55Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1831#p1831</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How Arduino can know if Bluethoot RemoteXY App is connected .]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1830#p1830" />
			<content type="html"><![CDATA[<p>Hi DABA OK I will see if someting happen....</p><p>and OK my sintax about&nbsp; Serial.print(RemoteXY.connect_flag) was wong in my post (not in my sketch....) ;-)</p><p>and I confirm ;&nbsp; variable &quot;RemoteXY.connect_flag&quot; don&#039;t&nbsp; change with&nbsp; BT status....</p><p>Thanks again...</p><p>Valerio</p>]]></content>
			<author>
				<name><![CDATA[effevalerio@iol.it]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=653</uri>
			</author>
			<updated>2018-09-27T15:42:19Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1830#p1830</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How Arduino can know if Bluethoot RemoteXY App is connected .]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1828#p1828" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>effevalerio@iol.it wrote:</cite><blockquote><p>Hi DABA many thanks for your reply, </p><p>...before to write my post I tryed to add to my sketch follow &quot;monitor line&quot;:</p><p> <strong>SerialPrint(RemoteXY.connect_flag);</strong></p><p>then connect and disconnect the BT app, but nothing happen...</p><p><strong><span style="color: red">may I suggest </span></strong>to add in &quot;Controls&quot; someting like a &quot;Self Alternate Output Variable&quot; <br />that switch between ON and OFF every 1 second like a BLINK<br />in this way, if the connection will be lost, the related RemoteXY Output variable <br />will stop to BLINK, in this way the running skecth, with few appropriate<br />lines of code, can understand when connection is lost.</p><p>Many thanks for your attention.</p><p>Valerio</p></blockquote></div><p>You can suggest as much as you want, but unless the developer of RemoteXY returns to support his creation, we are stuck with what we have.&nbsp; He appears to have abandoned it, and hasn&#039;t been seen on here since April.</p><p>And your command looks a bit off, try</p><div class="codebox"><pre><code>Serial.print(RemoteXY.connect_flag);</code></pre></div><p>that . is important, so is the lower-case p on print.</p><p>I assume you have also &quot;started&quot; your serial comms in setup()</p><div class="codebox"><pre><code>Serial.begin(baudrate);</code></pre></div><p>choose your own baudrate</p>]]></content>
			<author>
				<name><![CDATA[Daba]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=630</uri>
			</author>
			<updated>2018-09-26T07:31:45Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1828#p1828</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How Arduino can know if Bluethoot RemoteXY App is connected .]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1825#p1825" />
			<content type="html"><![CDATA[<p>Hi DABA many thanks for your reply, </p><p>...before to write my post I tryed to add to my sketch follow &quot;monitor line&quot;:</p><p> <strong>SerialPrint(RemoteXY.connect_flag);</strong></p><p>then connect and disconnect the BT app, but nothing happen...</p><p>may I suggest to add in &quot;Controls&quot; someting like a &quot;Self Alternate Output Variable&quot; <br />that switch between ON and OFF every 1 second like a BLINK<br />in this way, if the connection will be lost, the related RemoteXY Output variable <br />will stop to BLINK, in this way the running skecth, with few appropriate<br />lines of code, can understand when connection is lost.</p><p>Many thanks for your attention.</p><p>Valerio</p>]]></content>
			<author>
				<name><![CDATA[effevalerio@iol.it]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=653</uri>
			</author>
			<updated>2018-09-25T07:01:26Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1825#p1825</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How Arduino can know if Bluethoot RemoteXY App is connected .]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1822#p1822" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>effevalerio@iol.it wrote:</cite><blockquote><p>Hi I need to know (in Arduino)&nbsp; if the my RemoteXY app is connected or not via Bluethoot software serial.<br />There is a way ?</p><p>Many thanks to all of you.</p><p>Valerio</p></blockquote></div><p>Yes, and no....</p><p>If you look at the last entry in the RemoteXY configuration block, you will see</p><p>&nbsp; &nbsp; // other variable<br />&nbsp; uint8_t connect_flag;&nbsp; // =1 if wire connected, else =0 </p><p>This sort of half works correctly : the &quot;connect_flag&quot; is true (non-zero) when connected, and goes false (zero) if the connection is lost.</p><p>However, I have discovered that if the app connects again, for example, after switching to another app on your phone, your serial communications restarts, but the &quot;connect_flag&quot; stays false.&nbsp; In these scenarios, you have to &quot;Stop&quot; the app, and restart it, to get the connect_flag true again.</p><p>I haven&#039;t delved into the RemoteXY handling code to find the reason, but that must be where the problem exists, because it can&#039;t be the mobile app writing that flag&#039;s value...</p>]]></content>
			<author>
				<name><![CDATA[Daba]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=630</uri>
			</author>
			<updated>2018-09-24T22:02:35Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1822#p1822</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How Arduino can know if Bluethoot RemoteXY App is connected .]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=1821#p1821" />
			<content type="html"><![CDATA[<p>Hi I need to know (in Arduino)&nbsp; if the my RemoteXY app is connected or not via Bluethoot software serial.<br />There is a way ?</p><p>Many thanks to all of you.</p><p>Valerio</p>]]></content>
			<author>
				<name><![CDATA[effevalerio@iol.it]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=653</uri>
			</author>
			<updated>2018-09-24T13:17:15Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=1821#p1821</id>
		</entry>
</feed>
