Using websocket with NodeMCU failed

Hello Dudes and Dudettes,

I have flshed my NodeMCU with some Code and I will not connect to my internet proberly I think.
I want to use Amazon Alexa and IFTTT to comunicate with the Node and a hooked up relais to create a wifi switch.

this is the code i used for it:

/*
 *Netmedias
 *
 *  Created on: 24.05.2015
 *  
 */
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <WebSocketsClient.h>
#include <Hash.h>


// @@@@@@@@@@@@@@@ You only need to midify modify wi-fi and domain info @@@@@@@@@@@@@@@@@@@@
const char* ssid     = "**Censored :D **"; //enter your ssid/ wi-fi(case sensitive) router name - 2.4 Ghz only
const char* password = "**Censored :D **";     // enter ssid password (case sensitive)
char host[] = "https://blackholecorealexa.herokuapp.com/"; //192.168.0.100 -enter your Heroku domain name like  "alexagoogleifttt.herokuapp.com" 
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

int port = 80;
char path[] = "/ws"; 
ESP8266WiFiMulti WiFiMulti;
WebSocketsClient webSocket;
const int relayPin = 5;
DynamicJsonBuffer jsonBuffer;
String currState;
int pingCount = 0;
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) { //uint8_t *


    switch(type) {
        case WStype_DISCONNECTED:
           Serial.println("Disconnected! ");
           Serial.println("Connecting...");
               webSocket.begin(host, port, path);
               webSocket.onEvent(webSocketEvent);
            break;
            
        case WStype_CONNECTED:
            {
             Serial.println("Connected! ");
          // send message to server when Connected
            webSocket.sendTXT("Connected");
            }
            break;
            
        case WStype_TEXT:
            Serial.println("Got data");
              //data = (char*)payload;
           processWebScoketRequest((char*)payload);
            break;
            
        case WStype_BIN:

            hexdump(payload, length);
            Serial.print("Got bin");
            // send data to server
            webSocket.sendBIN(payload, length);
            break;
    }

}

void setup() {
    Serial.begin(115200);
    Serial.setDebugOutput(true);
    
    pinMode(relayPin, OUTPUT);
    
      for(uint8_t t = 4; t > 0; t--) {
          delay(1000);
      }
    Serial.println();
    Serial.println();
    Serial.print("Connecting to ");
    
    //Serial.println(ssid);
    WiFiMulti.addAP(ssid, password);

    //WiFi.disconnect();
    while(WiFiMulti.run() != WL_CONNECTED) {
      Serial.print(".");
        delay(100);
    }
    Serial.println("Connected to wi-fi");
    webSocket.begin(host, port, path);
    webSocket.onEvent(webSocketEvent);

}

void loop() {
    webSocket.loop();
  //If you make change to delay make sure adjust the ping
    delay(2000);
  // make sure after every 40 seconds send a ping to Heroku
  //so it does not terminate the websocket connection
  //This is to keep the conncetion alive between ESP and Heroku
  if (pingCount > 20) {
    pingCount = 0;
    webSocket.sendTXT("\"heartbeat\":\"keepalive\"");
  }
  else {
    pingCount += 1;
  }
}

void processWebScoketRequest(String data){

            JsonObject& root = jsonBuffer.parseObject(data);
            String device = (const char*)root["device"];
            String location = (const char*)root["location"];
            String state = (const char*)root["state"];
            String query = (const char*)root["query"];
            String message="";

            Serial.println(data);
            Serial.println(state);
            if(query == "cmd"){ //if query check state
              Serial.println("Recieved command!");
                    if(state=="on"){
                      digitalWrite(relayPin, HIGH);
                      message = "{\"state\":\"ON\"}";
                      currState = "ON";
                    }else{
                      digitalWrite(relayPin, LOW);
                      message = "{\"state\":\"OFF\"}";
                      currState = "OFF";
                    }
                  
            }else if(query == "?"){ //if command then execute   
              Serial.println("Recieved query!");
              int state = digitalRead(relayPin);
                 if(currState=="ON"){
                      message = "{\"state\":\"ON\"}";
                    }else{
                      message = "{\"state\":\"OFF\"}";
                    }
            }else{//can not recognized the command
              Serial.println("Command is not recognized!");
            }
            Serial.print("Sending response back");
            Serial.println(message);
                  // send message to server
                  webSocket.sendTXT(message);
                  if(query == "cmd" || query == "?"){webSocket.sendTXT(message);}
}

and thats the failure code that comes out :’(

state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
cnt 

connected with Hellmich, channel 1
dhcp client start...
ip:192.168.178.56,mask:255.255.255.0,gw:192.168.178.1


Connecting to Connected to wi-fi
pm open,type:2 0
Disconnected! 
Connecting...
Disconnected! 
Connecting...
Disconnected! 
Connecting...
Disconnected!

I really hope that you can help me out of this …

Kind regards
blackholecore

This combination doesn’t look too good:

char host[] = "https://blackholecorealexa.herokuapp.com/";
. . .
int port = 80;

Https is normally port 443. Esp8266 supports for https is limited ( or even nonexistent ).
Also the comment for the host variable implies it should be a pure hostname ie without any http etc. prefix.

I changed nothing and now if I open up the console I got these

Connecting to f r0, ..error: pll_cal exceeds 2ms!!!
.error: pll_cal exceeds 2ms!!!
.error: pll_cal exceeds 2ms!!!
.error: pll_cal exceeds 2ms!!!
error: pll_cal exceeds 2ms!!!

also tried with port 443 and shorten url ... no change still get the code above

Is the server with IP address 192.168.178.56 the same as blackholecorealexa.herokuapp.com ?
It looks like a non-routable IP address so I guess it is in your local network.
Can you modify the configuration of the web server so it allows plain http (port 80) instead of https (which from the code you supplied, appears to be configured for https).

its the ESP module on the NodeMCU

how can i do this ?