BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Can't connect ESP8266 to my Blynk server

Hi everyone! I need some help to solve my problem.
I have ESP8266 (NodeMCU v3) and trying to connect it to my Blynk server. Here is a description:
I ve installed Java v8, then I downloaded server-0.41.12-java8.jar from github, and started it by the command from manual I’ve founded also in github (java -jar server-0.41.12.jar -dataFolder /some_path). The server is in my home network, behind the router. Server have a static IP, port forwarding on router is set up like this (internal-external): 8080-80, 9443-443. Server is successfully started, and I can connect to it with app on my smatrphone using address myhostname.ru and port 443. After that I create a test project in app, then in my browser I go to https://myhostname.ru, Logging in and copy the Token, assigned to my test project and paste it in the sample sketch (ESP8266_Standalone). Also I paste my SSID and password, my hostname (myhostname.ru) and port (80) in this sketch, and flashing my ESP8266 with it. After flashing the ESP8266 is successfully connect to my wifi and trying to connect to my server in an endless loop. :frowning:
I tested port forwarding with Telnet, and it’s successfully connect, but when I try to connect through the browser (with http://myhostname), it redirects me to www.blynk.cc.
The same sketch is successfully connects to the cloud Blynk server (with the login details from it of course). Where could I make a mistake?
Here’s my sketch:

#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266_SSL.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "mytoken";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "my-ssid";
char pass[] = "ssid-pass";

void setup()
{
  // Debug console
  Serial.begin(9600);

   //Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  Blynk.begin(auth, ssid, pass, "myhostname.ru", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(xx,xx,xx,xx), 80);
}

void loop()
{
  Blynk.run();
}

@bloodninja please edit your post and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

Problem solved. I’ve choose wrong module in my sketch. Now it works fine! :grin: