Hi all, I need some help.. I used WEMOS R1 to run the programme with ESP8266WebServer.h. But the error occur like this:
no matching function for call to 'WiFiClient::connect(ESP8266WebServer&, int)'
This is part of my programming:
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include "DHT.h"
......
......
void sending_to_phpmyadmin() //CONNECTING WITH MYSQL
{
WiFiClient client;
if (client.connect(server, 80)) {
Serial.println("connected");
// Make a HTTP request:
Serial.print("GET /home/sensor.php?humidity=");
client.print("GET /home/sensor.php?humidity=");
Serial.println(humidityData);
client.print(humidityData);
.....
Is there any way to solve this?
gcjr
2
how is server defineds?
shouldn't it be a c-string (e.g. "192.168.1.40")?
my server define like this:
ESP8266WebServer server(80);
Is the WiFiClient client syntax in ESP8266WebServer.h library? or any others syntax can replace it?
gcjr
4
ok
what is the IP address of the server you are trying to connect to?
gcjr
5
I checked and its not using ESP8266WebServer.h.
My coding need to use ESP8266WebServer.h.
gcjr
7
where did you say what the IP address is you are trying to connect to?
I want to connect to my domain : www.usm.com
gcjr
9
where do you specify that in the code?
shouldn't that be the first argument to connect()?
i try to modify and no error occur
as below:
char ESP8266Webserver[] = "usm.com";
if (client.connect(ESP8266Webserver, 80))