ESP8266 D1 Mini - Cloud login port

Hello fellow Blynkers. New here. First post.

Have scoured this board and found way too many confusing and off-topic posts. So am reverting to creating my own for something that should be as simple as promised by Blynk.

I have a ESP8266 D1 mini. I went through the getting started section and uploaded the default ESP8266_Standalone script to my D1 mini. Added in my auth token. It connects to my WAP ok but then tries to connect to blynk-cloud and fails. I keep getting ‘login timeout’ in serial output, like so:

[57022] Connecting to blynk-cloud.com:80
[59143] Login timeout

If I manually try to browse to blynk-cloud.com:80 and I am automatically redirected to blynk.cc so clearly something is wrong with the cloud URI end point (wrong port?).

Where am I going wrong? Assistance greatly appreciated.

Thanks,
Mark

Can you post the code you’re using (correctly formatted), but don’t share your Auth code.

Pete.

Thanks Pete.

My code was copied from https://examples.blynk.cc/?board=WeMos%20D1&shield=ESP8266%20WiFi&example=GettingStarted%2FBlynkBlink

Not sure why I referred to it as ESP8266_Standalone … I think a remnant from hours of searching and trying loads of examples (ah, standalone script is mentioned in the documentation section - the code looks the same as the ‘getting started’ section).

My board isn’t a WeMos D1 mini - but is identical. All WeMos D1 Mini code I’ve tried on it works just fine.

Board: WeMos D1
Connection: ESP8266 WIFI

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "xxx";
char ssid[] = "xxx";
char pass[] = "xxx";

void setup()
{
  // Debug console
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
}

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

Forgot to show the Serial output:

[19781] Connecting to AndroidAP
[26132] Connected to WiFi
[26132] IP: 192.168.43.249
[26132] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.3 on Arduino

  Give Blynk a Github star! => https : // github . com / blynkkk / blynk-library

[26145] Connecting to blynk-cloud.com:80
[28415] Login timeout
_(these 2 lines just keep repeating)_

Hi, consider this a stupid question… or not… but… have you checked that you can access to blynk-cloud.com:80 through your arduino internet shared access?

Yes. As mentioned earlier, I’ve tried this but only to be redirected to blynk.cc website.

