Hello,
I’m fairly new to Arduinos and Blynk and still learning.
I have three Arduinos UNOs. One clone I ordered from Amazon and two identical clones from Aliexpress. I set up the Amazon clone with Blynk and an ENC28J60 Ethernet adapter. This combo has been working really reliably. To run some experiments, I flashed a slightly different code on one of the Aliexpress clones and connected it with the ENC28J60 adapter from the Amazon clone.
When I noticed that I couldn’t get a working connection with the Aliexpress clone, I decided to flash the exact same code on both boards. The result is that the Amazon Arduino works like a charm and DHCP always fails on the Aliexpress board, so I can’t establish a connection with it.
My first idea was that both Arduinos could use the same MAC adress, so I tried to set it manually on the Aliexpress clone with:
byte arduino_mac [] = {0xDE, 0xED, 0xFE, 0xBA, 0xAE, 0xEF};
Blynk.begin (auth, "blynk-cloud.com ", 8442, arduino_mac);
This didn’t change anything, unfortunately.
I also tried different auth keys for both boards, which didn’t make a difference, either. The Amazon clone works fine with both keys, while the Aliexpress clone doesn’t work with either keys.
I always used the same wiring (SI to 11, CS to 10, SCK to 13, SO to 12, GND to GND, VCC to 3.3V) and the same ENC28J60 adapter (the only ethernet adapter I own). Both Aliexpress boards behave identically. My library version is 0.5.3 and I have the Android app.
I would really appreciate your help!
I would normally suspect that there is something wrong with the Aliexpress boards, but the fact that both Aliexpress boards behave the same way makes it unlikely (the offer has 4100 orders and 4.9 stars).
Here is the code I flashed on both boards:
#define BLYNK_PRINT Serial
#include <UIPEthernet.h>
#include <BlynkSimpleUIPEthernet.h>
unsigned long blink_timer = millis();
unsigned long lcd_timer = millis(); // refresh rate for virtual lcd screen
int status_led = A2;
int analogValue = 0; // light sensor value
int lightsensor = A5; // light sensor pin
boolean led_on = false; // led status
char auth[] = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; // same auth key on both boards
WidgetLCD lcd(V7);
void setup()
{
Serial.begin(9600);
Blynk.begin(auth);
pinMode(status_led, OUTPUT);
WidgetLED led1(V1);
digitalWrite(0, HIGH); // relay 1
digitalWrite(2, HIGH); // relay 2
digitalWrite(3, HIGH); // relay 3
digitalWrite(4, HIGH); // relay 4
}
void loop()
{
Blynk.run();
if (((millis() - blink_timer) >= 500) && led_on == false){
digitalWrite(status_led, HIGH);
Blynk.virtualWrite(V1, 1023);
blink_timer = millis();
led_on = true;
}
if (((millis() - blink_timer) >= 500) && led_on == true) {
digitalWrite(status_led, LOW);
Blynk.virtualWrite(V1, 0);
blink_timer = millis();
led_on = false;
}
if ((millis() - lcd_timer) >= 250){
lcd.clear();
lcd.print(0, 0, analogRead(A5));
lcd_timer = millis();
}
}
Serial Monitor Amazon Arduino:
[0] Getting IP...
[5334] IP:192.168.178.21
[5335]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.3 on Arduino Uno
Give Blynk a Github star! => https://github.com/blynkkk/blynk-library
[5531] Connecting to blynk-cloud.com:80
[6107] Ready (ping: 44ms).
Serial Monitor Aliexpress clone:
[0] Getting IP...
[60336] DHCP Failed!
[1] Getting IP...
[60270] DHCP Failed!
[0] Getting IP...
[60334] DHCP Failed!
[1] Getting IP...
[60338] DHCP Failed!