Not clear what do You mean.
Maybe blocked 8442?
How I can check this?
You may try:
#define BLYNK_DEFAULT_PORT 80
If I correct understand I should do such steps:
1.#define BLYNK_DEFAULT_PORT 80
2.Blynk.config(auth, “blynk-cloud.com”, 80);
Is it correct?
Make sure your sketch starts like this
#define BLYNK_PRINT Serial
#define BLYNK_DEBUG
#define BLYNK_DEFAULT_PORT 80
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <DNSServer.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
...
Also you can try an online port checker… (blocked port…can’t believe I forgot that… haven’t used Cloud Server in forever )
You actually don’t need config for default settings.
@Gunner I think order does matter and #define BLYNK_DEFAULT_PORT 80
should go after libraries. However, I may be wrong here .
You mean he can use this…
Blynk.config(auth);
Not that he doesn’t need the command Blynk.config(auth);
at all… right?
But that assume using Blynk.begin()
this OP is using a separate WiFi connection, followed by Blynk.config()
Actually it should go before the libraries.
I wasn’t aware the order of that particular port define mattered, I just chucked it in there after seeing it suggested… I wasn’t even aware of it’s availability, as I use Local Server all the time
However, I was purposely putting the #define BLYNK_PRINT
Serial and #define BLYNK_DEBUG
at the beginning, as dictated in the Docs.
There is rezult of checking of port 8442 with using service http://canyouseeme.org:
Error: I could not see your service on 31.131.117.173 on port (8442)
Reason: Connection timed out
Your IP:
31.131.117.173
Port to Check: 8442
This doesn’t give you any valuable information. Port 8442 is blocked in-bound by your router as expected. This has nothing to do with connecting to Blynk.
Just to make sure we are all on the same page - you have esp8266 connecting to “klg” wi-fi network and you have your phone or computer connected to the same wireless network and from that secondary device you are able to ping blynk-cloud.com? Is this the case?
Can you put in you code, just before Blynk.config(auth)
the following:
IPAddress BlynkServerIP;
WiFi.hostByName("blynk-cloud.com", BlynkServerIP);
Serial.println(BlynkServerIP);
this way we are going to see what IP address you are trying to connect to…and, please comment all your libraries except <ESP8266WiFi.h> and <BlynkSimpleEsp8266.h>
Thanks bilbobg, I will try this now and then I message rezult.
In addition I did ping of blynk-cloud,com from my both computers: the first is connected to the router via cable, the second via WiFi. Ping on both computers is OK.
If I may…
There is a tool I’m using to test connections on different ports. Recently I’ve been using it with blynk cloud too.
It is called Hercules setup utility with its build-in TCP client.
Look at screenshot.
The Blynk server will disconnect after some 10 seconds as it times out waiting for something (an auth token?)
I have been put in my code:
IPAddress BlynkServerIP;
WiFi.hostByName(“blynk-cloud.com”, BlynkServerIP);
Serial.println(BlynkServerIP);
and now got in console:
Connecting to klg
[48478] Connecting to klg
[49480] Connected to WiFi
[49481] IP: 192.168.1.228
WiFi connected
Connecting to Blynk cloud
0.0.0.0
[63349]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.0 on ESP8266
[63377] Connecting to blynk-cloud.com:8442
Blynk.connect() = 0
[77373] Connecting to blynk-cloud.com:8442
LED on V1: on
[91372] Connecting to blynk-cloud.com:8442
LED on V1: off
[105446] Connecting to blynk-cloud.com:8442
for some reason your ESP8266 can’t resolve the IP addr of the Blynk server. Can you do the following for me:
replace the 3 lines of code I asked you to put before Blynk.config with:
IPAddress BlynkServerIP(139, 59, 206, 133);
and modify your Blynk.config(auth)
to Blynk.config(auth, BlynkServerIP, 8442);
I did:
void setup()
{
// Debug console
Serial.begin(9600);
// Connecting to WiFi network
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
Blynk.connectWiFi(ssid, pass); //WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("Connecting to Blynk cloud");
IPAddress BlynkServerIP(139, 59, 206, 133);
// Blynk.config(auth);
Blynk.config(auth, BlynkServerIP, 8443);
Blynk.connect();
Serial.print("Blynk.connect() = "); Serial.println(Blynk.connected());
timer.setInterval(1000L, blinkLedWidget);
}
[64708] Connected to WiFi
[64708] IP: 192.168.1.228
WiFi connected
Connecting to Blynk cloud
[64708]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.0 on ESP8266
[64828] Connecting to 139.59.206.133
[64926] <[02|00|01|00] fe31f9320b444c29b3fcee2f37915dc1
[64989] >[15|03|01|00|02]
[64989] >[02]F
[64989] Invalid header type: 21
[69977] Connecting to 139.59.206.133
[70022] <[02|00|01|00] fe31f9320b444c29b3fcee2f37915dc1
[70067] >[15|03|01|00|02]
[70067] >[02]F
[70067] Invalid header type: 21
Blynk.connect() = 0
LED on V1: on
LED on V1: off
LED on V1: on
LED on V1: off
[75067] Connecting to 139.59.206.133
[75112] <[02|00|01|00] fe31f9320b444c29b3fcee2f37915dc1
[75159] >[15|03|01|00|02]
[75159] >[02]F
[75159] Invalid header type: 21