I also manually tried going to blynk-cloud . com : 8442 (as per the example given on the getting started page -> https : // www . blynk . cc / getting-started /). Same result - I am redirected to blynk.cc website.

  • Incidentally Blynk, why is there a discrepancy in ports shown? Very confusing.

  • Also Blynk, why is it so hard to post URLs ? very annoying as I can’t even show all reference URLs to Blynk’s own website in my posts.

The blynk-cloud.com:80 URL re-directs to blynk.cc if you try to access it in a browser.

Do you have an alternative Wi-Fi network to connect to, rather than what I suspect is the Wi-Fi hotspot on your Android phone?

By the way, when you’re posting code you need to use backticks, not asterisks. That’s why your code didn’t display correctly, and may be why your posts have been flagged.

Pete.

Many thanks Pete.

Yes, am attempting to run off my Android hotspot, as I’m in a hotel on a biz trip and have no access to a ‘regular’ access point. I tried the hotel AP but of course it redirects to the hotel’s webpage asking for login creds, so no good for testing Blynk code.

Re code, when I joined this community, it clearly showed code had to be between ‘asterisk asterisk cpp’ and ‘asterisk asterisk’ (I cannot actually use the chars for fear of stuff up the post even more).

Boy are the instructions on this site contradictory. First 80 vs 8442 port, and now code insertion :slight_smile:

I’ll go back and try your double slash suggestion. I cannot find in the site anywhere that mentions code insertion. Must have been in the welcome email?

It’s not double slash, it’s three backticks followed by cpp at the top, then three backticks at the end of your code.

When you create a new post you get full instructions on how to post code. You deleted these before you began your first post.

Pete.

Thanks. I saw asterisk not backtick. Been a long day - might be seeing things. Regardless, I cannot seem to edit those old posts now anyway as they are locked.

I will have to wait until I’m back home on the weekend and connect to my home wifi to resume testing.

Still confused about port 80 vs 8442. All posts I see about 8442 are back in 2017 and earlier. So perhaps 80 is the new standard?

Appreciate everyone’s comments on what should have been a much easier journey into Blynk.

Cheers,
Mark

Ports have changed recently, presumably to avoid the more obscure ports being blocked by ISPs.

As you’re not specifying a port in your Blynk.begin command it doesn’t really matter whats going on tn the background with ports.

I’m sure if you looked around you’d be able to find an unsecured network that you can connect to for a bit of testing.

Pete.

Out of the 30-odd networks within range of this hotel, only 4 are open and all lead to a website for creds. So I’ll have to wait before I can resume testing. But good suggestion - thanks Pete.

As a side note, I’d be interested to learn why my Android phone hotspot doesn’t work for Blynk driven devices (like my ESP8266) when I join my hotspot from my laptop and surf the net, access email and participate in this forum. For all intent-and-purposes, it’s just an AP that happens to bridge/route to my 4G cell connection to the net. The same thing happens with my home wifi modem/router - it acts as an AP and routes the wifi (or Ethernet cable) traffic out to the modem which is connected via copper to the street and out to the net.

They can be tricky to see and identify :slight_smile: even more so in a phone KB
Blynk - FTFC

As long as your device also connects to the same hotspot, then it should work just fine… unless your cell provider is interfering with the default port.

You can try pinging blynk-cloud.com from your laptop/phoneAP and use that IP instead, also try with port 8080

Blynk.begin(auth, wifi, ssid, pass, "xxx.xxx.xxx.xxx", 8080);

Yes, Blynk is in constant development… but the time effort in maintaining the documentation means it lags behind.

Appreciate your feedback Gunner.

I’ve got the back-ticks sorted :slight_smile:

Regarding my cell phone hotspot - yes, my Arduino device connects to it just fine (it just can’t seem to log in to the blynk cloud - as shown in my sample Serial output session a few posts ago). My laptop connects to the phone hotspot perfectly - have been doing this for years as I travel on business a lot and this ‘Wifi/4G tethering’ allows me to surf the net, use Outlook, and remote in to various client site virtual machines over VPN. So I was quite surprised when my Arduino wouldn’t log in to blynk cloud - which got me thinking about the 80 vs 8442 port (now understood as a red herring). Browsing manually to the blynk cloud only redirected me back to blynk . cc web site.

I will try your IP address trick later this evening when I’m back in my hotel.

Yes, appreciate the fact that the documentation lags behind development, but that doesn’t help newcomers. Creating frustration just slows down service uptake.

Again, thanks for the assist.

Cheers,
Mark

1 Like

Ok, at hotel. Ran some tests.

Setup
a) android phone put into hotspot mode. 4G cell becomes the gateway to the net. phone is sitting on the coffee table - it is NOT plugged in to my laptop, so there is no USB path from laptop to phone.
b) laptop connected to the hotspot (via wifi of course). laptop does NOT have any Ethernet cable plugged in.

Comms Validation

  1. from phone I can browse to various websites, have outlook access corporate exchange mail. mobile phone provider (carrier) does not block port 80 (or any ports or URI’s I am aware of - we’ve got it pretty good in Australia from this perspective).
  2. from laptop I can browse to various websites (inc this community forum as I type this post), get outlook to send/retrieve email, access remote sites via VPN.
  3. from laptop can ping blynk - cloud . com (results in 45.55.96.14). Not great latency but presumably ok for IoT.
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\mread> ping blynk-cloud.com

Pinging blynk-cloud.com [45.55.96.146] with 32 bytes of data:
Reply from 45.55.96.146: bytes=32 time=364ms TTL=48
Reply from 45.55.96.146: bytes=32 time=385ms TTL=48
Reply from 45.55.96.146: bytes=32 time=596ms TTL=48
Reply from 45.55.96.146: bytes=32 time=376ms TTL=48

Ping statistics for 45.55.96.146:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 364ms, Maximum = 596ms, Average = 430ms
PS C:\Users\mread>
  1. can telnet from laptop to blynk - cloud . com port 80 and 45.55.96.14 (naturally I don’t know what to type to login, so I just type ‘hello’ and I rcve a html response say invalid page or some such, as anticipated).

ESP8662 (WeMos D1 mini clone)

  1. loaded with blynk sketch from Getting Started section on blynk website.
  2. modified Blynk.begin to use the IP address of blynk cloud service as suggested by Gunner.
  3. both laptop and D1 mini connect to the hotspot just fine.
    (I don’t know how to embed an image into a post so can’t show you screenshot of phone and hotspot clients)
  4. D1 mini still cannot log in to the cloud service. This is the bit I cannot understand why.
