Compiler warning BlynkEdgent

I’am experimenting with Blynk.Air therefore i use the BlynkEdgent sample sketch. It is working fine but i get two compiler warnings.

In file included from /home/pi/Documents/ESP32/Test/BlynkEdgent.h:25,
from /home/pi/Documents/ESP32/Test/Test.ino:14:
/home/pi/Documents/ESP32/Test/Console.h: In lambda function:
/home/pi/Documents/ESP32/Test/Console.h:30:5: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
);
^
/home/pi/Documents/ESP32/Test/Console.h: In lambda function:
/home/pi/Documents/ESP32/Test/Console.h:45:5: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
);
^

This is the 1st warning in Console.h

edgentConsole.addCommand(“devinfo”, {
edgentConsole.printf(
R"json({“board”:“%s”,“tmpl_id”:“%s”,“fw_type”:“%s”,“fw_ver”:“%s”})json" “\n”,
BLYNK_DEVICE_NAME,
BLYNK_TEMPLATE_ID,
BLYNK_FIRMWARE_TYPE,
BLYNK_FIRMWARE_VERSION
);

and this the 2nd in Console.h

edgentConsole.printf(
    R"json({"ssid":"%s","bssid":"%02x:%02x:%02x:%02x:%02x:%02x","rssi":%d})json" "\n",
    ssidBuff,
    mac[5], mac[4], mac[3], mac[2], mac[1], mac[0],
    WiFi.RSSI()
);

How can i fix it?

Hans.

Well, first of all they are warnings, and in this case can safely be ignored.

But, if I compile the Edgent_ESP32 sketch I don’t get these warnings.

I’m using ESP32 Core version 2.0.2 (go to Tools > Board > Boards Manager > ESP32 to check your version).

I’m also using all of the latest Edgent_ESP32 files from here:

and Arduino IDE version 1.8.19

Pete.

Hello Pete,

I know that it is a warning that i can ignore but i want to understand why? I will sleep better if there was no warning :grinning:

I checked the versions; ESP32 Core version 2.0.2, Arduino IDE 1.8.19 and i use the latest Edgent_ESP32 files from GitHub.

I cant reproduce the problem, so I can’t help you to understand why it’s happening.

Pete.

Deleting the lib, core and reinstalling may help. Give it a try. I have faced such issues in the past(not exactly the above mentioned warnings) but after reinstalling the warnings went away.