<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — two or more HM-10 BLE over SoftwareSerial]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=213</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=213&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in two or more HM-10 BLE over SoftwareSerial.]]></description>
		<lastBuildDate>Fri, 28 Jul 2017 13:12:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: two or more HM-10 BLE over SoftwareSerial]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=832#p832</link>
			<description><![CDATA[<p>Thanks Guillaume,</p><p>I&#039;ve managed it like you suggested, with an Arduino Mega.<br />It works fine now, so thank you!</p><p>ungesimmt</p>]]></description>
			<author><![CDATA[null@example.com (ungesimmt)]]></author>
			<pubDate>Fri, 28 Jul 2017 13:12:18 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=832#p832</guid>
		</item>
		<item>
			<title><![CDATA[Re: two or more HM-10 BLE over SoftwareSerial]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=808#p808</link>
			<description><![CDATA[<p>By the way, if you use a esp8266 instead of your arduino micro, not only you can do your thing with Wifi, but you could also use two HM-10 because it has two HardwareSerial ports. Port 0 is normally used for sketch upload, so you will have to upload by OTA.</p><p>It also has a third TX pin that you can use for your debugging, but this will require another usb/serial adapter, but you could just communicate with PC with <a target="_blank" href="https://github.com/JoaoLopesF/ESP8266-RemoteDebug-Telnet">another way</a>!</p><p><span class="postimg"><img src="https://bennthomsen.files.wordpress.com/2015/12/nodemcu_pinout_700-2.png" alt="https://bennthomsen.files.wordpress.com/2015/12/nodemcu_pinout_700-2.png" /></span></p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Tue, 18 Jul 2017 09:50:27 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=808#p808</guid>
		</item>
		<item>
			<title><![CDATA[Re: two or more HM-10 BLE over SoftwareSerial]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=806#p806</link>
			<description><![CDATA[<p>I have never used SoftwareSerial but maybe you need to modify (or better, create your own) RemoteXY module so that it makes use of <a target="_blank" href="https://www.arduino.cc/en/Reference/SoftwareSerialListen">listen()</a>.</p><p>But then you might have other problems and it might not work as you expect, because:<br /></p><div class="quotebox"><blockquote><p>Only one software serial port can listen at a time; data that arrives for other ports will be discarded. Any data already received is discarded during the call to listen() (unless the given instance is already listening).</p></blockquote></div><p>But can you use both HM-10 without RemoteXY ? And 4800 is very slow, maybe try with 115200.</p><p>I think you should use a board with multiple HardwareSerial ports (arduino mega 2560, for example) <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Mon, 17 Jul 2017 19:07:14 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=806#p806</guid>
		</item>
		<item>
			<title><![CDATA[Re: two or more HM-10 BLE over SoftwareSerial]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=805#p805</link>
			<description><![CDATA[<p>Sorry, some mistake in my code... Here is my correct Testcode:<br />Like this, it is working fine. But as soon as i call<br /></p><div class="codebox"><pre><code>rxy2 = new CRemoteXY (rxy2_config, &amp;rxy2_struct, REMOTEXY_ACCESS_PASSWORD, REMOTEXY_SERIAL_RX2, REMOTEXY_SERIAL_TX2, REMOTEXY_SERIAL_SPEED);</code></pre></div><p> <br />in setup() or <br /></p><div class="codebox"><pre><code>rxy2-&gt;handler();</code></pre></div><p>in loop() both HM-10 do not reply anymore. Is this an pin-change-interrupt-problem??</p><p>Greetings, Simon<br /></p><div class="codebox"><pre><code>#define REMOTEXY_MODE__SOFTSERIAL
#include &lt;SoftwareSerial.h&gt;

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings 
#define REMOTEXY_SERIAL_RX1 8
#define REMOTEXY_SERIAL_TX1 10
#define REMOTEXY_SERIAL_RX2 9
#define REMOTEXY_SERIAL_TX2 11
//#define REMOTEXY_SERIAL_RX3 20
//#define REMOTEXY_SERIAL_TX3 23
#define REMOTEXY_SERIAL_SPEED 4800

// Data for RemoteXY&#039;s instance 1
CRemoteXY *rxy1;

const uint8_t PROGMEM rxy1_config[] =
  { 255,2,0,5,0,47,0,6,5,2,
  5,9,26,8,45,45,4,40,42,42,
  2,65,15,7,9,9,9,7,9,9,
  9,2,66,33,89,2,9,50,53,5,
  9,83,2,66,161,1,54,89,8,1,
  90,60,8,2 };

struct {
    // input variable
  int8_t joy_1_x; // =-100..100 x-coordinate joystick position 
  int8_t joy_1_y; // =-100..100 y-coordinate joystick position 

    // output variable
  uint8_t led_1_r; // =0..255 LED Red brightness 
  uint8_t led_1_g; // =0..255 LED Green brightness 
  uint8_t led_1_b; // =0..255 LED Blue brightness 
  int8_t ver_1; // =-100..100 level position 
  int8_t hor_1; // =-100..100 level position 

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


// Data for RemoteXY&#039;s instance 2
CRemoteXY *rxy2;

const uint8_t PROGMEM rxy2_config[] =
  { 255,2,0,5,0,47,0,6,5,2,
  5,9,26,8,45,45,4,40,42,42,
  2,65,15,7,9,9,9,7,9,9,
  9,2,66,33,89,2,9,50,53,5,
  9,83,2,66,161,1,54,89,8,1,
  90,60,8,2 }; 

struct {
    // input variable
  int8_t joy_2_x; // =-100..100 x-coordinate joystick position 
  int8_t joy_2_y; // =-100..100 y-coordinate joystick position 

    // output variable
  uint8_t led_2_r; // =0..255 LED Red brightness 
  uint8_t led_2_g; // =0..255 LED Green brightness 
  uint8_t led_2_b; // =0..255 LED Blue brightness 
  int8_t ver_2; // =-100..100 level position 
  int8_t hor_2; // =-100..100 level position 

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



//eigene Defines

#define LED_gruen 14//MISO
#define LED_rot   15//SCK




//globale Variablen
  

void setup() 
{ 
  pinMode(LED_BUILTIN, OUTPUT); //integrierte LED
  pinMode(LED_gruen, OUTPUT);
  pinMode(LED_rot, OUTPUT);

  Serial.begin(9600);  //Verbindung USB direkt zu PC (debug Console)
  //delay(800);
  Serial.println(&quot;RemoteXY for Light-Control by SG7&quot;);
  Serial.println(&quot;Startup...&quot;);
  //delay(1000);
 
  //RemoteXY_Init ();
  rxy1 = new CRemoteXY (rxy1_config, &amp;rxy1_struct, REMOTEXY_ACCESS_PASSWORD, REMOTEXY_SERIAL_RX1, REMOTEXY_SERIAL_TX1, REMOTEXY_SERIAL_SPEED);
  delay(1000);
  //rxy2 = new CRemoteXY (rxy2_config, &amp;rxy2_struct, REMOTEXY_ACCESS_PASSWORD, REMOTEXY_SERIAL_RX2, REMOTEXY_SERIAL_TX2, REMOTEXY_SERIAL_SPEED);
  
  Serial.println(&quot;Startup done!&quot;);
} //Ende void setup() 







void loop() 
{ 
   if ( rxy1_struct.connect_flag == 1 )
      { digitalWrite(LED_gruen, HIGH);
      }
  else
      { digitalWrite(LED_gruen, LOW);
      };
  //Serial.print(&quot;joy x&quot;);
  //Serial.println(rxy1_struct.joy_1_x);
  //Serial.print(&quot;ver_1&quot;);
  //Serial.println(rxy1_struct.ver_1);
  
  //RemoteXY_Handler ();
  rxy1-&gt;handler();
  //delay(5);
  //rxy2-&gt;handler();


  rxy1_struct.ver_1=rxy1_struct.joy_1_x;
  rxy1_struct.hor_1=rxy1_struct.joy_1_y;  
  //rxy2_struct.ver_2=rxy2_struct.joy_2_x;
  //rxy2_struct.hor_2=rxy2_struct.joy_2_y;
  
  rxy1_struct.led_1_r=100;
  rxy1_struct.led_1_b=100;
  
  //rxy2_struct.led_2_g=250;

} //Ende void loop() </code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ungesimmt)]]></author>
			<pubDate>Mon, 17 Jul 2017 14:45:10 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=805#p805</guid>
		</item>
		<item>
			<title><![CDATA[Re: two or more HM-10 BLE over SoftwareSerial]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=804#p804</link>
			<description><![CDATA[<p>Hi,</p><p>and thanks for your reply.<br />I&#039;ve found that code before <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />My code compiles without errors. But I&#039;m not able to use 2 HM-10 in parallel. Is it possible with your library to use 2 or more SoftwareSerial in parallel? If I just use one of the modules (with no use of the code from e.g. rxy2), it works. With both of them the devices don&#039;t reply.</p><p>Do you have any ideas?</p><p>Please help me!<br />Thanks...</p><p>Here is my code...<br /></p><div class="codebox"><pre><code>// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__SOFTSERIAL
#include &lt;SoftwareSerial.h&gt;

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings 
#define REMOTEXY_SERIAL_RX1 8
#define REMOTEXY_SERIAL_TX1 10
#define REMOTEXY_SERIAL_RX2 9
#define REMOTEXY_SERIAL_TX2 11
//#define REMOTEXY_SERIAL_RX3 20
//#define REMOTEXY_SERIAL_TX3 23
#define REMOTEXY_SERIAL_SPEED 4800

// Data for RemoteXY&#039;s instance 1
CRemoteXY *rxy1;

const uint8_t PROGMEM rxy1_config[] =
  { 255,2,0,5,0,47,0,6,5,2,
  5,9,26,8,45,45,4,40,42,42,
  2,65,15,7,9,9,9,7,9,9,
  9,2,66,33,89,2,9,50,53,5,
  9,83,2,66,161,1,54,89,8,1,
  90,60,8,2 };

struct {
    // input variable
  int8_t joy_x; // =-100..100 x-coordinate joystick position 
  int8_t joy_y; // =-100..100 y-coordinate joystick position 
    // output variable
  uint8_t led_r; // =0..255 LED Red brightness 
  uint8_t led_g; // =0..255 LED Green brightness 
  uint8_t led_b; // =0..255 LED Blue brightness 
  int8_t ver; // =-100..100 level position 
  int8_t hor; // =-100..100 level position 
    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 
}  rxy1_struct;


// Data for RemoteXY&#039;s instance 2
CRemoteXY *rxy2;

const uint8_t PROGMEM rxy2_config[] =
  { 255,2,0,5,0,47,0,6,5,2,
  5,9,26,8,45,45,4,40,42,42,
  2,65,15,7,9,9,9,7,9,9,
  9,2,66,33,89,2,9,50,53,5,
  9,83,2,66,161,1,54,89,8,1,
  90,60,8,2 };; 

struct {
    // input variable
  int8_t joy_x; // =-100..100 x-coordinate joystick position 
  int8_t joy_y; // =-100..100 y-coordinate joystick position 
    // output variable
  uint8_t led_r; // =0..255 LED Red brightness 
  uint8_t led_g; // =0..255 LED Green brightness 
  uint8_t led_b; // =0..255 LED Blue brightness 
  int8_t ver; // =-100..100 level position 
  int8_t hor; // =-100..100 level position 
    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 
}  rxy2_struct;



//eigene Defines

#define LED_gruen 14//MISO
#define LED_rot   15//SCK




//globale Variablen
  

void setup() 
{ 
  pinMode(LED_BUILTIN, OUTPUT); //integrierte LED
  pinMode(LED_gruen, OUTPUT);
  pinMode(LED_rot, OUTPUT);

  Serial.begin(9600);  //Verbindung USB direkt zu PC (debug Console)
  //delay(800);
  Serial.println(&quot;RemoteXY for Light-Control by SG7&quot;);
  Serial.println(&quot;Startup...&quot;);
  //delay(1000);
 
  //RemoteXY_Init ();
  rxy1 = new CRemoteXY (rxy1_config, &amp;rxy1, REMOTEXY_ACCESS_PASSWORD, REMOTEXY_SERIAL_RX1, REMOTEXY_SERIAL_TX1, REMOTEXY_SERIAL_SPEED);
  delay(1000);
  rxy2 = new CRemoteXY (rxy2_config, &amp;rxy2, REMOTEXY_ACCESS_PASSWORD, REMOTEXY_SERIAL_RX2, REMOTEXY_SERIAL_TX2, REMOTEXY_SERIAL_SPEED);
  
  Serial.println(&quot;Startup done!&quot;);
} //Ende void setup() 



void loop() 
{ unsigned long currentMillis = millis();

  rxy1-&gt;handler();
  //delay(5);
  rxy2-&gt;handler();

  rxy1_struct.ver=rxy1_struct.joy_x;
  rxy1_struct.hor=rxy1_struct.joy_y;  
  rxy2_struct.ver=rxy2_struct.joy_x;
  rxy2_struct.hor=rxy2_struct.joy_y;
  
  rxy1_struct.led_r=250;
  rxy1_struct.led_g=250;
  rxy2_struct.led_g=255;
} //Ende void loop() </code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ungesimmt)]]></author>
			<pubDate>Mon, 17 Jul 2017 12:40:25 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=804#p804</guid>
		</item>
		<item>
			<title><![CDATA[Re: two or more HM-10 BLE over SoftwareSerial]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=801#p801</link>
			<description><![CDATA[<p>Welcome,</p><p>Take a look at this, it might be helpful... <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p><a target="_blank" href="http://forum.remotexy.com/viewtopic.php?id=15">http://forum.remotexy.com/viewtopic.php?id=15</a></p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Fri, 14 Jul 2017 20:12:10 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=801#p801</guid>
		</item>
		<item>
			<title><![CDATA[two or more HM-10 BLE over SoftwareSerial]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=799#p799</link>
			<description><![CDATA[<p>Hi!</p><p>I need some help, please.</p><p>I have done some projects with Arduino Micro, HM-10 over SoftwareSerial and all work fine.</p><p>Now I want to have two (or maybe three) HM-10 Bluetooth-modules connected to an Arduino Micro, so that I can make two (or even three) connections to the Arduino from different phones at the same time.<br />I like to build a small game with 2 game controllers.</p><p>But I have no idea how to run multiple instances from RemoteXY on the same Arduino at the same time with different serial settings.</p><p>Can someone please help me?</p><p>Thanks a lot!</p><p>ungesimmt</p>]]></description>
			<author><![CDATA[null@example.com (ungesimmt)]]></author>
			<pubDate>Fri, 14 Jul 2017 11:39:04 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=799#p799</guid>
		</item>
	</channel>
</rss>
