Packet size too large using BLE and FastLED (IOS)

Hello Everybody! I’m newer here but have been lurking for a while, trying to find a solution to my issue. After trying many different troubleshooting techniques and failing to find a similar issue online, Ive decided to make an account and ask for your guys’ opinion.

My general issue, is once I integrate any sort of FastLED.show() functions into my program, after roughly 30-45 seconds of proper function, I will get an error saying the packets im sending are too large and recieve and running “Connection… Login timeout” message. I realize BLE still needs some kind of internet connection to operate with blynk, however the project as a whole needs to be able to operate under minimal internet conditions, which I feel the environment it’s in will be able to handle. This though, means I wont have enough of an internet connection to support another type of module such as an ESP8226 chip.

   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Arduino Uno

[89] Connecting...
[3229] Login timeout
[5229] Connecting...
[6053] Ready
Waiting for connections...
0
58
15
108
30
[26403] Packet too big: 51220
[26409] Packet too big: 2166
[31146] Connecting...
[34266] Login timeout
[36266] Connecting...
[39386] Login timeout

Blynk says I’m still connected on the app, however anytime I send a new value, I get “Packet too large” and anytime I try and reconnect I receive the same error. This forces me to physically unplug and reconnect or reupload the code.

I’m a CS student but still relatively new to all of this so, please forgive any sloppy code! I greatly encourage constructive criticism as well.Thank you all!


#define BLYNK_PRINT Serial


#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX

#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>

#include <FastLED.h>

#define LED_PIN 5
#define NUM_LEDS 144
#define BRIGHTNESS 64
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB

#define UPDATES_PER_SECOND 100

CRGB leds[NUM_LEDS];
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "";

BlynkTimer timer;

SoftwareSerial SerialBLE(10, 11); // RX, TX

CRGBPalette16 currentPalette; //FastLED  color pallete
TBlendType currentBlending; //current blending mode

int userbright, olduserbright; //general ser value input

void fastledfill(){ //Display colors! :)

  static uint8_t startIndex = 0;
  startIndex = startIndex +1; //set the motion speed

  FillLEDsFromPaletteColors( startIndex );

  FastLED.show(); 

}

void setup()
{
  // Debug console
  Serial.begin(9600); 

  SerialBLE.begin(9600);
  Blynk.begin(SerialBLE, auth);

  FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip); 
  FastLED.setBrightness( BRIGHTNESS );

  currentPalette = RainbowColors_p;
  currentBlending = LINEARBLEND;

  Serial.println("Waiting for connections...");

  timer.setInterval((30L), fastledfill); 
  timer.setInterval((500L), outputinput);
}

void loop()
{
  Blynk.run();

  timer.run();
}

//FASTLED FUNCTIONS//
void FillLEDsFromPaletteColors( uint8_t colorIndex ){
  uint8_t brightness = 255;

  for (int i = 0; i < NUM_LEDS; i++){
    leds[i] = ColorFromPalette(currentPalette, colorIndex, brightness, currentBlending);
    colorIndex += 3;

    Blynk.run();
  }

}
//MISC FUNCTIONS//
void outputinput(){ //ouput slider value if different value is detected

    static int i = 0;

    for (i; i < 1; i++){
      Serial.println(userbright);
      userbright = olduserbright;
      Blynk.run();
    } if (userbright - olduserbright != 0){
      i = 0;
      }

}

//BLYNK FUNCTIONS//
BLYNK_WRITE(V1){ 
  userbright = param.asInt();
}


Personally I think the limited reliability & functionality of Blynk’s BT/BLE connectivity, combined with a timing sensitive background process like FastLED is a bad combination.

I would highly recommend an ESP8266 option even if only needing the App link infrequently.

1st, no BT/BLE issues.

2nd, the ESP is a much faster processor then most any BT/BLE based Arduino.

3rd, it can still be programmed to work just fine even without any internet connectivity, well except for the App part, but then that can be handled with a Phone based Hotspot as needed.

And since the App on the phone MUST have internet access anyhow (at least for Cloud Server), then whatever Internet limitations you have will be the same for either BT/BLE or WiFi based MCUs

With that in mind then, they would simply need to both have a method of reaching the Blynk server, and not having to both be on the same internet connection to talk to each other?

I’m assuming the latter (just a method such as (phone -> blynk -> ESP )?), but I’ll ask anyways incase :rofl: Thank you for the quick reply, I’ve been trying to get this working for a few days now and it was driving me insane.

Correct…ish. There used to be a Geo-DNS issue (there are three different Cloud Servers spread across the globe) and sometimes using a hard line (router and device) and cell connection (App) actually connected to two different servers. But I believe that is fully resolved for general App/device use… Using the API method is a different story :stuck_out_tongue:

You can code your device to work with or without a Blynk Server connectivity (providing you hard code in some default settings that would normally require App input)…

But the App must connect to the Server to even log in (all your account and project info is stored on the Server, no the App).

Awesome. Finding a work around even if I still cant get the issue resolved shouldnt be a problem, I mainly didn’t want to have to invest into a dedicated mobile hotspot for the project. Thank you for all the info!

Some have made a Local Server with integrated AP out of a RPi… which could probably also work as the client to run the LEDs if you can find a suitable library for Python or NodeJS. Or just use an ESP8266 connected to the RP’s AP, along with the phone for a “internet free” setup.