[18789] Connecting to AndroidAP
[25630] Connected to WiFi
[25630] IP: 192.168.43.249
[25630] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.3 on Arduino

  Give Blynk a Github star! => https://github.com/blynkkk/blynk-library

[25643] Connecting to 45.55.96.14:80
[25710] <[02|00|01|00] 739fa6f206d84124acxxxxxc19773yyy _(I've got DEBUG on)_
[27712] Login timeout

_(script continues to connect and keeps getting timeout)_

My blynk script:

#define BLYNK_DEBUG
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "739fa6f206d84124acxxxxxc19773yyy";
char ssid[] = "AndroidAP";
char pass[] = "wbbnzzzz";

void setup()
{
  Serial.begin(115200);
  Serial.printf("SSID: %s\n", ssid);
  Blynk.begin(auth, ssid, pass, "45.55.96.14"); // blynk-cloud.com = 45.55.96.14
}

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

So, any ideas anyone? What else can I try?

NB: As mentioned in earlier posts, this D1 mini can run other (non-blynk) scripts just fine (blink inbuilt led, web server, web client, wifi scanner). So I’m comfortable I’ve got the correct Arduino ESP8266 drivers/libraries etc loaded ok.

Seems like a lot. Where are you geographically (country, city)?

Hm… Do you connect through some VPN? When did you registered to the blynk initially you was in Australia?
Could you please also ping 188.166.206.43?

Not using VPN.

Yes, registered on Blynk community last night (my time - approx. 22-24 hrs ago) from same location (Canberra, Australia).

Here some ping times to various USA sites …

PS C:\Users\mread> ping google.com

Pinging google.com [172.217.25.174] with 32 bytes of data
Reply from 172.217.25.174: bytes=32 time=50ms TTL=54
Reply from 172.217.25.174: bytes=32 time=97ms TTL=54
Reply from 172.217.25.174: bytes=32 time=168ms TTL=54
Reply from 172.217.25.174: bytes=32 time=61ms TTL=54

Ping statistics for 172.217.25.174:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 50ms, Maximum = 168ms, Average = 94ms
PS C:\Users\mread>
PS C:\Users\mread>
PS C:\Users\mread>
PS C:\Users\mread> ping cnn.com

Pinging cnn.com [151.101.129.67] with 32 bytes of data:
Reply from 151.101.129.67: bytes=32 time=50ms TTL=57
Reply from 151.101.129.67: bytes=32 time=94ms TTL=57
Reply from 151.101.129.67: bytes=32 time=75ms TTL=57
Reply from 151.101.129.67: bytes=32 time=59ms TTL=57

Ping statistics for 151.101.129.67:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 50ms, Maximum = 94ms, Average = 69ms
PS C:\Users\mread>
PS C:\Users\mread>
PS C:\Users\mread>
PS C:\Users\mread> ping 188.166.206.43

Pinging 188.166.206.43 with 32 bytes of data:
Reply from 188.166.206.43: bytes=32 time=547ms TTL=49
Reply from 188.166.206.43: bytes=32 time=345ms TTL=49
Reply from 188.166.206.43: bytes=32 time=671ms TTL=49
Reply from 188.166.206.43: bytes=32 time=295ms TTL=49

Ping statistics for 188.166.206.43:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 295ms, Maximum = 671ms, Average = 464ms
PS C:\Users\mread>

As a quick test, I disconnected my laptop from the phone’s hotspot and connected to hotel wifi. Here’s the ping results:

PS C:\Users\mread> ping 188.166.206.43

Pinging 188.166.206.43 with 32 bytes of data:
Reply from 188.166.206.43: bytes=32 time=115ms TTL=54
Reply from 188.166.206.43: bytes=32 time=106ms TTL=54
Reply from 188.166.206.43: bytes=32 time=145ms TTL=54
Reply from 188.166.206.43: bytes=32 time=107ms TTL=54

Ping statistics for 188.166.206.43:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 106ms, Maximum = 145ms, Average = 118ms
PS C:\Users\mread>

Better result but I can’t use hotel wifi because it redirects to a login page (so no good for IoT device).

Well… That’s is sad, but seems the closest Blynk server is 450ms away from your current network. The best way to solve this problem would be to install the Local Server in your location and use it. Unfortunately, our host provider doesn’t have any DC in the Australia, so we can’t extend Blynk cloud to that region (well, there are some workarounds, but at the moment efforts don’t worth it).