<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — two users]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1353&amp;type=atom" />
	<updated>2021-08-05T11:02:46Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1353</id>
		<entry>
			<title type="html"><![CDATA[Re: two users]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4178#p4178" />
			<content type="html"><![CDATA[<p>I checked now does not work well</p>]]></content>
			<author>
				<name><![CDATA[radaizzhrea]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1898</uri>
			</author>
			<updated>2021-08-05T11:02:46Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4178#p4178</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: two users]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4177#p4177" />
			<content type="html"><![CDATA[<p>Yes, this is an unpleasant feature of synchronization, it is better not to use buttons. We need to think about how this can be solved.</p>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2021-08-05T10:22:20Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4177#p4177</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: two users]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4176#p4176" />
			<content type="html"><![CDATA[<p>I understood a lot of thanks for the help</p>]]></content>
			<author>
				<name><![CDATA[radaizzhrea]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1898</uri>
			</author>
			<updated>2021-08-05T10:11:28Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4176#p4176</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: two users]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4175#p4175" />
			<content type="html"><![CDATA[<p>OK, I think I see the issue.&nbsp; Buttons do <strong>not</strong> appear properly synced across multiple &quot;users/phones&quot;.&nbsp; So since your code is seeing that all buttons are 0 unless pressed, then if a button is pressed on one phone, thus sending a 1 to a pin, it is immediately set back to 0 by the 2nd phone.</p><p>If <strong>both</strong> &quot;users/phones&quot; press the same button then it will work as expected... but that is not an ideal solution <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>So unless the developer can add that button sync into a future version, you can either use switches instead of buttons (they do sync from my experience).</p><p>Or if you don&#039;t need a response from button release, you can use a button press to toggle a digital pin state.&nbsp; EG. each button press (from same or 2nd phone) changes the pin state.</p><div class="codebox"><pre><code>void loop() { 
  RemoteXY_Handler ();

  if (RemoteXY.button_1 == 1){ // Only trigger when button pressed
    digitalWrite(PIN_BUTTON_1, !digitalRead(PIN_BUTTON_1));  // Toggle pin state
  }
    if (RemoteXY.button_2 == 1){ // Only trigger when button pressed
    digitalWrite(PIN_BUTTON_2, !digitalRead(PIN_BUTTON_2));  // Toggle pin state
  }
    if (RemoteXY.button_3 == 1){ // Only trigger when button pressed
    digitalWrite(PIN_BUTTON_3, !digitalRead(PIN_BUTTON_3));  // Toggle pin state
  }
    if (RemoteXY.button_4 == 1){ // Only trigger when button pressed
    digitalWrite(PIN_BUTTON_4, !digitalRead(PIN_BUTTON_4));  // Toggle pin state
  }
} </code></pre></div>]]></content>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2021-08-05T09:30:29Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4175#p4175</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: two users]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4165#p4165" />
			<content type="html"><![CDATA[<p>This is the full sketch</p><div class="codebox"><pre><code>*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT
#include &lt;ESP8266WiFi.h&gt;

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings 
#define REMOTEXY_WIFI_SSID &quot;RAMPA3&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot;
#define REMOTEXY_SERVER_PORT 8080


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,4,0,0,0,114,0,13,16,1,
  1,0,16,2,33,33,2,31,226,172,
  134,239,184,143,215,148,215,168,215,158,
  215,148,226,172,134,239,184,143,0,1,
  0,2,37,26,26,2,31,226,172,133,
  239,184,143,215,164,215,170,215,153,215,
  151,215,148,0,1,0,36,37,26,26,
  2,31,215,166,215,153,215,147,215,149,
  215,147,32,226,158,161,239,184,143,0,
  1,0,17,64,31,31,2,31,226,172,
  135,239,184,143,215,148,215,149,215,168,
  215,147,215,148,226,172,135,239,184,143,
  0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t button_1; // =1 if button pressed, else =0 
  uint8_t button_2; // =1 if button pressed, else =0 
  uint8_t button_3; // =1 if button pressed, else =0 
  uint8_t button_4; // =1 if button pressed, else =0 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#define PIN_BUTTON_1 D1
#define PIN_BUTTON_2 D6
#define PIN_BUTTON_3 D5
#define PIN_BUTTON_4 D2


void setup() 
{
  RemoteXY_Init (); 
  
  pinMode (PIN_BUTTON_1, OUTPUT);
  pinMode (PIN_BUTTON_2, OUTPUT);
  pinMode (PIN_BUTTON_3, OUTPUT);
  pinMode (PIN_BUTTON_4, OUTPUT);
  
  // TODO you setup code
  
}

void loop() 
{ 
  RemoteXY_Handler ();
  
  digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?HIGH:LOW);
  digitalWrite(PIN_BUTTON_2, (RemoteXY.button_2==0)?HIGH:LOW);
  digitalWrite(PIN_BUTTON_3, (RemoteXY.button_3==0)?HIGH:LOW);
  digitalWrite(PIN_BUTTON_4, (RemoteXY.button_4==0)?HIGH:LOW);
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay() 


} </code></pre></div>]]></content>
			<author>
				<name><![CDATA[radaizzhrea]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1898</uri>
			</author>
			<updated>2021-08-04T05:40:31Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4165#p4165</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: two users]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4162#p4162" />
			<content type="html"><![CDATA[<p>Well... your code posted above (<em>and unformatted - Use the &lt;&gt; button in the post editor</em>) wont do anything with the partial code shown, so not sure how anyone can assist further.</p>]]></content>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2021-08-03T18:19:18Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4162#p4162</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: two users]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4161#p4161" />
			<content type="html"><![CDATA[<p>When I connect two phones then the operation of the relay stops when I disconnect the other phone everything works great</p>]]></content>
			<author>
				<name><![CDATA[radaizzhrea]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1898</uri>
			</author>
			<updated>2021-08-03T14:21:47Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4161#p4161</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: two users]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4131#p4131" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>radaizzhrea wrote:</cite><blockquote><p>How do i add the correct command that will work with two users</p></blockquote></div><p>I don&#039;t think you need any special &quot;command&quot; or code... I can use the same project (at least via WiFi) with multiple devices (phones/tablets) simultaneously.</p>]]></content>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2021-07-25T08:24:14Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4131#p4131</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[two users]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4128#p4128" />
			<content type="html"><![CDATA[<p>Hi<br />This is my sketch setting<br />How do i add the correct command that will work with two users<br />Thanks for the help</p><br /><br /><br /><p>// RemoteXY select connection mode and include library<br />#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT<br />#include &lt;ESP8266WiFi.h&gt;</p><p>#include &lt;RemoteXY.h&gt;</p><p>// RemoteXY connection settings<br />#define REMOTEXY_WIFI_SSID &quot;RAMPA1&quot;<br />#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot;<br />#define REMOTEXY_SERVER_PORT 8080</p><br /><p>// RemoteXY configurate <br />#pragma pack(push, 1)<br />uint8_t RemoteXY_CONF[] =<br />&nbsp; { 255,4,0,0,0,114,0,11,16,1,<br />&nbsp; 1,0,16,2,33,33,2,31,226,172,<br />&nbsp; 134,239,184,143,215,148,215,168,215,158,<br />&nbsp; 215,148,226,172,134,239,184,143,0,1,<br />&nbsp; 0,2,37,26,26,2,31,226,172,133,<br />&nbsp; 239,184,143,215,164,215,170,215,153,215,<br />&nbsp; 151,215,148,0,1,0,36,37,26,26,<br />&nbsp; 2,31,215,166,215,153,215,147,215,149,<br />&nbsp; 215,147,32,226,158,161,239,184,143,0,<br />&nbsp; 1,0,17,64,31,31,2,31,226,172,<br />&nbsp; 135,239,184,143,215,148,215,149,215,168,<br />&nbsp; 215,147,215,148,226,172,135,239,184,143,<br />&nbsp; 0 };</p><p>// this structure defines all the variables and events of your control interface<br />struct {</p><p>&nbsp; &nbsp; // input variables<br />&nbsp; uint8_t button_1; // =1 if button pressed, else =0<br />&nbsp; uint8_t button_2; // =1 if button pressed, else =0<br />&nbsp; uint8_t button_3; // =1 if button pressed, else =0<br />&nbsp; uint8_t button_4; // =1 if button pressed, else =0</p><p>&nbsp; &nbsp; // other variable<br />&nbsp; uint8_t connect_flag;&nbsp; // =1 if wire connected, else =0</p><p>} RemoteXY;<br />#pragma pack(pop)</p>]]></content>
			<author>
				<name><![CDATA[radaizzhrea]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1898</uri>
			</author>
			<updated>2021-07-24T18:03:36Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4128#p4128</id>
		</entry>
</feed>
