user77451: I want to be able to control multiple LED strip via bluetooth with one arduino.
I coded my own android app and everything work fine with one or two led strip with few pixel. But as soon as I had to many pixel data send by BT is missing a few byte (ex "colfff5dff" instead of "color fff5dff"). It doen't happen every time but it's unrealiable.
I feel like sending data to the led strip take so many time that it skip some letter.
I'm ussing dsd tech hc-05 with an arduino UNO R3 and a esp8266 led strip.
#include <Adafruit_NeoPixel.h>
#include <SoftwareSerial.h>

#ifdef __AVR__
 #include <avr/power.h> 
#endif

//SoftwareSerial blueTooth(13,12);

#define PIN       5
#define SIZE      200

#define BRIGHTNESS 200

enum MODE {FIXED, LOOP_RGB, RUNNING, RAINBOW};
enum MODE mode = FIXED;

Adafruit_NeoPixel strip(SIZE, PIN, NEO_RGB + NEO_KHZ800);

int lastTime;

uint32_t color;
char Incoming_value = 0;
char bufferStr[100];
int bufferIndex = 0; 

void setup() {

  Serial.begin(9600); //open the serial port
  Serial.setTimeout(10);
  strip.begin();           
  strip.show();            
  strip.setBrightness(50); 

  color = Adafruit_NeoPixel::Color(0, 255 ,0 );  
}

void loop() {
  if(Serial.available() > 0)  
  {
    String s = Serial.readString();
    Serial.print(s);

    //I've tried some other way like read();  readString();  readBytes(); readBytesUntil();
    
    /*
     * ---- not needed for the issue
     */
  }
  switch (mode){
    case FIXED : fixedMode(); break;
    case RUNNING : runningLights(); break;
    case RAINBOW : rainbow(); break;    
    }  
    showAll();
}


void parseBlueTooth(){
  //---- not needed for the issue
}


void fixedMode(){
  setAll(color);
  showAll();
}

void rainbow(){
  //---- not needed for the issue
}


void runningLights() {
  //---- not needed for the issue
}


void setAll(byte r, byte g, byte b) {
  setAll(Adafruit_NeoPixel::Color(r,g,b));
}

void setAll(uint32_t color) {
  strip.fill(color, 0, SIZE);
}

void showAll(){
  long curTime = millis();
  if(curTime - lastTime >16){
    if(strip.canShow()) {
      strip.show();     
    }
    lastTime = curTime;
  }

}


user77395: IMHO, after reading Majenko and raddevus reply,
you may do something to "reduce missing data"

reduce baud rate (may be 9600), give more time for bluetooth data transfer.

add a checksum byte for your data.


Rererence :
https://lucidar.me/en/serialib/most-used-baud-rates-table/

77451: <p>I want to be able to control multiple LED strip via bluetooth with one arduino.
I coded my own android app and everything work fine with one or two led strip with few pixel. But as soon as I had to many pixel data send by BT is missing a few byte (ex &quot;colfff5dff&quot; instead of &quot;color fff5dff&quot;). It doen't happen every time but it's unrealiable.
I feel like sending data to the led strip take so many time that it skip some letter.</p>
<p>I'm ussing dsd tech hc-05 with an arduino UNO R3 and a esp8266 led strip.</p>
<pre><code>#include &lt;Adafruit_NeoPixel.h&gt;
#include &lt;SoftwareSerial.h&gt;

#ifdef __AVR__
 #include &lt;avr/power.h&gt; 
#endif

//SoftwareSerial blueTooth(13,12);

#define PIN       5
#define SIZE      200

#define BRIGHTNESS 200

enum MODE {FIXED, LOOP_RGB, RUNNING, RAINBOW};
enum MODE mode = FIXED;

Adafruit_NeoPixel strip(SIZE, PIN, NEO_RGB + NEO_KHZ800);

int lastTime;

uint32_t color;
char Incoming_value = 0;
char bufferStr[100];
int bufferIndex = 0; 

void setup() {

  Serial.begin(9600); //open the serial port
  Serial.setTimeout(10);
  strip.begin();           
  strip.show();            
  strip.setBrightness(50); 

  color = Adafruit_NeoPixel::Color(0, 255 ,0 );  
}

void loop() {
  if(Serial.available() &gt; 0)  
  {
    String s = Serial.readString();
    Serial.print(s);

    //I've tried some other way like read();  readString();  readBytes(); readBytesUntil();
    
    /*
     * ---- not needed for the issue
     */
  }
  switch (mode){
    case FIXED : fixedMode(); break;
    case RUNNING : runningLights(); break;
    case RAINBOW : rainbow(); break;    
    }  
    showAll();
}


void parseBlueTooth(){
  //---- not needed for the issue
}


void fixedMode(){
  setAll(color);
  showAll();
}

void rainbow(){
  //---- not needed for the issue
}


void runningLights() {
  //---- not needed for the issue
}


void setAll(byte r, byte g, byte b) {
  setAll(Adafruit_NeoPixel::Color(r,g,b));
}

void setAll(uint32_t color) {
  strip.fill(color, 0, SIZE);
}

void showAll(){
  long curTime = millis();
  if(curTime - lastTime &gt;16){
    if(strip.canShow()) {
      strip.show();     
    }
    lastTime = curTime;
  }

}
</code></pre>
 77395: <p>IMHO, after reading Majenko and raddevus reply,
you may do something to &quot;reduce missing data&quot;</p>
<ol>
<li><p>reduce baud rate (may be 9600), give more time for bluetooth data transfer.</p>
</li>
<li><p>add a checksum byte for your data.</p>
</li>
</ol>
<p>Rererence :</p>
<p><a href="https://lucidar.me/en/serialib/most-used-baud-rates-table/" rel="nofollow noreferrer">https://lucidar.me/en/serialib/most-used-baud-rates-table/</a></p>
