BlynkSimpleEsp8266 and arduinojson conflict


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <ArduinoJson.h>
char ssid[] = "xxxx";
char pass[] = "xxxx";
char auth[] = "xxxx";

  int val = param.asInt();

void setup() {  
  WiFi.begin(ssid, pass);

void loop() {;


c:\Users\ehraz\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkHandlers.h:25:13: error: expected unqualified-id before numeric constant
c:\Users\ehraz\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkHandlers.h:25:13: error: expected '{' before numeric constant
   25 | #define V6  6
      |             ^
c:\Users\ehraz\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkHandlers.h:25:13: error: expected unqualified-id before numeric constant

exit status 1

Compilation error: exit status 1

It is only happening when initializing arduinojson and blynkesp8266 library together.
Can anyone tell me why it is happening.

Not happening when the arduinojson library is v.6.20.0

Can you explain this statement further?
What version of the Blynk library are you using?


The error is only occurring when I am using ArduinoJson library v6.21.0
It is not happening with library version 6.20.0
Blynk library version is 1.2.0

1 Like

I have the same issue described above.

I had the same problem and solved (avoided?) the issue using Arduino_Json.

I rolled back to the 6.20.0 version and got it to compile. The issue I am having now is that all of my sketches that use wifimanager will not work properly. The device goes into an infinite wdt reset loop. I think there is something with the two (BLYNK and ArduinoJson) libraries that is conflicting. I don’t have time to really troubleshoot the issue until this weekend, but have one device offline cause of this. I was going to make a small change to one of my devices, and decided to update all of my libraries first (it had been a while since doing any tinkering on Arduino IDE). Once I updated I tried to recompile my existing sketch (made no changes). I ran into this issue with the libraries conflicting and once I got that figured out (by rolling back ArduinoJson to 6.20.0), I uploaded it to my device and now it just keep resetting. Serial monitor shows a bunch of stuff about reboot reason, and WDT reset. As mentioned I have a bit of troubleshooting to do this weekend, but best believe I won’t be messing with my other working devices.

same for me with ESP32 and ArduinoJson library v6.21.0 and Blynk 1.2
v6.20.0 works