Arduino Mega with ENC28J60 LAN Module keeps disconnecting

Hi Guys, I was just working on the Software for the Solar Panel Tracker I am building, and I want to use Blynk as a way to see some Data, like brightness and Voltage.
I was planning to use an Arduino Mega 2560 as the “computer” and for a Network connection I bought the ENC28J60 LAN Shield, because there is no Wi-Fi in my basement.
So right now I was trying to test it because the LAN Shield just Arrived and I wired it up, like some guides I found on the web suggested.

When I tried, it always repeated the same thing:

    [2127] Getting IP...
    [3467] IP:192.168.178.145
    [3468] 
        ___  __          __
       / _ )/ /_ _____  / /__
      / _  / / // / _ \/  '_/
     /____/_/\_, /_//_/_/\_\
            /___/ v1.1.0 on Arduino Mega

     #StandWithUkraine    https://bit.ly/swua


    [3482] Connecting to blynk.cloud:80
    [4324] <[1D|00|01|00] 
    [4325] <*my auth token*
    [10327] Login timeout

I looked at all previous questions from others regarding this same issue, but none of them seemed to make it work.
But the weird thing is, when I look in my Blynk.cloud the device keeps changing to online for a half second right before the Login timeout comes, so this cant be some connection problem I suppose. And I also tried it with my ESP8266, and it can connect normally to Blynk over Wi-Fi.

I first tried with my main code, and when that didn’t work, I tried it with the Blank example, that you can find in Blynk examples to eliminate any interference with the rest of my code. But also same issue

So if anyone can help me, it would be greatly appreciated.

PS. I also tried the different server, like suggested in some other question about this topic, but sadly to no avail

The code I was running:


#define BLYNK_TEMPLATE_ID "*redacted*"
#define BLYNK_DEVICE_NAME "*redacted*"
#define BLYNK_AUTH_TOKEN "*redacted*"


// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial
#define Blynk_DEBUG

#include <UIPEthernet.h>
#include <BlynkSimpleUIPEthernet.h>

char auth[] = BLYNK_AUTH_TOKEN;


void setup()
{
  // Debug console
  Serial.begin(115200);

  
  // You can also specify server:
  Blynk.begin(auth, "blynk-cloud.com", 8080);
  //Blynk.begin(auth, IPAddress(192,168,1,100), 8080);
}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

This is the Legacy server and this will never work if you are using Blynk IoT.

Which version of the UIPEthernet library are you using?

Pete.

Yes, I tried both servers, but the weird thing is I reinstalled UIPEthernet in my troubleshooting efforts, so I had to have the newest version. But when I just came back to my pc from a little nap, I reopened the Arduino IDE, and it said “Updates available for some of your libraries” and I did the update, and it was UPIEthernet. Now Blynk works and connects to the server normally.

What a coincidence :joy:

Anyways, thanks for your help, Pete!

1 Like