I need help with blynk 2.0 on Mega + W5100

i have old version using Mega + W5100. I found blynk 2.0 has a web interface, it’s very practical when I use the computer. i want to generate new code to use blynk 2.0 but the example part shows me esp32 and esp8266 hardware. I’m a learner and really need your help. thank you!

Hey there.
You can use blynk legacy sketch with the new blynk, all you have to do is add #define BLYNK_TEMPLATE_ID “YourTemplateID”
In the beginning of your sketch.

So your sketch should look like this:

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest
  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.
    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Social networks:            http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app
  Blynk library is licensed under MIT license
  This example code is in public domain.
 *************************************************************
  This example shows how to use Arduino Ethernet shield (W5100)
  to connect your project to Blynk.
  NOTE: Pins 10, 11, 12 and 13 are reserved for Ethernet module.
        DON'T use them in your sketch directly!
  WARNING: If you have an SD card, you may need to disable it
        by setting pin 4 to HIGH. Read more here:
        https://www.arduino.cc/en/Main/ArduinoEthernetShield
  Feel free to apply it to any other example. It's simple!
 *************************************************************/

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

/* Fill-in your Template ID (only if using Blynk.Cloud) */
#define BLYNK_TEMPLATE_ID   "YourTemplateID"


#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>

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

#define W5100_CS  10
#define SDCARD_CS 4

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

  pinMode(SDCARD_CS, OUTPUT);
  digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card

  Blynk.begin(auth);
  // You can also specify server:
  //Blynk.begin(auth, "blynk-cloud.com", 80);
  //Blynk.begin(auth, IPAddress(192,168,1,100), 8080);
  // For more options, see Boards_Ethernet/Arduino_Ethernet_Manual example
}

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

I’m having a timer problem. it’s not in blynk 2.0 can you help me

Yes sure, what’s the problem ?

I assume you mean the timer widget is missing from Blynk IoT?
If so then you should use automations instead,

Pete.

I tried your example. but there is a problem that it can’t find the token. I tried to get the token in blynk 2.0 but it didn’t work

I am a learner. I really need an example, a tutorial. I don’t really understand it at all. it’s not as simple as version 1.0

thank you. I did it. RTC still works without widget

i am testing on esp32 it works fine. but I can’t connect to the server using Mega + W5100. Can you help me

Your screenshot shows that you are using library version 0.6.1
This is fine if you are using Blynk Legacy, but you need to be using the latest library (currently 1.0.1) if you want to use Blynk IoT.

Nobody will be able to help you unless you provide detailed information about exactly what issues you are facing and the code you are using - along with information about library versions, serial output template and datastream setup etc.

Pete.

Uploading: 5b155376d7021e5c4713.jpg…
this is my library

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Social networks:            http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  This example shows how to use Arduino Ethernet shield (W5100)
  to connect your project to Blynk.

  NOTE: Pins 10, 11, 12 and 13 are reserved for Ethernet module.
        DON'T use them in your sketch directly!

  WARNING: If you have an SD card, you may need to disable it
        by setting pin 4 to HIGH. Read more here:
        https://www.arduino.cc/en/Main/ArduinoEthernetShield

  Feel free to apply it to any other example. It's simple!
 *************************************************************/

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

/* Fill-in your Template ID (only if using Blynk.Cloud) */
#define BLYNK_TEMPLATE_ID   "TMPLDrmQkqAu"


#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>

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

#define W5100_CS  10
#define SDCARD_CS 4

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

  pinMode(SDCARD_CS, OUTPUT);
  digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card

  Blynk.begin(auth);
  // You can also specify server:
  //Blynk.begin(auth, "blynk-cloud.com", 80);
  //Blynk.begin(auth, IPAddress(192,168,1,100), 8080);
  // For more options, see Boards_Ethernet/Arduino_Ethernet_Manual example
}

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

i uploaded my code

@nguyenhutoan please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

I’ve edited

I tried on esp32 it works fine, but on Mega2560 it reverts to version 0.6.1

That’s not possible if your Blynk library is correctly installed. I guess you have an old copy somewhere that needs to be deleted. Your compiler messages should tell you where that is located.

Pete.

I have tried uninstalling and reinstalling the latest version but the result is the same

Thanks, I connected successfully. My library is duplicated