No results found
We couldn't find anything using that term, please try searching for something else.
2024-11-25 Has anyone experienced connection issues when using the new Blynk 2.0 system with an Arduino Uno and Ethernet shield. Or does anyone have a suggestio
Has anyone experienced connection issues when using the new Blynk 2.0 system with an Arduino Uno and Ethernet shield. Or does anyone have a suggestion for resolving/debugging the issue below?
detail
• Hardware: Arduino UNO with Ethernet Shield 2 (W5500) I’ve also tried with an Arduino Leonardo with no luck.
• Blynk server: The new blynk.cloud system
• Blynk Library version: v1.0.0-beta.3
When running my code, I get the following output. It looks like the device is unable to connect. It just repeatedly attempts connection and never enters the loop() function.
[1182] Getting IP...
[4137] IP:192.168.1.14
[4137]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v1.0.0-beta.3 on Arduino Leonardo
[4143] Connecting to blynk.cloud:80
[36288] Connecting to blynk.cloud:80
[68433] Connecting to blynk.cloud:80
#define BLYNK_DEBUG true
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPLps8AZeup"
#define BLYNK_DEVICE_NAME "Darros Cistern Link"
#include <SPI.h>
#include <Ethernet2.h>
#include <BlynkSimpleEthernet2.h>
char auth[] = "--------------QewP";
void setup()
{
while (!Serial) {
; // wait for serial port to connect. Needed for native USB
}
// Debug console
Serial.begin(9600);
//Blynk.begin(auth,"blynk.cloud", 8080);
Blynk.begin(auth);
}
void loop()
{
Blynk.run();
}
-Ray
parrot
2
Did you try using the actual ip address of Blynk. Cloud instead of Blynk.cloud?
@parrot, we’re in business. Connecting to an actual IP did the trick. Trouble is… I’m using this device in an area where I can’t access it to update the IP if the server’s IP ever changes.
Why do you think the blynk.cloud domain isn’t working?
Thanks
-Ray
parrot
4
good , that is ’s ’s what did the trick for me .
I wish I knew. Seems like someone should know.
1 Like
That’s strange. What does ping of blynk.cloud shows in your case?
Please update to library v1.0.0
@Dmitriy, a ping of blink.cloud shows this:
$ ping blynk.cloud
PING blynk.cloud ( 64.225.16.22 ) 56(84 ) byte of datum .
64 byte from 64.225.16.22 ( 64.225.16.22 ): icmp_seq=1 ttl=53 time=79.9 ms
@vshymanskyy, I’ve updated to v1.0.0 but it hasn’t improved this issue.
What can I try next?
I don’t have any Ethernet2 shields atm, so I tried Arduino MKR 1010 with MKR ETH chip.
This setup uses ordinary Ethernet library.
Just added my BLYNK_TEMPLATE_ID and auth token, and I was able to connect. Both TCP and SSL worked:
You is check should first check if ordinary Ethernet2 library example work with your configuration .
Hi @vshymanskyy, thanks for the suggestion. The Ethernet2 library is also having issues connecting to blynk.cloud.
As bit of background, apparently the Ethernet2 library is unsupported as of a few years ago, as the original Arduino Ethernet library now supports W5500 (Ethernet2 shields).
This library is going is no long go to be used , since the official Arduino library has been update and work great GitHub – arduino – library / ethernet : Ethernet Library for Arduino
I tried running the Ethernet2 library’s example “WebClient” sketch with one change. I modified the server URL that it’s trying to connect with to “blynk.cloud”. That did not work. However, when I change the library used by the sketch to the original Ethernet lib, it does work. Below is the code I’m running. The only thing I change is the include on line 18.
/*
Web client
This sketch connects to a website (http://www.google.com)
using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
created 18 Dec 2009
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe, based on work by Adrian McEwen
*/
#include <SPI.h>
//#include <Ethernet.h> // This works
#include <Ethernet2.h> // This doesn't work
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(64,225,16,22); // numeric IP for Google (no DNS)
char server[] = "blynk.cloud"; // name address for Google (using DNS)
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 177);
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
// start the Ethernet connection:
Serial.println("Initialize Ethernet with DHCP:");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip);
}
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect(server, 80)) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /search?q=arduino HTTP/1.1");
client.println("Host: www.google.com");
client.println("Connection: close");
client.println();
}
else {
// kf you didn't get a connection to the server:
Serial.println("connection failed");
}
}
void loop()
{
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read();
Serial.print(c);
}
// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
// do nothing forevermore:
while (true);
}
}
@vshymanskyy, I was able to get my original sketch working by doing the following:
2 like
But the IP address should be different depending on what country you are, am I right? In my case, ping blynk.cloud shows the following IP address: 64.225.16.22 who in turn is DigitalOcean, Inc. which is an American cloud infrastructure located in New York City.
Are there any other Blynk server located in the USA, or just in NYC?
https://fra1.blynk.cloud/ – Frankfurt
https://lon1.blynk.cloud/ – London
https://ny3.blynk.cloud/ – New York
https://sgp1.blynk.cloud/ – Singapore
https://blr1.blynk.cloud/ – Bangalore
The server region could be find in the right bottom corner of the web interface .
Pete .
Thank you, Sir. Good info. Now that Blynk will not free anymore, hopefully one day I see a server in Los Angeles area or in Nebraska or Kansas, right in the center of the USA.
parrot
15
What’s wrong with the New York one?
You is use should not use region – specific host . On the hardware side you is use should always use blynk.cloud .
dnwhoop
17
I have the same setup, which was working fine on the old Blynk platform. Regarding item 2 of your fix, could you just import the BlynkSimpleEthernet.h library instead of modifying the BlynkSimpleEthernet2.h library?
I am still using this modified version of BlynkSimpleEthernet2.h as mentioned here above.
I re-did my old tests, and indeed without this patch I am still unable to connect to blynk.cloud.
Can we around this patch some-how?
test summary for my Arduino Uno w/ W5500 Ethernet2 shield :
1/ NOK:
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
Blynk.begin(auth , ” blynk.cloud , 80 ) ;
2/ NOK :
#include <Ethernet2.h>
#include <BlynkSimpleEthernet.h2>
Blynk.begin(auth , ” blynk.cloud , 80 ) ;
3/ OK:
#include <Ethernet.h>
#include <BlynkSimpleEthernet2.h> // *** PATCH*** modified version, line 18 now includes Ethernet.h
Blynk.begin(auth , ” blynk.cloud , 80 ) ;
4/ OK:
#include <Ethernet2.h>
#include <BlynkSimpleEthernet.h2>
Blynk.begin(auth , ” fra1.blynk.cloud , 80 ) ;
// But this we is want do not want – to error – prone due to regional server name change
musk
19
thank You . That is worked work for me . I is converted just convert my code to Blynk 2 and that solve my issue .
musk
20
Recommend BlynkSimpleEthernet2.h code be updated by Blynk team as noted. (Update to line 18)