How does the App connect to the Local Blynk Server?


Maybe I’m very curious…

I’m wondering how the App knows about the location of the local blynk server. When using the cloud I guess that both the App and the device sketch connect to a cloud service to interchange information between them, but what about the local server?

The device sketch locates the local server through the parameters at Blynk.begin(auth, SSID, pass), but I can’t figure out how the App locates the local server with just a token without accessing the cloud.

Hello -

Before the app can get to the cloud it has to go through a router and effectively the router does the magic i.e. connects you to your local server on the LAN rather than going out to the cloud.

I know that, thank you. I didn’t explain properly. I mean how the App can access the local blynk server when it’s home away, that’s it, when it’s out of the wifi access point range, just connected to the Internet through 4G.

@Dmitriy thanks, I’ve read the docs several times. Very well documented, indeed.

@kelondrio without additional steps the local server can’t be accessed when you are not “at home”.

Just like any internet server the procedure is to open the ports for access via the WAN.

Google port forwarding but take care or the whole world will have access to your server.

First you provide your router’s External IP address when loging into local server on the app… of course that brings you right back to what @Costas was pointing out… your router needs to be set up with port forwarding from the internet to your local server, etc, etc. … basically what @Costas said :slight_smile:

1 Like

Thanks @Costas and @Gunner, I get it now.

how to do port forwarding if my connection with router from isp is behind double NAT

@d95412n please don’t spam old topics with off-topic questions, especially when it’s already been explained to you, in great detail, that running a Blynk local server behind a double NAT isn’t possible unless you ask your ISP for a static/dedicated public IP address.