BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Need help device is always offline


#3

Do you think a failed DHCP lease is due to

  1. A misconfiguration on your local network, e.g. in your router.
    or
  2. Blynk is crap!

(Hint: it’s no.1 :stuck_out_tongue_closed_eyes:)


#4

Or option 3 - the w5100 Ethernet shield is crap!

The shield won’t connect to some routers and switches anyway. They work with Layer 3 switches and routers, but not Layer 2 devices.

If you’re connecting to a Layer 3 device and the LEDs on your shield are flashing rapidly then try resetting your Arduino to See if you can get it connecting correctly.
I’ve found that many of the shields ship with solder bridges across the pins on the main chip. In some cases 5his doesn’t affect the performance, but in others the shield just doesn’t work properly.

I eventually swapped to a NodeMCU device with built-in Wi-Fi instead of the Arduino and Ethernet shield and I’ve never looked back.

Pete.


#5

I might be of a different opinion! :stuck_out_tongue: Compared to the ENC28J60 it’s golden! :smile:

That’s a strange statement :thinking: You kinda need Layer 2 to get to Layer 3… and you need Layer 3 to get to the Internet! The problem with switching might be duplicate MAC-addresses on the network. A stupid and careless person once made the mistake of copying one setup to another without changing the MAC. I afraid can’t tell you who it was without implying myself :rofl:

@Kurt_Tiempo Try using (suitable) static settings for your W5100. Mine look like this:

byte arduino_mac[] = { 0xDE, 0xEA, 0xBA, 0xFE, 0xFE, 0xCC };
IPAddress arduino_ip (192, 168,   0,  20);
IPAddress dns_ip     (192, 168,   0,   1);
IPAddress gateway_ip (192, 168,   0,   1);
IPAddress subnet_mask(255, 255, 255,   0);

#6

i can ping all devices the phone, arduino and the server but still device is offline in the app :cry::cry::cry::cry::cry::cry::cry::cry::cry::cry::cry::cry::sob::sob::sob::sob::sob::sob::sob::sob::sob::sob::sob:


#7
#define BLYNK_PRINT Serial
#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[] = "42f90c53c83c4*************ef8c97";

IPAddress server_ip (192, 168, 1, 46);

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

#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, server_ip, 8443, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);

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

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!
}

#8

Please format your code:


#9

i already formatted it :blush:


#10

Try port 8442 so your hardware can connect :slight_smile:


#11

Proper way is as shown in the Welcome Topic… NOT using </> as that doesn’t always work

And stop with the emoticon overkill and duplicate posts… just makes us want to ignore your issue even more :wink:


#12

still device is offline in the app @distans


#13

Then I don’t know… Could be ports closed on your local server, wrong token or a million other things :frowning_face:

Try a simple sketch without Blynk so you’ll know the ethernet is working. In the Ethernet library there are some examples, like WebClient.ino


#14

Aside from the incorrect port…

It has been a long time since I used an Ethernet adapter… but aren’t you supposed to use something like this to setup the adapter…

Ethernet.begin(arduino_mac, arduino_ip, gateway_ip, subnet_mask);

before attempting the Blynk.begin() or perhaps Blynk.config() at this point, and using only the Blynk required parameters… Not try to cram it all into one line?


#15

what should be the right port @Gunner


#17

I dunno… what do you think? :stuck_out_tongue_winking_eye:


#18

<BlynkSimpleEthernet.h> takes care of that :slight_smile:


#19

OK… as stated… looong time since wasting my time on a crappy adapter :stuck_out_tongue: All my past scripts using said adapter with preset config are long gone.


#20

still not working :sob:


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


#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[] = "42f90c53c83c4816b1483b8c18ef8c97";

IPAddress server_ip (192, 168, 1, 46);

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

#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
  Ethernet.begin( server_ip, 8442,arduino_mac, arduino_ip, gateway_ip, subnet_mask);
   //Blynk.begin(auth, server_ip, 8443, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);

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

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!
}

#22

Disregard my guess at using Ethernet.begin() and try again as you had it, but with proper port 8442 this time…

Blynk.begin(auth, server_ip, 8442, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);

#23
#define BLYNK_PRINT Serial


#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[] = "42f90c53c83c4816b1483b8c18ef8c97";

IPAddress server_ip (192, 168, 1, 46);

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

#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
  //Ethernet.begin( server_ip, 8442,arduino_mac, arduino_ip, gateway_ip, subnet_mask);
  Blynk.begin(auth, server_ip, 8442, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);

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

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!
}