<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Using RemoteXY with Arduino BLE and PlatformIO]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=1324</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1324&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Using RemoteXY with Arduino BLE and PlatformIO.]]></description>
		<lastBuildDate>Sat, 11 Dec 2021 01:27:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4394#p4394</link>
			<description><![CDATA[<p>Hello epson.&nbsp; </p><p>In order to NOT clutter up someone else&#039;s topic, please create Your Own New Topic and supply further details about your question/issue.</p><p>Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (Gunner)]]></author>
			<pubDate>Sat, 11 Dec 2021 01:27:04 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4394#p4394</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4391#p4391</link>
			<description><![CDATA[<p>Hi!</p><p>we are after using an original Arduino Nano 33 BLE with RemoteXY, any one has done?<br />Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (espon)]]></author>
			<pubDate>Fri, 10 Dec 2021 15:26:46 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4391#p4391</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4045#p4045</link>
			<description><![CDATA[<p>Hello, <br /></p><div class="quotebox"><blockquote><p>Did I understand correctly that all the tested boards were BLE Nano from AliExpress ?<br />We will receive one soon and can test it.</p></blockquote></div><p>&nbsp; &nbsp; Yes, that is correct!</p><p>&nbsp; &nbsp; I agree that when the message is smaller than 20, it works. I&#039;ll make a few measurements using LightBlue to validate that a message bigger than 20 is sent the timeout is activated. However, every once in a while (1 in every 10 to 20 tries) it actually works. So I don&#039;t know if it is a time out or a package loss.</p>]]></description>
			<author><![CDATA[null@example.com (luiz.villa)]]></author>
			<pubDate>Thu, 10 Jun 2021 14:02:14 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4045#p4045</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4043#p4043</link>
			<description><![CDATA[<div class="quotebox"><cite>luiz.villa wrote:</cite><blockquote><p>Hello everyone, </p><p>&nbsp; &nbsp; &nbsp;I&#039;ve tested remoteXY with some students this morning (we are building an arduino-based drone). I&#039;ve observed the same behavior with several different cell phones. So, the issue is not on my hardware. </p><p>&nbsp; &nbsp; &nbsp; cheers<br />&nbsp; &nbsp; &nbsp; &nbsp; Luiz</p></blockquote></div><p>Did I understand correctly that all the tested boards were BLE Nano from AliExpress ?<br />We will receive one soon and can test it.<br />Now I can assume that the CC2540 firmware has a small buffer for data transfer and the entire package does not fit into it. BLE protocol transmits 20 bytes at a time, if there is more data, then a buffer is required to store them.</p>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Thu, 10 Jun 2021 12:55:21 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4043#p4043</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4042#p4042</link>
			<description><![CDATA[<p>Hello everyone, </p><p>&nbsp; &nbsp; &nbsp;I&#039;ve tested remoteXY with some students this morning (we are building an arduino-based drone). I&#039;ve observed the same behavior with several different cell phones. So, the issue is not on my hardware. </p><p>&nbsp; &nbsp; &nbsp; cheers<br />&nbsp; &nbsp; &nbsp; &nbsp; Luiz</p>]]></description>
			<author><![CDATA[null@example.com (luiz.villa)]]></author>
			<pubDate>Thu, 10 Jun 2021 12:37:37 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4042#p4042</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4041#p4041</link>
			<description><![CDATA[<p>It seems that the size of the RemoteXY_CONF is the key to understand the issue. <br />Here are examples that work every single time I try to connect to the BLE device: </p><p>Button <br /></p><div class="codebox"><pre><code>// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,0,0,13,0,11,13,0,
  1,0,40,23,12,12,2,31,88,0 };</code></pre></div><p>Select</p><div class="codebox"><pre><code>// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,0,0,11,0,11,13,0,
  3,3,54,19,8,22,2,26 }; </code></pre></div><p>Joystick</p><div class="codebox"><pre><code>#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,2,0,0,0,12,0,11,13,0,
  5,0,36,16,30,30,2,26,31 }; </code></pre></div><p>Slider</p><div class="codebox"><pre><code>#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,0,0,11,0,11,13,0,
  4,0,43,22,7,18,2,26 }; </code></pre></div><p>Edit field</p><div class="codebox"><pre><code>#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,11,0,0,0,13,0,11,13,0,
  7,36,36,26,20,5,2,26,2,11 };  </code></pre></div><p>RGB button</p><div class="codebox"><pre><code>// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,3,0,0,0,11,0,11,13,0,
  6,0,38,21,20,20,2,26 };</code></pre></div><p>Arc Level </p><div class="codebox"><pre><code>#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,0,0,1,0,11,0,11,13,0,
  66,130,41,25,13,10,2,26 };</code></pre></div><p>Online Graph</p><div class="codebox"><pre><code>#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,0,0,4,0,11,0,11,13,0,
  68,17,33,22,20,20,8,36 };</code></pre></div><p>And here are cases where <em>it does not work:</em> </p><p><strong>ON-OFF button </strong></p><div class="codebox"><pre><code>// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,0,0,20,0,11,13,0,
  2,0,34,24,22,11,2,26,31,31,
  79,78,0,79,70,70,0 };</code></pre></div><p><strong>2 sliders<br /></strong></p><div class="codebox"><pre><code>#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,2,0,0,0,19,0,11,13,0,
  4,0,23,20,7,18,2,26,4,0,
  46,21,7,18,2,26 };</code></pre></div><p><strong>A slider and a joystick</strong></p><div class="codebox"><pre><code>#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,3,0,0,0,20,0,11,13,0,
  4,0,20,13,5,41,2,26,5,0,
  46,9,48,48,2,26,31 }; </code></pre></div><br /><p>The obvious different for me is the size of the message. The system works for short initialization messages. Could it be the bluetooth is &quot;too slow&quot;? Have you ever experienced this type of issue? Is there a way to extend the timeout?</p><p>As a reference the whole code is available here: <a target="_blank" href="https://github.com/luizvilla/remoteXY_BLE_nano">https://github.com/luizvilla/remoteXY_BLE_nano</a></p>]]></description>
			<author><![CDATA[null@example.com (luiz.villa)]]></author>
			<pubDate>Wed, 09 Jun 2021 23:33:59 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4041#p4041</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4040#p4040</link>
			<description><![CDATA[<p>This code also works every single time I try to connect: </p><div class="codebox"><pre><code>//---------------small joystick-----------------
// RemoteXY configurate  
// #pragma pack(push, 1)
// uint8_t RemoteXY_CONF[] =
//   { 255,2,0,0,0,12,0,11,13,0,
//   5,0,12,16,21,21,2,26,31 };
  
//----------------large joystick-------------------
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,2,0,0,0,12,0,11,13,0,
  5,0,23,5,52,52,2,26,31 }; 

// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  int8_t joystick_2_x; // =-100..100 x-coordinate joystick position 
  int8_t joystick_2_y; // =-100..100 y-coordinate joystick position 

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

} RemoteXY;
#pragma pack(pop) </code></pre></div><p>&nbsp; &nbsp; &nbsp;It is a joystick with different sizes. First small and then large. Both cases work.</p>]]></description>
			<author><![CDATA[null@example.com (luiz.villa)]]></author>
			<pubDate>Wed, 09 Jun 2021 22:45:01 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4040#p4040</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4039#p4039</link>
			<description><![CDATA[<p>Hello everyone, </p><p>&nbsp; &nbsp; &nbsp; &nbsp;After a long pause I&#039;m back onto the issue. I have found some interesting things. Here are my updates: </p><ul><li><p>I have updated my library to the latest version.</p></li><li><p>I have written the changes to the library (Serial. instead of serial-&gt;)</p></li></ul><p>&nbsp; &nbsp; &nbsp; &nbsp; Now, here&#039;s an interesting thing. Depending on the modules I use, I actually get to connect easily to the BLE or not. When I use the following code: </p><div class="codebox"><pre><code>// // RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,0,0,11,0,11,13,0,
  4,0,16,20,7,18,2,26 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  int8_t slider_1; // =0..100 slider position 

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

} RemoteXY;
#pragma pack(pop) </code></pre></div><p>&nbsp; &nbsp; I get through every single time I try to connect. This is a slider code. </p><p>&nbsp; &nbsp; If I use this code: </p><div class="codebox"><pre><code>// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,5,0,0,0,38,0,11,13,0,
  5,0,9,10,30,30,2,26,31,5,
  0,60,10,30,30,2,26,31,2,0,
  36,52,27,5,2,26,31,31,79,78,
  0,79,70,70,0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  int8_t joystick_1_x; // =-100..100 x-coordinate joystick position 
  int8_t joystick_1_y; // =-100..100 y-coordinate joystick position 
  int8_t joystick_2_x; // =-100..100 x-coordinate joystick position 
  int8_t joystick_2_y; // =-100..100 y-coordinate joystick position 
  uint8_t switch_1; // =1 if switch ON and =0 if OFF 

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

} RemoteXY;
#pragma pack(pop) </code></pre></div><p>&nbsp; &nbsp; &nbsp; I never get through. This is two joysticks with an on-off button. </p><p>If I try a simpler code, just an on-off button: </p><div class="codebox"><pre><code>// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,0,0,20,0,11,13,0,
  2,0,12,5,22,11,2,26,31,31,
  79,78,0,79,70,70,0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t switch_1; // =1 if switch ON and =0 if OFF 

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

} RemoteXY;
#pragma pack(pop) </code></pre></div><p>&nbsp; &nbsp; &nbsp; I still get nothing.</p><p>&nbsp; &nbsp; So, it seems there is a link between the coding and the correct operation of remotexy in my case. I&#039;ll keep searching.</p>]]></description>
			<author><![CDATA[null@example.com (luiz.villa)]]></author>
			<pubDate>Wed, 09 Jun 2021 22:34:20 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4039#p4039</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4018#p4018</link>
			<description><![CDATA[<div class="quotebox"><cite>luiz.villa wrote:</cite><blockquote><p>Hello remoteXY team, </p><p>&nbsp; &nbsp; &nbsp; Thank you so much for your update. I&#039;ve just implemented your changes. However I do not have the<strong> RemoteXYStream_HardwareSerial.h </strong>file. I had to manually change <strong>RemoteXY_Serial.h</strong> and <strong>serial.h</strong>.</p></blockquote></div><p>Sorry, I wrote about the new 3.x.x beta library <a target="_blank" href="https://remotexy.com/en/library/">https://remotexy.com/en/library/</a><br />Now we are updating only this version. Soon it will be the main version.<br />You can use it.</p><p>What I wrote about trying to change the library is for an experiment. Thank you very much for trying!!<br />I&#039;m surprised. The code compiles for your board in the same way as for a regular Nano and should work in both cases. This requires a lot of study and testing. We will not add this quick solution to the library until we understand why this is happening. This may not work for other users. </p><p>There may be a problem with the firmware of the bluetooth chip CC2540. It is the chip CC2540 that determines where to send Serial traffic. If bluetooth connected then traffic go to BLE, else to USB. Your board is similar to the dfrobot board at <a target="_blank" href="https://www.dfrobot.com/product-1122.html">https://www.dfrobot.com/product-1122.html</a> There it is possible to find some tutorial and firmware of the chip CC2540.</p>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Mon, 31 May 2021 13:36:40 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4018#p4018</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4016#p4016</link>
			<description><![CDATA[<div class="quotebox"><cite>luiz.villa wrote:</cite><blockquote><p> I do agree that I&#039;ve sent data on the serial in the initialization, but that is the sole moment I do so. Thus, there is no more crosstalk on the serial after this moment.</p></blockquote></div><p>Yes, that is what I was referring to: Your needing to attempt multiple App connections.&nbsp; Your Serial initialization and print is really an unnecessary and avoidable blip to obfuscate the testing results.&nbsp; One could flash the onboard LED as a initialized notification instead.</p><p>But with those two lines in there, and depending on timing with boot and pressing the project button on the App, the GUI and Serial initialization could be happening close enough at boot to cause issues.&nbsp; Something similar sometimes happens at boot with my ESP32 dual WiFi/BLE project I posted here... although in my case it is the radio that is shared.</p><p>As for the board, yes, that is all on them... and you for choosing it <img src="https://forum.remotexy.com/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" />&nbsp; JK..&nbsp; I also like checking out new unique devices, but just got burned too many times with &quot;great on paper, not so in reality&quot; that I generally stick with the ESP32 now as it has it all, done right, and relatively cheap.</p><p>Looking forward to your results.</p>]]></description>
			<author><![CDATA[null@example.com (Gunner)]]></author>
			<pubDate>Mon, 31 May 2021 02:48:21 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4016#p4016</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4014#p4014</link>
			<description><![CDATA[<p>Hello, </p><p>&nbsp; I tried with another Nano BLE and I had the same connection issue. <br />&nbsp; <br />&nbsp; &nbsp; @Gunner: Well, I suppose the issue here is that the manufacturer has put all its eggs on the same basket. Thus, the same serial connection is used by both the USB and the bluetooth. Just to be clear, this is not my choice but rather a specificity of the board itself. <br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp;I do agree that I&#039;ve sent data on the serial in the initialization, but that is the sole moment I do so. Thus, there is no more crosstalk on the serial after this moment. I&#039;m going to check into more detail what is the messages that are exchanged between the Nano BLE and the phone. I&#039;ll post the progress here. <br />&nbsp; &nbsp; &nbsp; My tests will include different types of setups and see if there&#039;s a correlation between the number of elements and the initialization issue. </p><p>&nbsp; &nbsp; &nbsp;I&#039;ll keep you posted. </p><p>&nbsp; &nbsp; &nbsp; &nbsp;Cheers<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Luiz</p>]]></description>
			<author><![CDATA[null@example.com (luiz.villa)]]></author>
			<pubDate>Sun, 30 May 2021 22:35:56 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4014#p4014</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4013#p4013</link>
			<description><![CDATA[<div class="quotebox"><cite>luiz.villa wrote:</cite><blockquote><p>I do get it to work, but I need to try 5 to 10 times in average to connect to the Nano BLE device</p></blockquote></div><p>Perhaps because you are still doing this &quot;bad thing&quot; over a shared Serial connection <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><div class="quotebox"><cite>luiz.villa wrote:</cite><blockquote><p>void setup() {<br />&nbsp; // put your setup code here, to run once:</p><p><strong>&nbsp; Serial.begin(9600);<br />&nbsp; Serial.println(&quot;INITIALIZING&quot;);</strong></p><p>&nbsp; RemoteXY_Init ();&nbsp; </p><p>}</p></blockquote></div><p>I didn&#039;t follow the changes you did in the library... admittedly due to TL:DR&nbsp; My bad.</p><p>However, there are some indisputable facts going on here...</p><p>- Your MCU shares the <strong>same</strong> Serial pins as the USB link.&nbsp; </p><p>- And then you enable the Serial functionality, followed by the string &quot;INITIALIZING&quot; that also communicates that data across those <strong>same</strong> Serial Pins</p><p>- Therefore, <strong>both</strong> the USB (to your IDE Serial monitor) and the BLE module (to the App) are transmitting that string of data.&nbsp; And if that happens at the <strong>same</strong> time as the library is doing it&#039;s thing in the background (transmitting GUI data and whatnot) over the <strong>same</strong> Serial link to the App... well, then glitches happen, timeouts occur, etc.</p><p>&quot;Fixing&quot; a library &quot;issue&quot; so it may sometimes allow bad coding to get away with something (assuming that is what you did, again TL:DR) is not what I would recommend, when the simple rule of <em>&quot;Don&#039;t use the same Serial channel for more than one thing at a time&quot;</em> has always been around as long as Serial communication has.</p><p>But that is just my two bits <img src="https://forum.remotexy.com/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p>]]></description>
			<author><![CDATA[null@example.com (Gunner)]]></author>
			<pubDate>Sun, 30 May 2021 18:55:05 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4013#p4013</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4012#p4012</link>
			<description><![CDATA[<p>Hello again, </p><p>&nbsp; &nbsp; &nbsp; I&#039;ve played around a little bit with the code. I do get it to work, but I need to try 5 to 10 times in average to connect to the Nano BLE device. I&#039;m going to try this out with other devices to see if it is a glitch or not. The errors it receives are basically the same timeout, CRC and timeout. If you integrate support for this board into your code, maybe you have to give it a little more time for the timeout. I will let you know how this goes as I run some tests. </p><p>&nbsp; &nbsp; Cheers<br />&nbsp; &nbsp; &nbsp;Luiz</p>]]></description>
			<author><![CDATA[null@example.com (luiz.villa)]]></author>
			<pubDate>Sun, 30 May 2021 12:31:04 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4012#p4012</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4011#p4011</link>
			<description><![CDATA[<p>Hello everyone, </p><p>&nbsp; &nbsp;I&#039;ve made a pull request of these changes onto the ofificial RemoteXY Arduino library. Here&#039;s the link to the pull request: </p><p><a target="_blank" href="https://github.com/RemoteXY/RemoteXY-Arduino-library/pull/10">https://github.com/RemoteXY/RemoteXY-Ar … ry/pull/10</a></p><p>&nbsp; &nbsp; &nbsp;Thanks everyone for this. Hope this can help other people as well. </p><p>Cheers<br /> Luiz</p>]]></description>
			<author><![CDATA[null@example.com (luiz.villa)]]></author>
			<pubDate>Sun, 30 May 2021 12:01:01 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4011#p4011</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using RemoteXY with Arduino BLE and PlatformIO]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4010#p4010</link>
			<description><![CDATA[<p>Now comes the consolidating part. </p><p>I&#039;ve added the following changes to the code: </p><p>RemoteXY.h</p><div class="codebox"><pre><code>/* RemoteXY.h 
   A RemoteXY Library - Remote device control
   version 2.3.5ESP32   
   ===========================================================
   For use RemoteXY library visit website http://remotexy.com
   This website will help you use the library for configuring 
   a remote control from a smartphone or tablet.
   
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
        
   Supported modes: 
   All boards:
    #define REMOTEXY_MODE__HARDSERIAL 
    #define REMOTEXY_MODE__SOFTSERIAL
    #define REMOTEXY_MODE__ETHERNET_LIB
    #define REMOTEXY_MODE__ETHERNET_LIB_CLOUD 
    #define REMOTEXY_MODE__ESP8266_HARDSERIAL 
    #define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT 
    #define REMOTEXY_MODE__ESP8266_HARDSERIAL_CLOUD 
    #define REMOTEXY_MODE__ESP8266_SOFTSERIAL    
    #define REMOTEXY_MODE__ESP8266_SOFTSERIAL_POINT 
    #define REMOTEXY_MODE__ESP8266_SOFTSERIAL_CLOUD 
    #define REMOTEXY_MODE__WIFI_LIB 
    
   Only ESP8266 boards:
    #define REMOTEXY_MODE__ESP8266WIFI_LIB 
    #define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT 
    #define REMOTEXY_MODE__ESP8266WIFI_LIB_CLOUD 

   Only ESP32 boards:
    #define    REMOTEXY_MODE__ESP32_BT
    #define    REMOTEXY_MODE__ESP32_BLE
    #define REMOTEXY_MODE__ESP32WIFI_LIB
    #define REMOTEXY_MODE__ESP32WIFI_LIB_POINT

    Only Nano BLE boards:

    #define REMOTEXY_MODE__BLE_NANO

   Parameters depending on the selected mode (for example):
    #define REMOTEXY_SERIAL Serial  // for Hardware Serial
    #define REMOTEXY_SERIAL_SPEED 115200 
    #define REMOTEXY_SERIAL_RX 2   // for Software Serial
    #define REMOTEXY_SERIAL_TX 3   // for Software Serial
    #define REMOTEXY_WIFI_SSID &quot;RemoteXY&quot;  
    #define REMOTEXY_WIFI_PASSWORD &quot;1234567890&quot; 
    #define REMOTEXY_ETHERNET_MAC &quot;DE:AD:BE:EF:EF:ED&quot;  // for Ethernet modules
    #define REMOTEXY_SERVER_PORT 6377 
    #define REMOTEXY_CLOUD_TOKEN &quot;xxxx&quot; // for Cloud
    #define REMOTEXY_CLOUD_SERVER &quot;cloud.remotexy.com&quot; // for Cloud
    #define REMOTEXY_CLOUD_PORT 6376  // for Cloud
    #define REMOTEXY_ACCESS_PASSWORD &quot;1&quot; 
    #define REMOTEXY_BT_DEVICENAME &quot;RemoteXY&quot; // for ESP32 BT &amp; BLE

   Debug log info on 115200 (define before include this library):
    #define REMOTEXY__DEBUGLOGS Serial

   Flag to indicate when something has been changed (define before include this library):
      #define REMOTEXY_CHANGED_FLAG

   = Version history ========================================

   version 2.2.5   
     - support MPIDE;
   version 2.3.1    
     - Support the device access password;
     - Support the cloud server as beta test;
     - Fixed a bug where the length of variables more than 255;
     - Fixed a bug where ESP module reboot and device did not see it;
     - Fixed a bug where the connection was filed and the device 
         did not see it and reconnection is impossible 
   version 2.3.4  
     - Fixed a bug where the length of all input variables more than 256;
     - Fixed a bug where millis() overflow in 50 days;
     - Fixed some bugs;
   version 2.3.5  
     - Fixed some bugs;
   version 2.3.5ESP32
     - Support for ESP32 (WiFi, BT, BLE);
     - Support for changed_flag;       
*/

#ifndef _REMOTEXY_H_
#define _REMOTEXY_H_

//#define REMOTEXY__DEBUGLOGS Serial
#define REMOTEXY__DEBUGLOGS_SPEED 115200


#if defined(REMOTEXY_MODE__HARDSERIAL) || defined(REMOTEXY_MODE__SERIAL) || defined(REMOTEXY_MODE__HC05_HARDSERIAL) || defined(REMOTEXY_MODE__BLE_NANO)
  #define REMOTEXY_MOD__SERIAL
  #define REMOTEXY_PORT__HARDSERIAL
#elif defined(REMOTEXY_MODE__SOFTSERIAL) || defined(REMOTEXY_MODE__SOFTWARESERIAL) || defined(REMOTEXY_MODE__HC05_SOFTSERIAL)
  #define REMOTEXY_MOD__SERIAL
  #define REMOTEXY_PORT__SOFTSERIAL
#elif defined(REMOTEXY_MODE__ESP32_BT)
  #define REMOTEXY_MOD__SERIAL
  #define REMOTEXY_PORT__ESP32_BT
#elif defined(REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT) || defined(REMOTEXY_MODE__ESP8266POINT_HARDSERIAL)
  #define REMOTEXY_MOD__ESP8266
  #define REMOTEXY_WIFI__POINT
  #define REMOTEXY_PORT__HARDSERIAL
#elif defined(REMOTEXY_MODE__ESP8266_SOFTSERIAL_POINT) || defined(REMOTEXY_MODE__ESP8266POINT_SOFTSERIAL)
  #define REMOTEXY_MOD__ESP8266
  #define REMOTEXY_WIFI__POINT
  #define REMOTEXY_PORT__SOFTSERIAL
#elif defined(REMOTEXY_MODE__ESP8266_HARDSERIAL)
  #define REMOTEXY_MOD__ESP8266
  #define REMOTEXY_PORT__HARDSERIAL
#elif defined(REMOTEXY_MODE__ESP8266_SOFTSERIAL)
  #define REMOTEXY_MOD__ESP8266
  #define REMOTEXY_PORT__SOFTSERIAL
#elif defined(REMOTEXY_MODE__ESP8266_HARDSERIAL_CLOUD)
  #define REMOTEXY_MOD__ESP8266_CLOUD
  #define REMOTEXY_PORT__HARDSERIAL
  #define REMOTEXY_CLOUD
#elif defined(REMOTEXY_MODE__ESP8266_SOFTSERIAL_CLOUD)
  #define REMOTEXY_MOD__ESP8266_CLOUD
  #define REMOTEXY_PORT__SOFTSERIAL
  #define REMOTEXY_CLOUD
#elif defined(REMOTEXY_MODE__ETHERNET_LIB) || defined(REMOTEXY_MODE__W5100_SPI)
  #define REMOTEXY_MOD__ETHERNET_LIB
#elif defined(REMOTEXY_MODE__ETHERNET_LIB_CLOUD)
  #define REMOTEXY_MOD__ETHERNET_LIB_CLOUD
  #define REMOTEXY_CLOUD
#elif defined(REMOTEXY_MODE__WIFI_LIB)
  #define REMOTEXY_MOD__WIFI_LIB
#elif defined(REMOTEXY_MODE__ESP8266WIFI_LIB_POINT) || defined(REMOTEXY_MODE__ESP8266WIFIPOINT_LIB)  
  #define REMOTEXY_MOD__ESP8266WIFI_LIB
  #define REMOTEXY_WIFI__POINT
#elif defined(REMOTEXY_MODE__ESP8266WIFI_LIB)
  #define REMOTEXY_MOD__ESP8266WIFI_LIB
#elif defined(REMOTEXY_MODE__ESP8266WIFI_LIB_CLOUD)
  #define REMOTEXY_MOD__ESP8266WIFI_LIB_CLOUD
  #define REMOTEXY_CLOUD
#elif defined(REMOTEXY_MODE__ESP32_BLE)
  #define REMOTEXY_MOD__ESP32_BLE_LIB
#elif defined(REMOTEXY_MODE__NRF_BLE)
  #define REMOTEXY_MOD__NRF_BLE_LIB
#elif defined(REMOTEXY_MODE__ESP32WIFI_LIB)
  #define REMOTEXY_MOD__ESP8266WIFI_LIB  
#elif defined(REMOTEXY_MODE__ESP32WIFI_LIB_POINT) || defined(REMOTEXY_MODE__ESP32WIFIPOINT_LIB)
  #define REMOTEXY_MOD__ESP8266WIFI_LIB
  #define REMOTEXY_WIFI__POINT
#else
  #error RemoteXY mode does not defined or defined error: REMOTEXY_MODE__XXXXXXX 
#endif


#include &lt;inttypes.h&gt; 
#include &quot;classes/RemoteXY_Lib.h&quot;

/*
#if defined(REMOTEXY_PORT__HARDSERIAL) || defined(REMOTEXY__DEBUGLOGS)
  #include &lt;HardwareSerial.h&gt;
#endif 
*/


#if defined(REMOTEXY_MOD__SERIAL) 
  #include &quot;modules/serial.h&quot; 
#elif defined(REMOTEXY_MOD__ESP8266)
  #include &quot;modules/esp8266.h&quot; 
#elif defined(REMOTEXY_MOD__ESP8266_CLOUD)
  #include &quot;modules/esp8266_cloud.h&quot; 
#elif defined(REMOTEXY_MOD__ETHERNET_LIB)
  #include &quot;modules/ethernet.h&quot; 
#elif defined(REMOTEXY_MOD__ETHERNET_LIB_CLOUD)
  #include &quot;modules/ethernet_cloud.h&quot; 
#elif defined(REMOTEXY_MOD__WIFI_LIB)
  #include &quot;modules/wifi.h&quot; 
#elif defined(REMOTEXY_MOD__ESP8266WIFI_LIB)
  #include &quot;modules/esp8266wifi.h&quot; 
#elif defined(REMOTEXY_MOD__ESP8266WIFI_LIB_CLOUD)
  #include &quot;modules/esp8266wifi_cloud.h&quot; 
#elif defined(REMOTEXY_MOD__ESP32_BLE_LIB)
  #include &quot;modules/esp32_ble.h&quot;
#elif defined(REMOTEXY_MOD__NRF_BLE_LIB)
  #include &quot;modules/nrf_ble.h&quot;
#endif 

#ifndef REMOTEXY_ACCESS_PASSWORD 
#define REMOTEXY_ACCESS_PASSWORD &quot;&quot;
#endif 

CRemoteXY *remotexy;   

#define RemoteXY_Handler() remotexy-&gt;handler ()
#define RemoteXY_CONF const PROGMEM RemoteXY_CONF_PROGMEM


#endif //_REMOTEXY_H_</code></pre></div><p>RemoteXY_Serial.h</p><div class="codebox"><pre><code>#ifndef _REMOTEXY_SERIAL_H_
#define _REMOTEXY_SERIAL_H_

#include &quot;classes/RemoteXY_API.h&quot;

class CRemoteXY_Serial : public CRemoteXY_API {

public:

#if defined(REMOTEXY_PORT__HARDSERIAL)
  HardwareSerial * serial;
  void initSerial (HardwareSerial * _serial, long _serialSpeed) {
    serial = _serial;
    #if defined(REMOTEXY_MODE__BLE_NANO)
      Serial.begin (_serialSpeed);
    #else
      serial-&gt;begin (_serialSpeed);
    #endif
  }
#elif defined(REMOTEXY_PORT__SOFTSERIAL)
  #if defined(SoftwareSerial_h)
    SoftwareSerial * serial;
    void initSerial (uint8_t _serialRx, uint8_t _serialTx, long _serialSpeed) {
      serial = new SoftwareSerial (_serialRx, _serialTx);
      serial-&gt;begin (_serialSpeed);
    }
  #elif defined(SoftSerial_h)
    SoftSerial * serial;
    void initSerial (uint8_t _serialRx, uint8_t _serialTx, long _serialSpeed) {
      serial = new SoftSerial (_serialRx, _serialTx);
      serial-&gt;begin (_serialSpeed);
    }
  #endif
#elif defined(REMOTEXY_PORT__ESP32_BT)
  BluetoothSerial * serial;
  void initSerial ( const char * _btDeviceName) {
  String btDeviceName(_btDeviceName);
      serial = new BluetoothSerial ();
    serial-&gt;begin (btDeviceName);
  }
#endif
};

#endif //_REMOTEXY_SERIAL_H_</code></pre></div><p>For serial.h:</p><div class="codebox"><pre><code>#ifndef _REMOTEXY_MOD_SERIAL_H_
#define _REMOTEXY_MOD_SERIAL_H_

#include &quot;classes/RemoteXY_Serial.h&quot;

#ifdef REMOTEXY_PORT__ESP32_BT
#define REMOTEXY_SEND_BUFFER_LENGTH 200
#endif

class CRemoteXY : public CRemoteXY_Serial {

  public:

#if defined(REMOTEXY_PORT__HARDSERIAL)
    CRemoteXY (const void * _conf, void * _var, const char * _accessPassword, HardwareSerial * _serial, long _serialSpeed) {
      initSerial (_serial, _serialSpeed);
      init (_conf, _var, _accessPassword);
    }
#elif defined(REMOTEXY_PORT__SOFTSERIAL)
    CRemoteXY (const void * _conf, void * _var, const char * _accessPassword, uint8_t _serialRx, uint8_t _serialTx, long _serialSpeed) {
      initSerial (_serialRx, _serialTx, _serialSpeed);
      init (_conf, _var, _accessPassword);
    }
#elif defined(REMOTEXY_PORT__ESP32_BT)
    CRemoteXY (const void * _conf, void * _var, const char * _accessPassword, const char * _btDeviceName) {
      initSerial (_btDeviceName);
      init (_conf, _var, _accessPassword);
    }
#endif

  protected:

#ifdef REMOTEXY_PORT__ESP32_BT
    uint8_t sendBuffer[REMOTEXY_SEND_BUFFER_LENGTH];
    uint16_t sendBufferCount;
    uint16_t sendBytesAvailable;

    void sendStart (uint16_t len) {
      sendBytesAvailable = len;
      sendBufferCount = 0;
    }

    void sendByte (uint8_t b) {
      sendBuffer[sendBufferCount++] = b;
      sendBytesAvailable--;
      if ((sendBufferCount == REMOTEXY_SEND_BUFFER_LENGTH) || (sendBytesAvailable == 0)) {
        uint8_t buf[sendBufferCount];

#if defined(REMOTEXY__DEBUGLOGS)
        REMOTEXY__DEBUGLOGS.print(&quot;[&quot;);
#endif

        for (uint16_t i = 0; i &lt; sendBufferCount; i++)
        {
          buf[i] = sendBuffer[i];
#if defined(REMOTEXY__DEBUGLOGS)
          REMOTEXY__DEBUGLOGS.print(&quot; &quot;);
          REMOTEXY__DEBUGLOGS.print(buf[i], HEX);
#endif
        }
        serial-&gt;write ((uint8_t *)buf, sendBufferCount);
#if defined(REMOTEXY__DEBUGLOGS)
        REMOTEXY__DEBUGLOGS.print(&quot; ] &quot;);
#endif
        sendBufferCount = 0;
      }

    }


#else

    void sendByte (uint8_t b) {
    #if defined(REMOTEXY_MODE__BLE_NANO)
      Serial.write (b);
    #else
      serial-&gt;write (b);
    #endif
#if defined(REMOTEXY__DEBUGLOGS)
    DEBUGLOGS_writeOutputHex (b);
#endif
    }
#endif

    uint8_t receiveByte () {
    #if defined(REMOTEXY_MODE__BLE_NANO)
      uint8_t b = Serial.read ();
    #else
      uint8_t b = serial-&gt;read ();
    #endif
#if defined(REMOTEXY__DEBUGLOGS)
    DEBUGLOGS_writeInputHex (b); 
#endif
      return b;
    }


    uint8_t availableByte () {
    #if defined(REMOTEXY_MODE__BLE_NANO)
      return Serial.available ();
    #else
      return serial-&gt;available ();
    #endif
    };


};


#if defined(REMOTEXY_PORT__HARDSERIAL)
#define RemoteXY_Init() remotexy = new CRemoteXY (RemoteXY_CONF_PROGMEM, &amp;RemoteXY, REMOTEXY_ACCESS_PASSWORD, &amp;REMOTEXY_SERIAL, REMOTEXY_SERIAL_SPEED)
#elif defined(REMOTEXY_PORT__SOFTSERIAL)
#define RemoteXY_Init() remotexy = new CRemoteXY (RemoteXY_CONF_PROGMEM, &amp;RemoteXY, REMOTEXY_ACCESS_PASSWORD, REMOTEXY_SERIAL_RX, REMOTEXY_SERIAL_TX, REMOTEXY_SERIAL_SPEED)
#elif defined(REMOTEXY_PORT__ESP32_BT)
#define RemoteXY_Init() remotexy = new CRemoteXY (RemoteXY_CONF_PROGMEM, &amp;RemoteXY, REMOTEXY_ACCESS_PASSWORD,  REMOTEXY_BT_DEVICENAME)
#endif

#endif //_REMOTEXY_MOD_SERIAL_H_</code></pre></div><p>And here&#039;s my main.cpp: </p><div class="codebox"><pre><code>#include &lt;Arduino.h&gt;

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

// RemoteXY select connection mode and include library 
//#define REMOTEXY__DEBUGLOGS Serial

// // RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__BLE_NANO

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings 
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 9600


// ----------------------------------------------------------------------------

// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,0,0,13,0,11,13,0,
  1,0,42,24,12,12,2,31,88,0 }; 
  
// this structure defines all the variables and events of your control interface 
struct {

    // output 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() {
  // put your setup code here, to run once:

  Serial.begin(9600);
  Serial.println(&quot;INITIALIZING&quot;);

  RemoteXY_Init ();  

}

void loop() {

  RemoteXY_Handler ();

  // uint8_t bte = 0xA;
  // Serial.print(bte);


  // put your main code here, to run repeatedly:
}</code></pre></div><p>I&#039;ve created the REMOTEYX_MODE__BLE_NANO. This solves the issue. </p><p>I&#039;ll prepare a pull request for you guys. </p><p>Thanks everyone again for your help!</p>]]></description>
			<author><![CDATA[null@example.com (luiz.villa)]]></author>
			<pubDate>Sun, 30 May 2021 11:42:58 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4010#p4010</guid>
		</item>
	</channel>
</rss>
