<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Remotexy will not connect to cloud server]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=1280</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1280&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Remotexy will not connect to cloud server.]]></description>
		<lastBuildDate>Mon, 22 Mar 2021 08:02:15 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Remotexy will not connect to cloud server]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3725#p3725</link>
			<description><![CDATA[<p>Maybe function genie.WriteObject() waits for a response from the display and then exits on timeout, but the timeout is large enough for RemoteXY. Most likely you just need to connect the display.</p>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Mon, 22 Mar 2021 08:02:15 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3725#p3725</guid>
		</item>
		<item>
			<title><![CDATA[Re: Remotexy will not connect to cloud server]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3721#p3721</link>
			<description><![CDATA[<p>Hi, </p><p>Thanks for feedback. <br />I thought that&#039;s what you may have meant by blocking code. I never use the delay() function in my code, I always use the millis() function to create a timer.<br />I have done some more testing, and you may be able to confirm my conclusion.<br />At present I have an Arduino Uno connected to a 4D Systems LCD screen acting as the user interface. This is connected via the serial port of the Uno, this has been working reliably for the past 6 months.<br />I want to introduce remote access to the Uno via RemoteXY.<br />For testing purposes of RemoteXY I have an Arduino Mega with onboard ESP8266 connected via the serial 3 port.<br />I have not physically connected the LCD screen to serial port 0 of the Mega.<br />As part of testing I have strategically cut and paste code from my irrigation system into the Mega in stages until I notice a drop in performance of the RemoteXY connection from my smartphone.<br />Everything has gone well until I pasted this code in:<br /></p><div class="codebox"><pre><code>genie.WriteObject(GENIE_OBJ_USER_LED, 27, -1);       // Turn off Test LED showing START has been selected
genie.WriteObject(GENIE_OBJ_USER_LED, 29, -1);      // Turn off Test LED showing START water sequence bit has been selected 
genie.WriteObject(GENIE_OBJ_USER_LED, 30, -1);     // Turn off Test LED showing Water Cycle Selected bit has been selected</code></pre></div><p>This code is used to write to objects on the LCD screen.<br />Once this code is pasted in I notice the response time from my smartphone drops from 1 second to 4-5 seconds.<br />When I comment out this code the response time improves again.</p><p>These genie.writeobject instructions are numerous throughout my code, so I can see the delay becoming much longer if I pasted in all of my code, to the point where RemoteXY will not connect.</p><p>I am assuming that since the LCD screen is physically not connected to the Mega that perhaps the serial communications is hanging up and creating the blocking delays I do not need.</p><p>The next step of my test is to connect the LCD screen to the Mega via serial 0 and I hope this solves my problem.</p><p>I will let you know how I go.</p>]]></description>
			<author><![CDATA[null@example.com (RobC)]]></author>
			<pubDate>Sun, 21 Mar 2021 04:44:58 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3721#p3721</guid>
		</item>
		<item>
			<title><![CDATA[Re: Remotexy will not connect to cloud server]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3715#p3715</link>
			<description><![CDATA[<p>For example bad code:<br /></p><div class="codebox"><pre><code>void loop () {
  RemoteXY_Handler ();

  if (RemoteXY.button_1 == 1) {  
    // if the button is pressed, the code is blocked for 5 seconds and RemoteXY Handler () is not called
    for (int i=0; i&lt;5; i++) {
      digitalWrite(LED_BUILTIN, HIGH );
      delay (500);
      digitalWrite(LED_BUILTIN, LOW);
      delay (500);
    }
  }

}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Fri, 19 Mar 2021 14:12:23 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3715#p3715</guid>
		</item>
		<item>
			<title><![CDATA[Re: Remotexy will not connect to cloud server]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3704#p3704</link>
			<description><![CDATA[<p>Most likely your code is blocking the main loop() cycle. Not sure how this could happen.</p><br /><p>RemoteXY_Handler () is not called<br />This handler is called in my void loop.</p>]]></description>
			<author><![CDATA[null@example.com (RobC)]]></author>
			<pubDate>Wed, 17 Mar 2021 09:31:13 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3704#p3704</guid>
		</item>
		<item>
			<title><![CDATA[Re: Remotexy will not connect to cloud server]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3703#p3703</link>
			<description><![CDATA[<p>Most likely your code is blocking the main loop() cycle. RemoteXY_Handler () is not called</p>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Wed, 17 Mar 2021 08:11:17 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3703#p3703</guid>
		</item>
		<item>
			<title><![CDATA[Remotexy will not connect to cloud server]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3700#p3700</link>
			<description><![CDATA[<p>I have written a small bit of test code for testing purposes below.<br />I have an Arduino Mega with onboard wifi via the ESP8266 chip. The Arduino and the ESP8266 communicate via the serail 3 port.<br />The test code works fine via the remotexy app on my Android smartphone.<br />Whne i cut and paste my test code and place it into my irrigation system code the app fails to connect to the server. I am not sure why this occurs, can you please assist.</p><p>I&#039;m not sure how to upload an image of the server error codes. I have a jpg file i can share, just dont know how to upload it here.</p><p>I can not upload my irrigation system code as it exceeds the number of allowable bytes. How else can I uplaod my irrigation code?</p><br /><br /><br /><br /><br /><p>This is the test code:</p><div class="codebox"><pre><code>// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_CLOUD

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings 
#define REMOTEXY_SERIAL Serial3
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID &quot;intentionally left blank&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;intentionally left blank&quot;
#define REMOTEXY_CLOUD_SERVER &quot;cloud.remotexy.com&quot;
#define REMOTEXY_CLOUD_PORT 6376
#define REMOTEXY_CLOUD_TOKEN &quot;intentionally left blank&quot;

int led = 13;
int ledstate = 0;


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,0,0,16,0,10,13,0,
  1,9,8,13,26,7,2,37,116,101,
  115,116,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 

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

} RemoteXY;
#pragma pack(pop)

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



void setup() 
{
  RemoteXY_Init (); 

pinMode(led, OUTPUT);
  digitalWrite(led, LOW);
  
  // TODO you setup code
  
}

void loop() 
{ 
  RemoteXY_Handler ();
  
    if (RemoteXY.button_1!=0) 
    {
     if (ledstate == 0)
     {
     digitalWrite(led, HIGH);
     ledstate = 1;
       RemoteXY.button_1 = 0;
     }
     else
     {
     digitalWrite(led, LOW);
     ledstate = 0;
     RemoteXY.button_1 = 0;
     }
    }
    </code></pre></div>]]></description>
			<author><![CDATA[null@example.com (RobC)]]></author>
			<pubDate>Wed, 17 Mar 2021 07:13:01 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3700#p3700</guid>
		</item>
	</channel>
</rss>
