Blynk-cloud.com Difference between using port 80 or port 8080 on GSM/3G - APN Restrictions

Platform: NodeMCU 0,9. (ESP-12e)

Arduino core: SDK:2.2.1(cfd48f3)/Core:2.4.2/lwIP:2.0.3(STABLE-2_0_3_RELEASE/glue:arduino-2.4.1-13-g163bb82)/BearSSL:6d1cefc

Blynk Library 0.5.4

ESP8266: ESP ardjuino communitity core - 2.4.2 (non Git version)

IDE: Arduino/Windows 64 1.8.5

LWIP: V2 Lower Memory

Description of issue:
After running the Blynk Example sketch Nodemcu successfully connecting to Blynk-cloud via my home wifi router (Mikrotik HAP lite on a Fiber PPP line to the local ISP).
I set up a 3g Smartphone as a tethered Hotspot and changed the sketch WIFI SSID and password to that of the hotspot.
The NodeMCU WIFI service would connect to the 3G smartphone hotspot OK but the TCP/IP connection to Blynk-cloud would close after my NodeMCU passes the token with the debug message: .Login Timeout, the sketch would continously re-try to connect but never succeed.

After much testing and trying another 3G tethered WIFI hotpot as well as increasing the timeout time in the config header file, trying different LWIP settings in the IDE.

I finally managed to get a good connection by using blynk-cloud port 8080 instead of port 80

Can anyone shed some light on why when using a tethered hotspot as the internet connection port 8080 works and port 80 does not?

Here is the debug print of a failed connection using port 80 on the tethered 3G phone:

SDK:2.2.1(cfd48f3)/Core:2.4.2/lwIP:2.0.3(STABLE-2_0_3_RELEASE/glue:arduino-2.4.1-13-g163bb82)/BearSSL:6d1cefc
[56] Connecting to Grace 3G
sta config unchangedscandone
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt 

connected with Grace 3G, channel 6
dhcp client start...
ip:192.168.43.214,mask:255.255.255.0,gw:192.168.43.1
[562] Connected to WiFi
[562] IP: 192.168.43.214
[562] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.4 on NodeMCU

[568] Connecting to blynk-cloud.com:80
:ref 1
[877] <[02|00|01|00] 4a35cc17934c4dbe933bf0871e8021db
:wr 37 37 0
:wrc 37 37 0
:ack 37
[3879] Login timeout
:close
[5879] Connecting to blynk-cloud.com:80
:ur 1
:del
:ref 1
[6187] <[02|00|01|00] 4a35cc17934c4dbe933bf0871e8021db
:wr 37 37 0
:wrc 37 37 0
:ack 37
[9188] Login timeout
:close
pm open,type:2 0

Port 80 will work in many cases, but Port 8080 is the new recommended port for hardware (AKA your device sketch settings) for both Cloud and Local Servers.

As to the networking hows and whys… Something to do with less blocking by ISPs or whatever… only the experts understand :stuck_out_tongue:

port 80 is usually used for HTTP, some services also use that port for non-HTTP stuff because port 80 is usually left open on most networks.

It appears that the service provider of the phone is trying to do stuff with data going through port 80 and or blocking it when they see it is not HTTP traffic so it fails. Using port 8080 avoids their shenanigans.

Thanks for your responces! thats very interesting.
I did a little digging:
Mobile data APN restrictions - Ports

1 Like