Can only connect one device at a time to Blynk Local Server

I am struggling because I can only connect one device at a time to my Blynk Local Server. I set it up on a Raspberry Pi, have enabled port forwarding on my router, and am using Duck DNS to be able to access it from outside my local network. I have created several Blynk projects that allow me to control various ESP8266 and ESP32 devices. The individual devices seem to be working properly, but the issue is that once one of them is connected, any attempts to connect additional devices hang up at the Blynk.connect() command. The devices connect to my server using TCP port 8080, and my Blynk phone app connects using TCP port 9443.

After connecting to my WiFi, my Arduino sketches issue the following commands:

const char *auth = “my_token”;
const char *server = “my_acct.duckdns.org”;
int port = 8080;
Blynk.config(auth,server,port);
while (!Blynk.connect());

What am I missing?

So are your devices outside of the network that your local server is connected to?

Also, are you using a separate (different) auth token for each device?

Pete.

Thanks for your interest in my issue. The IoT devices I am trying to access are all connected to the same WiFi network as my local Blynk server. Each device has its own Blynk project with a unique auth token.

So why are you sending your data packets outside of your network, across the internet via your Duck DNS service and back into your network via your public IP address?

The sensible thing to do would be to replace this:

With the local IP address of your local server to keep all of your data packets internal to your network.

Pete.

The reason for the port forwarding is to be able to use my Blynk app to control these devices when my phone is outside my local network.

I don’t think you understand how port forwarding works.

It’s only needed for a device that is outside of your network. Your NodeMCUs etc are inside the network, so should connect directly. Your app will use the DDNS and port forwarding oif 9443 to enable it to talk with your server when outside of the network.

Pete.

1 Like