I dont know which port to use

Hey!

I am running my local server on 192,168.1.15 but I dont know which port to use. I am trying to use port 8443 and logging in on blynk app but it shows “reconnecting to server” and i am not able to login.

Please help!

Thank you.

9443 in the App, 8080 in the device sketch.

Got it thanks. I went through the threads of new server properties and all with the new version. I was using server 0.28 version. Updated to 0.38 (jumped a lot). And it starts working.

One more query, in my sketch (based on blynk cloud server, need to change it to local server based) i am using blynk. config command and not blynk.begin so what changes should i make?

Doesn’t matter which one for determining the server type/IP… I have a basic template here that shows what I use…

I am referring to this post. I am also using wifimanager

I have never used it.

when i put blynk.config(auth, ipaddress(), port), I get random errors

As I showed in my link above… try this

char auth[] = "xxxxxxxxxx";
char ssid[] = "xxxxxxxxxx";
char pass[] = "xxxxxxxxxx";
char server[] = "xxx.xxx.xxx.xxx";  // IP for your Local Server
int port = 8080;

WiFi.begin(ssid, pass); 
Blynk.config(auth, server, port);
Blynk.connect();

Or in a shorter format…

Blynk.config(d1e516ca1d8b4xxxxxxxxxxc786907a90, "xxx.xxx.xxx.xxx", 8080);

As for WiFiManager… I have never used it…

When I write blynk.config(auth, “192.168.1.15”, 8080) i start getting random errors about functions not being in scope. What should I do? It was working fine with blynk cloud server.

Thanks. I appreciate your dedicated help

I don’t really understand what you are trying… but WiFiManager, as I understand it, allows you to connect your device WITHOUT hardcoding in the IP address, etc. So I think you are trying to mix and match two separate connection methodologies.

Yeah so basically using wifimanager I can connect my esp device to the WiFi network without hardcoding the ssid and password of WiFi network. Now when it’s connected the WiFi network I want it to be able to access my blynk local server so for that I am trying to provide the ip address of my blynk local server (not WiFi network)

Hi. It turns out that i was doing blynk.config(aut,“192.168.1.15”, 8080); correctly however it was the arduino ide 1.6.9 that was giving errors. I upgraded to 1.8.5 and the local server with wifi manager works smoothly.

I am able to control esp with Alexa but now the blynk app on my mobile shows the esp is offline.

Thanks.

1 Like

Have you told your app to use the local server rather than the cloud server, and generated an auth code for your project using your local server?
If you want your mobile device to access your local server when it’s not connected to your home Wi-Fi then you’ll need to set-up port forwarding on your router.

Pete.

All devices are currently on same wifi network.

My app is connected to local server using port 9443. Server (on same wifi network) IP address “192.168.1.15”

On my esp i have written command blynk.config(auth, “192.168.1.15”, 8080) and auth is authorisation token I have genereated from the app.

EDIT
My phone is able to connect to the server as I am able to login to the blynk app. I believe that the ESP is not able to connect to the local server and that is why it is showing offline. So there must a problem either with the auth code or the blynk.config command. I have checked the auth code again. So that means there has to be a problem with blynk.config command more specifically IP Address or the port 8080. IP address is correct so essentially the problem is with 8080, right?

What output are you getting on your serial monitor from the ESP?
Have you tried turning on Blynk debug?

Pete.

This is serial monitor output:-
AutoConnect
Connecting as wifi client…
Using last saved values, should be faster
Connection result:
3
IP Address:
192.168.1.12
Begin multicast…
Udp multicast server started at 239.255.255.250:1900
WebServer started on port:
80
Adding switch : light index : 0

No I have not tried Blynk Debug

EDIT:
YES IT STARTED WORKING. I modified blynk.config(aut, “192.168.1.15”, 8080) to blynk.config(auth,“192.168.1.15”,80)

So no Blynk related output at all. Is your sketch actually getting to the point where it runs a Blynk.connect command?
What happens when you turn on Blynk debug?

Have you tried using a simpler sketch?

Pete.

It has started to work. The serial monitor has started to show “Sending response to server 192.168.1.15” and is also showing Udp belkin request. But there is no sign of Blynk.connect in the serial monitor. However it is working fine.

Now I able to control the esp through the blynk app after I changed port from 8080 to 80 in the blynk.config command

Everything is correct right?

Now i want to turn on port forwarding so that I can use my esp and phone blynk app even if they are on different internet networks (but connected to my local blynk server). I would be really thankful to you if you could point me to some guiding instructions or tutorials.

Chirag