Freezing in setup

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?

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

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

No, but you may find it around :wink:

Awesome. Thank you very much

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

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

Pete.

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)

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.

You can start with simply Blynk.config(auth)

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

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?

I show you a log in a few hoursā€¦ Iā€™m in a work and canā€™t get itā€¦

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.

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

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.

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.

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.

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)

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