Blynk max_sendbytes not working on my project

I have a problem regarding in sending notification and email which the #define BLYNK_MAX_SENDBYTES XXX is not working on my project whenever i try to set the value at 1200.

Hello. So what exactly is not working?

I think the blynk send bytes coz whenever i try to input higher than a 120 value the serial monitor displays “login timeout” and whenever i try to input 1200 value it loops on the serial monitor

254 above doesnt work. only the default 128 is working for me.

@cyz07 maybe you have “shoddy” hardware, provide precise details of your MCU.

I have arduino UNO with an esp8266 as a shield, im trying to send more than 128bytes of string to email and notification

or does esp8266 has a limit on sending strings?

Ah that word Arduino again, those old MCU’s with amnesia :slight_smile:

Not sure if @vshymanskyy restricts max send / receive for low memory devices?

Do you have the code in exactly the right place, must be BEFORE Blynk libraries?

Edit, maybe it’s not available for shield mode at all.

yeah i place it before the BLYNK libraries, but the default value is working

This thread confirms shield was accepting 1024 last summer BLYNK_MAX_SENDBYTES not working

that doesnt work for me, it loops from the start on my serial monitor

#define BLYNK_MAX_SENDBYTES 256
#define BLYNK_PRINT Serial

//libraries 
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <OneWire.h>
#include <DallasTemperature.h>


//authentication token given from blynk application.
char auth[] = "6d3ba48a3c4148b99a248848577b8***";

//wifi name and password.
char ssid[]= "user";
char pass[]= "pass";

#define ph A1
#define led1 8
#define ONE_WIRE_BUS 9

String message = "TEMPERATURE or pH IS GETTING HIGH!DO SOMETHING!";
String message2 = "Data Gathered";
String message3 = "Range(30-40)";

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

//Software Serial for Uno.
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

//ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);
boolean notified;
boolean notified2;
boolean notified3;
boolean notified4;

unsigned int notif=0;

float t,Po,h;

BlynkTimer timer;


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

  delay(10);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass,"192.168.43.111");
  
  while(Blynk.connect() == false){

  }
  digitalWrite(led1, HIGH);
  //send data every 5 seconds
  timer.setInterval(10000L,tempphturb);
  timer.setInterval(15000L,sendnotif);
  timer.setInterval(17000L,sendemail);

  
  
  
  
  
}


void tempphturb(){

   
   t = sensors.getTempCByIndex(0);
   sensors.requestTemperatures();
   
   Po = 1023 - analogRead(ph);  // Read and reverse the analogue input value from the pH sensor.
   Po = map(Po, 0, 1023, 0, 14); 

   int sensorValue = analogRead(A0);
   h = sensorValue/10;
   
   Blynk.virtualWrite(V6, Po);
   Blynk.virtualWrite(V9, t); 
   Blynk.virtualWrite(V7, h);



  
   
  
  }
  
void readnotif(){
  notif=0;
}
void sendnotif(){
   if((t>=30 && t<=45) || (Po>=8 && notif==0) && (notif==0)){
      notif=1;  
      Blynk.notify(String()+"TEMP(30-45): "+t+"\n"+"pH(9): "+Po+"\n"+message);
      timer.setInterval(10000L,readnotif);
  }
  else if(t<30){
    notif=0;
  }
  if(t>=26 && t<=30 && !notified){
    notified=1;
    Blynk.notify(String()+"TEMP(26-30): "+t+"\n"+message);
    
  }
  else if(t<26 && t>30){
    notified=0;
  }
  if(t>=20 && t<=26 && notif==0){
      notif=1;  
      Blynk.notify(String()+"TEMP(26-20): "+t+"\n"+message);
      timer.setInterval(10000L,readnotif);
  }
  else if(t>26){
    notif=0;
  }


  
}
void sendemail(){
   if(t>=30 && t<=45 && !notified2){
      notified2=1;  
      Blynk.email(message2,(String()+"TEMP: "+t+message));
  }
  else if(t<30){
    notified2=0;
  }
  if(t>=26 && t<=30 && !notified3){
    notified3=1;
    Blynk.email(message2,(String()+"DATA GATHERED\n"+"TEMP: "+t+message));
    
  }
  else if(t<26 && t>30){
    notified3=0;
  }
  if(t>=20 && t<=26 && notified4){
      notified4=1;  
      Blynk.email(message2,(String()+"DATA GATHERED\n"+"TEMP: "+t+message));
  }
  else if(t>26){
    notified4=0;
  }

  
}


void loop()
{
  Blynk.run();
  timer.run();
}

That’s my updated code

What does that mean?

[19]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.4.8 on Arduino Uno

[603] Connecting to Redmi
[3787] AT version:1.4.0.0(May 5 2017 16:10:59)
SDK version:2.1.0(116b762)
compile time:May 5 2017 16:37:48
OK
[7063] +CIFSR:STAIP,“192.168.43.155”
+CIFSR:STAMAC,“a0:20:a6:0f:78:a1”
[7072] Connected to WiFi
[17378] Ready (ping: 20ms).
[58362] Ready (ping: 19ms).

It Continue to Loop like this, from the start

Paste as least 2 cycles of the loop or do you mean the 2 Ready items keep repeating?

What makes you think this is anything to do with “max” or are you getting disconnected when to try to send more than 128 “bytes”?

2 or more loops repeating after the 2 ready items when i try the value of 1024, but when i tried this values 512 and 256 it say LOGIN TIMEOUT or it will get disconnected

Is this to a local server?
If it is what version are you using?
Have you tried your code to the cloud server?

Yeah Im using a local server ver 26.3, nope i havent tried that yet because im using too many widgets and 2 weeks from now i will implement this project, my only problem is the string length that can be send through email and notification

These don’t look like long Strings. Do you have anything in your code that makes them much bigger other than adding the temperature variable t? I’m not convinced your problems are related to “max”.

If I were you I would try the free cloud server with a single long String widget. You would then know that the problem is either your local server or the extra code in your sketch rather than “max”.