BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Freezing in setup

#1

NodeMCU/ESP8266

Good day!
Problem in freezing equipment when hardware in

setup();
.....
Blynk.begin(auth, ssid, pass);
Blynk.syncVirtual(V10); //Setpoint for channel 1
...

when there are problems with the Internet Blynk.begin freezing
Can you tell me - how can I TRY Blynk.begin and reset/reboot if it fail?

0 Likes

Nodemcu12E- Can't connect to cloud.blynk.cc:8442
#2

As mentioned many times in this forum before, Blynk.begin is a blocking function, you can alternatively manage the connection yourself and use Blynk.config http://docs.blynk.cc/#blynk-firmware-configuration-blynkconfig

0 Likes

#3

Can you write an example scetch with setup and loop blocks. Please :slight_smile:

0 Likes

#4

No, but you may find it around :wink:

0 Likes

#5

Awesome. Thank you very much

0 Likes

#6

Pardon, but can you tell me how can I get IP adress of blynk-cloud.com in scetch? DNS as always lay down…

 IPAddress Blynk_Server_IP;
 WiFi.hostByName("blynk-cloud.com", Blynk_Server_IP);

Is not working

0 Likes

#7

Why do you need the IP address of the Blynk Cloud server in your sketch?

Pete.

0 Likes

#9

Whith mobile internet all working fine.
if I use the provider internet (not mobile) - the wire internet - NodeMCU not connecting to blynk-cloud.com. If I use ping in cmd and then take IP and use in scetch Blynk.config(auth,
IPAddress(xxx,xxx,xxx,xxx), 8080) - it works.
What i need - I need a code which is defines IP adrees of blynk-cloud.com.

Then i will take it and paste in Blynk.config(auth, IPAddress(xxx,xxx,xxx,xxx), 8080)

0 Likes

#10

Well, I’m fairly certain that Blynk.config(auth, “blynk-cloud.com”, 80) will work fine, but if the IP address is needed then just ping blynk-cloud.com from your PC and use the resulting IP address (with commas instead of decimal points).

Pete.

0 Likes

#11

You can start with simply Blynk.config(auth)

0 Likes

#12

Problem is not in Blynk. It is a problem with DNS by provider.
I need a code (piece of scatch), which ping blynk-cloud.com and detect the IP adress

0 Likes

#13

Blynk library does it automatically for you, as suggested, have you tried Blynk.config(auth)? If that is not working, what does the Serial Monitor shows?

0 Likes

#14

I show you a log in a few hours… I’m in a work and can’t get it…

0 Likes

#15

Why aren’t you happy about the idea of pinging blynk-cloud.com from your PC then hard-coding the result into your sketch?

Pete.

0 Likes

#16

May be you are right. But can you tell me can the static IP of blynk-cloud.ru change?
Or it is not possible?

0 Likes

#17

I assume you mean blynk-cloud.com?

Of course it’s possible that it could change in future, but as it’s necessary to hard-code the IP address of the appropriate regional Blynk cloud server when making API calls from services like IFTTT then there would be a lot of disgruntled Blynk users if this happened.

As I said in the other post you made, you could of course use something like Wi-Fi Manager if you wnat the ability to use a different IP address without re-flashing your device.

Pete.

0 Likes

#18

Sorry about.
But can you show me a code how can I get it with WiFI manager?
Sorry about offtopic and my apologize for my persistence.
And surely - blynk-cloud.com
It is important to me if I will use local server in another cloud.

0 Likes

#19

If you use the search facility on this forum you’ll find some Wi-Fi Manager examples. Personally, I don’t think it’s necessary to do that though.

I’m not sure what you’re saying here, but re-flashing your hardware with updated settings should only be a two minute job, especially if you use OTA.
Re-flashing is sometimes a good idea anyway, as changes to the Blynk libraries and ESP core are sometimes necessary to fix vulnerabilities and bugs. In an ideal world the App, Server and Library versions should always be in synch.

Pete.

0 Likes

#20

I’m very apologize. I want to get IP:


WiFi.begin(ssid, pass);

IPAddress Blynk_Server_IP;
WiFi.hostByName(“blynk-cloud.com”, Blynk_Server_IP);
Serial.print("IP адрес облака blynk-cloud.com: ");
Serial.println(Blynk_Server_IP);

But the request is:

IP адрес облака blynk-cloud.com: (IP unset)

0 Likes

#21

You’re missing basic concepts, You’re declaring the IPAddress here:

Why don’t you stick with the basic examples first? I already sent the link for several examples, have you tried those?

1 Like