BLYNK_MAX_SENDBYTES not working

So i have my project and i want to increase the email size

...
#include <EEPROM.h>
#include <SimpleTimer.h>  // MUDOU ITEM PARA CRIAR TEMPOS DE EXECUÇÂO

//#define BLYNK_DEBUG
#define BLYNK_MAX_SENDBYTES 256
#define BLYNK_PRINT Serial
...

and my BLYNK_MAX_SENDBYTES is always set back to 128 :

C:\Program Files (x86)\Arduino\libraries\Blynk/Blynk/BlynkConfig.h:52:0: note: this is the location of the previous definition
#define BLYNK_MAX_SENDBYTES  128
^

how do i fix this?

I think this is just a warning. Isn’t it?

I don’t think so :cry:

I tried this :

#ifdef BLYNK_MAX_SENDBYTES
#undef BLYNK_MAX_SENDBYTES
#endif
#define BLYNK_MAX_SENDBYTES 1024

and i ran some tests and that warning did not showed up, still Blynk did not send my large messages but my small messages work fine

the program behaved as if BLYNK_MAX_SENDBYTES was set to 128 :sob:

This is the full warning:

C:\Users\caous\Desktop\Programas de Desenvolvimento\Arduíno\PROJETOS\Projeto_Casa_Inteligente_QuadroDeLuz\Projeto_Casa_Inteligente_QuadroDeLuz.ino:10:0: warning: "BLYNK_MAX_SENDBYTES" redefined [enabled by default]

In file included from C:\Program Files (x86)\Arduino\libraries\Blynk/Blynk/BlynkApi.h:14:0,

             from C:\Program Files (x86)\Arduino\libraries\Blynk/BlynkApiArduino.h:14,

             from C:\Program Files (x86)\Arduino\libraries\Blynk/BlynkSimpleShieldEsp8266_HardSer.h:27,

             from C:\Users\caous\Desktop\Programas de Desenvolvimento\Arduíno\PROJETOS\Projeto_Casa_Inteligente_QuadroDeLuz\Projeto_Casa_Inteligente_QuadroDeLuz.ino:4:

C:\Program Files (x86)\Arduino\libraries\Blynk/Blynk/BlynkConfig.h:52:0: note: this is the location of the previous definition

 #define BLYNK_MAX_SENDBYTES  128

 ^

@NicolasCaous the error message indicates you have duplicated the define statement.

but there is only one in the code, maybe from those libraries?

I suggest you replace:

#ifdef BLYNK_MAX_SENDBYTES
#undef BLYNK_MAX_SENDBYTES
#endif
#define BLYNK_MAX_SENDBYTES 1024

with:

#define BLYNK_MAX_SENDBYTES 1024

and I think it will be fine.

i tested it like that, nope :frowning:

Is it failing to compile or just giving you a warning? Do you have the latest libraries as this did fail a few versions back?

@NicolasCaous the #define BLYNK_MAX_SENDBYTES 1024 must be included before any of the Blynk includes.

2 Likes

oh, i see

#define BLYNK_MAX_SENDBYTES 1024

#include <Wire.h>
#include "RTClib.h"
#include <ESP8266_HardSer.h>
#include <BlynkSimpleShieldEsp8266_HardSer.h>
#include "EmonLib.h"
#include <EEPROM.h>
#include <SimpleTimer.h> // MUDOU ITEM PARA CRIAR TEMPOS DE EXECUÇÂO

//#define BLYNK_DEBUG
#define BLYNK_PRINT Serial
#define EspSerial Serial1
#define SwitchPin 4 // Modo Serial
#define ENDERECOSOMAKW 820
#define ENDERECOSOMAMEDIA1 ENDERECOSOMAKW + sizeof(float)
#define ENDERECOSOMAMEDIA2 ENDERECOSOMAMEDIA1 + sizeof(float)

IT WORKED :smile:

thanks alot dude, +rep :joy:

2 Likes