[SOLVED] ENC28J60 and Mega do not connect to DHCP/Blynk cloud server

First of all amazing conzept guyz!!! Apriciate all the effort!
But I cannot get working my first project:

I have win10, arduino IDE 1.7.11, Blynk release 0.4.0 installed manually (actually longside with just “Blynk” which I installed previously)
DHCP works fine, have slots etc. I have all the libraryes installed, using ENC28J60 example and it’s got compiled with no erros. I checked wiring according to instruction in the sketch (there was an error - “int” wire was not conected, but after fixing it nothing changed). And I’m using my project token.

So when I’m running it with DHCP I have in Serial Monitor:
[0] Blynk v0.4.0 on Arduino Mega
[0] Getting IP…
[60447] DHCP Failed!
and so on…

When I’m runing it with manual adresses:
[0] Blynk v0.4.0 on Arduino Mega
[0] Using static IP
[1051] IP:192.168.1.27
[5001] Connecting to blynk-cloud.com:8442
[20058] Connecting to blynk-cloud.com:8442
[35116] Connecting to blynk-cloud.com:8442
and so on…

Below is the sketch I’m using for manual settings, while trying to use DHCP I just changing my Token in original ENC28J60 example:

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <UIPEthernet.h>
#include <BlynkSimpleUIPEthernet.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "efcc**********************6acba";

// Mac address should be different for each device in your LAN
//byte arduino_mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
byte arduino_mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress arduino_ip ( 192, 168,   1,  27);
IPAddress dns_ip     ( 192, 168,   1,   1);
IPAddress gateway_ip ( 192, 168,   1,   1);
IPAddress subnet_mask(255, 255, 255,   0);


void setup()
{
  Serial.begin(9600);
  //Blynk.begin(auth);
  // You can also specify server.
  // For more options, see BoardsAndShields/Arduino_Ethernet_Manual example
  Blynk.begin(auth, "blynk-cloud.com", 8442, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);
  //Blynk.begin(auth, IPAddress(192,168,1,21), 8888);
  //Blynk.begin(auth, "blynk-cloud.com", 8442);
}

void loop()
{
  Blynk.run();
}
1 Like

Maybe try google dns?

same result ((
[0] Blynk v0.4.0 on Arduino Mega
[0] Using static IP
[1051] IP:192.168.1.27
[5001] Connecting to blynk-cloud.com:8442
[20058] Connecting to blynk-cloud.com:8442
[35116] Connecting to blynk-cloud.com:8442

Google DNS 8.8.8.8 right?
For me it also looks like possibly a DNS problem - I rechecked everything… no luck

like this?
IPAddress dns_ip ( 8, 8, 8, 8);

Please be more spicific:

do you mean WAN DNS or my local DNS?
I’m not that advanced in networks so please correct me if I’m wrong…
I have now:

BlynkCloud <—> Internet <—> |DNS server 185.17.155.150| <—> WAN-router 192.168.1.1-LAN(DHCP 192.168.1.2-25) <—> Arduino (local static ip 192.168.1.27)

So I was testing:
dns_ip 192.168.1.1; 185.17.155.150; 8.8.8.8
external DNS IP 185.17.155.150 (defoult), 8.8.8.8 - all of those with dns_ip 192.168.1.1, assuming arduino talks to local DNS ip = router

My local network do fine with both: my provider DNS or Google DNS. Now I’m writing over Google DNS, prevoiuslyover my ISP DNS.

Changing adapter to w5500 solved the problem - work like a charm!
Seems like a faulty unit or some other problem in hardware.

1 Like

A post was split to a new topic: Problem in getting online through ENC28J60 via UNO