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();
}