I am new to this forum so forgive if this problem is already solved.
I am trying to control my dht11 temp. and humidity sensor using wifi module ESP8266 and sending the data to my thingspeak account for making graphs. However there is an error which i encountered and cannot solve this.
This is the line where the error deprecated conversion from string constant to char* occurs.
and the error which i get is:-
C:\Users\Saxena\Documents\Arduino\final\final.ino:11:15: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] char *api_key="W4GD6K3M241DXGUY"; // Enter your Write API key from ThingSpeak ^ C:\Users\Saxena\Documents\Arduino\final\final.ino: In function 'void connect_wifi(String, int)': C:\Users\Saxena\Documents\Arduino\final\final.ino:99:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] if(Serial1.find("OK")) ^
It would be an immense pleasure for me if anyone can provide a solution to this.
And also please tell that is this the correct way to connect to my home wifi using wifi module ESP8266:-
connect_wifi("AT",1000); connect_wifi("AT+CWMODE=1",1000); connect_wifi("AT+CWQAP",1000); connect_wifi("AT+RST",5000); connect_wifi("AT+CWJAP=\"abhikaran\",\"18148841\"",10000); Serial.println("Wifi Connected");
have also attached the full code if u want.
Thanks in advance.
final.ino (2.81 KB)