concerns an Arduino Uno /w 5100 ethernet shield. Running following code:
void setup(){
Serial.begin(9600);
Serial.println("Deselect SD card...");
pinMode(SDCARD_CS, OUTPUT);
digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card
Serial.println("Blynk Begin");
Blynk.begin(auth, ssid, pass, server, port);
Serial.println("Starting Blynk connection");
Serial.println("Blynk connect");
while (Blynk.connect() == false) { } // Wait until connected
toTerminal("-------------");
toTerminal(String("Blynk v") + BLYNK_VERSION + " started");
toTerminal("-------------");
initVPins(); //INIT VIRTUAL PINS
timer.setInterval(TIME_RUN_FUNCTIONS, runFunctions); // every 1 minute: run time functions.
runFunctions(); // make sure they also run on startup
}
void runFunctions(){
Serial.println("run one minute functions");
updateTerminalLAbel(); // every 1 minute: update the label on the terminal (time/version)
reconnectBlynk(); // check every minute if still connected to server
//checkDevices(); // do this also immediately on startup.
//checkCentral();
}
void loop(){
Blynk.run();
timer.run();
}
gives me:
Deselect SD card...
Blynk Begin
[0] Using static IP
[1560] IP:192.168.1.93
[1561]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.3 on Arduino Uno
Give Blynk a Github star! => https://github.com/blynkkk/blynk-library
[1756] Connecting to wolph42:670
[16819] Connecting to wolph42:670
etc. for every 10s or so.
any clue what Im doing wrong?
Note that I have a bunch (12) or ESP’s connected to the server all working dandy, somehow this arduino doesnt want to play ball…
[202] Connecting to 192.168.1.93
[5202] Connecting to 192.168.1.93
Starting Blynk connection
Blynk connect
[10203] Connecting to 192.168.1.93
[15204] Connecting to 192.168.1.93
[20205] Connecting to 192.168.1.93
etc. etc. etc;
I’d start with trying some of the basic code examples from the Sketch Builder to make sure it’s not a hardware issue.
These Ethernet shields are notoriously flaky and some don’t work with certain Ethernet switches.
@wolph42, are you trying to use Blynk.begin() along with Blynk.config() and Blynk.connect() ?? If so, it is not a correct approach. I think you just forgot, that Blynk.begin() is a “combo” command and those latter are not necessary. You were active on this (below) topic too, so just a reminder:
@PeteKnight I did test the shield earlier on to see if I can ‘get connected’ this worked, I didn’t do this through blynk though, just created a simple webserver and checked that locally from another pc.
@marvin7, indeed I was, but not (yet) in the ethernet area. Thnx for the reminder.
are you trying to use Blynk.begin() along with Blynk.config() and Blynk.connect()
No im not. .config() and .connect() in setup .run() in the loop. I was using .begin() in my very first attempt, to which @vshymanskyy replied. I changed it in my second attempt. Nonetheless, are you suggesting that I should try this:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //you can edit it to your needs
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
}
else
Blynk.config(auth, server, port);
Blynk.connect();
}