[Arduino WiFi Shield] Arduino UNO is offline

Very exited about Blynk after reading the recent (2015-07-06) article in Make Magazine. So I started out with this very basic setup:

  1. Downloaded the Blynk App (iOS)
  2. Registered with Blynk in the app and created a simple project with one push button setting D9 high
  3. Sent auth token via email
  4. Stacked Arduino WiFi Shield on top of Arduino UNO Rev 3 (and connected via USB to my Mac)
  5. Downloaded Blynk libraries and loaded the Arduino_WiFi example
  6. Pasted the auth token from 3) into the sketch + WiFi SSID and password
  7. Uploaded sketch to Arduino

In the console I get:

[0] Blynk v0.2.4
[0] Connecting to K0...
[22462] Connected to WiFi
[22463] Connecting to cloud.blynk.cc:8442
[38469] Connecting to cloud.blynk.cc:8442
[53472] Connecting to cloud.blynk.cc:8442
...

In the Blynk App I get the message “Arduino UNO is offline”

I’ve tried using my iPhone as access point as well as my home WLAN router. Apparenty no problems with the WiFi connection itself - I can even telnet cloud.blynk.cc on port 8442 from the Mac, but the connection from the Arduino to cloud.blynk.cc doesn’t seem establish somehow. I read the troubleshooting guide at https://github.com/blynkkk/blynk-library/blob/master/docs/Troubleshooting.md. And yes, other sample WiFi sketches are working fine.

What am I missing here?

/**************************************************************
 * 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
 *   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 WiFi shield
 * to connect your project to Blynk.
 * Feel free to apply it to any other example. It's simple!
 *
 **************************************************************/

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <SPI.h>
#include <WiFi.h>
#include <BlynkSimpleWifi.h>

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

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, "K0", "yyyyyyyyyy");
}

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

Hi. thanks for the report.
I’ll re-check the WiFi shield tomorrow.

@mikkelnepper,
I think I found the problem and developed a fix for that.
I’m currently evaluating in on my setup.
As a quick fix, could you try this:

in Adaplers/BlynkArduinoClient.h, change this line:
    client.setTimeout(3000);
to
    client.setTimeout(BLYNK_TIMEOUT_MS);

in Blynk/BlynkConfig.h, change BLYNK_TIMEOUT_MS to 5000UL

hope that helps.
Anyway I see that it doesn’t even connect (I had a bit different situation).
Could you try using default example of wifi web client ant specify cloud.blynk.cc on port 8442 as a server. to see if it connects?

Thankyou for trying to solve this. I’ve performed the following to tests:

  • I tried the fix you suggest, without any immediate luck - the sketch is still looping and trying to connect
  • Started a local server, registered with it from the iPhone, copied auth token to sketch and uploaded the sketch to my arduino, still the same. WiFi starts fine, but no reply on port 8442 - the console still prints [145021] Connecting to 10.0.0.222:8442. When I telnet to either cloud.blynk.cc or my local server at 10.0.0.222:8442 from a computer on the same WLAN (“K0” in this case), I get a server response right away, so still, connectivity or firewall stuff doesn’t seem to be the issue.
  • Then I tried cloning your latest libraries (got “Blynk v0.2.5-beta”) and making the samme experiment again based on the simple Arduino_WiFi example - unfortunately still no luck
  • I changed BLYNK_TIMEOUT_MS to 5000UL again, same problem

Am I the only person having this problem? I have the feeling that I must be overlooking something here.

Extra info:

  1. I’m using the 1.6.5 Arduino IDE
  2. I’m on a Mac with Yosemite
  3. It’s a Ardunio Uno, Rev 3
  4. The WiFi Shield has been firmware updated recently and seems to work fine with other sketches

This is so weird, doesn’t seem like a timeout problem…
Could you try using standard WiFi example (without Blynk) and try connecting to actually blynk server (port 8442) and see if it connects? you don’t need to send any data - just see if connection went OK.
Thanks.

Ok, this is embarrassing. I tested again with a dead simple WiFi client example and realised it didn’t work either. For some reason, I was missing the latest Arduino WiFi libraries - I updated the IDE and the WiFI shell firmware without replacing the WiFi libraries somehow.

So, everything is fine now - I’ve tested again and it works like a charm. My Arduino UNO is now online with Blynk - it’s awesome. Thank you for helping me out.

Great you sorted this out! Enjoy :wink:

Arduino: 1.6.6 (Windows 7), Board: "Arduino/Genuino Uno"

In file included from C:\Users\tinu\AppData\Local\Temp\arduino_326fbaa072e918c1f0ba60064bc61212\ESP8266_Standalone.ino:30:0:

C:\Users\tinu\Documents\Arduino\libraries\blynkkk-blynk-library-e4e609c/BlynkSimpleEsp8266.h:15:2: error: #error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting.

 #error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting.

  ^

Multiple libraries were found for "BlynkSimpleEsp8266.h"
 Used: C:\Users\tinu\Documents\Arduino\libraries\blynkkk-blynk-library-e4e609c
 Not used: C:\Users\tinu\Documents\Arduino\libraries\blynk-library-0.3.1
 Not used: C:\Program Files (x86)\Arduino\libraries\blynkkk-blynk-library-e4e609c
 Not used: C:\Program Files (x86)\Arduino\libraries\blynk-library-0.3.1
exit status 1
Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

I HAVE problam uploading plz help me bro

It may be a bit trivial, but have you selected the right board in the Arduino IDE?

Can you provide links to these updated libs? I’m having the same problems.

/**************************************************************
 * 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
 *   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 runs directly on ESP8266 chip.
 *
 * You need to install this for ESP8266 development:
 *   https://github.com/esp8266/Arduino
 *
 * Please be sure to select hte right ESP8266 module
 * in the Tools -> Board menu!
 *
 * Change WiFi ssid, pass, and Blynk auth token to run :)
 *
 **************************************************************/

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

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

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, "KO", "1111");
}

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

With version of lib ? I have the same problem with arduino wifishield

27 months ago.

1 Like