Can't Connect To Deivce

Hi all!

I’m trying to start my project with arduino uno + wifly shield but I can’t get passed connecting to a device.

Blynk wants to open a wifi network (I have my wifi on and hotspot off) but I get not option but cancel?

Thank you!

Hey there,
I guess you should watch this tutorial first

You are trying to do Edgent dynamic provisioning with a device that doesn’t support Edgent.

You need to follow the Static Provisioning instructions.

Pete.

Hey!

I followed all the step, choosing arduino as my board and wifi as communication and I get stuck getting the device online. I’ve checked using the WiFly library that the arduino is connected to the home wifi network:

In the serial monitor it is showing:
[405] WiFi module not found

Would appreciate any help :slight_smile:
Should I choose something else in the hardware section?

I recommend you to use esp32 or nodemcu instead.

But your device isn’t an Arduino that uses WiFi as its connection type, because your Arduino board has no WiFi connectivity. Your device is an Arduino + ESP-01, which isn’t covered by the wizard you are using.

It is however covered by the Sketch Builder example…

You’ll need to comment-out the Mega related code and un-comment the Uno related code.

Pete.

Hi Pete, Thank you for the reply!
I downloaded and uploaded the sketch and get the following on the serial monitor:

[9] 
[9] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.1 on Arduino Uno

[517] Connecting to Talia
[1528] ESP is not responding

Wiring schematic?

Pete.

As shown in the WiFly Hokkup Guide:
https://learn.sparkfun.com/tutorials/wifly-shield-hookup-guide/all

I manage to follow the guide and connect to my home wifi network:

image

Also connected is a Qwiic shield with an IMU that is working fine:

post your whole sketch please.

 // Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID           "TMPxxxxxxxxx"
#define BLYNK_DEVICE_NAME           "Quickstart Device"
#define BLYNK_AUTH_TOKEN            "wxxxxxxxxxxxxxx"


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


#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Talia";
char pass[] = "xxxxx";

// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1

// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 38400

ESP8266 wifi(&EspSerial);

BlynkTimer timer;

// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0)
{
  // Set incoming value from pin V0 to a variable
  int value = param.asInt();

  // Update state
  Blynk.virtualWrite(V1, value);
}

// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
  // Change Web Link Button message to "Congratulations!"
  Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
  Blynk.setProperty(V3, "onImageUrl",  "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
  Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}

// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, millis() / 1000);
}

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

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);
}

void loop()
{
  Blynk.run();
  timer.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!
}

Try this one

Hi! Thanks for the reply
I get an error msg for line:
#define WiFlySerial Serial1

That Serial1 wasnt decalred in this scope. Am I missing something?

I uncommeneted the part where:
// This can be a SoftwareSerial object:
#include <SoftwareSerial.h>
SoftwareSerial WiFlySerial(2, 3); // RX, TX

And get the error msg:
[6540] Failed to start wifly

With the Uno you need to un-comment the SoftwareSerial lines of code, as it doesn’t have a hardware Serial1 port.

Pete.

1 Like

Thanks Pete, I just edited that i get an error msg:
[6540] Failed to start wifly
After uncommenting.

Looking at the WiFly documentation it appear to be an extremely complex shield that doesn’t work in the same way as any other Uno/Mega hardware that I’ve ever come across.
You seem to need to find some way to tell the shield to expect the data from Blynk on pins 2&3, and need to ensure the baud rate used by the sketch and the shield are the same.
Other than that, you’re on your own unless you can find someone who is familiar with this niche hardware setup.

TBH, you’d be far better-off buying a $5 ESP32 for use with Blynk rather than a 10+ year old Uno with no built-in IoT connectivity, very limited memory and an extremely slow processor - coupled to a niche shield that aims to add IoT capability.

Pete.

1 Like

Hi Pete, Thank you for the comment.
I’ve order the following shield to be used with my uno/mega SparkFun WiFi Shield - ESP8266 - WRL-13287 - SparkFun Electronics.
Unfortunately I need to work with one of them for my project. Do you think this shield would do the job?

Thanks again!
Sharon

I’ve no idea. Have you checked if it’s compatible with Blynk, and whether any other forum users have reported success with that hardware?

Pete.

Hi, I tried my luck with Arduino Uno WiFi Rev 2 but get error compiling for Uno WiFi Rev 2 using the blynk example from the wizard, choosing arduino uno and wifi connection.

/*************************************************************

  This is a simple demo of sending and receiving some data.
  Be sure to check out other examples!
 *************************************************************/

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID           "xxxxxxxGj"
#define BLYNK_DEVICE_NAME           "Quickstart Device"
#define BLYNK_AUTH_TOKEN            "xxxxxxxxxxxxxxxxxV"


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


#include <SPI.h>
#include <WiFi101.h>
#include <BlynkSimpleWiFiShield101.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Talia";
char pass[] = "xxxx";

BlynkTimer timer;

// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0)
{
  // Set incoming value from pin V0 to a variable
  int value = param.asInt();

  // Update state
  Blynk.virtualWrite(V1, value);
}

// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
  // Change Web Link Button message to "Congratulations!"
  Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
  Blynk.setProperty(V3, "onImageUrl",  "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
  Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}

// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, millis() / 1000);
}

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

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);
}

void loop()
{
  Blynk.run();
  timer.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!
}

Error:

Compiling sketch...

“C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO_WIFI_REV2 -DARDUINO_ARCH_MEGAAVR -DUNO_WIFI_REV2_328MODE -DMILLIS_USE_TIMERB3 “-IC:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/deprecated” “-IC:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\megaavr\1.8.7\cores\arduino” “-IC:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\megaavr\1.8.7\variants\uno2018” “-IC:\Users\Chupil\Documents\Arduino\libraries\WiFiLink-Library-master\src” “-IC:\Users\Chupil\Documents\Arduino\libraries\Blynk\src” “C:\Users\Chupil\AppData\Local\Temp\MW_ArduinoHWSetup\MW_ArduinoBuild\sketch\Arduino_org_UNO_WiFi.ino.cpp” -o “C:\Users\Chupil\AppData\Local\Temp\MW_ArduinoHWSetup\MW_ArduinoBuild\sketch\Arduino_org_UNO_WiFi.ino.cpp.o”
In file included from C:\Users\Chupil\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkApi.h:36:0,
from C:\Users\Chupil\Documents\Arduino\libraries\Blynk\src/BlynkApiArduino.h:14,
from C:\Users\Chupil\Documents\Arduino\libraries\Blynk\src/Adapters/BlynkWiFiCommon.h:24,
from C:\Users\Chupil\Documents\Arduino\libraries\Blynk\src/BlynkSimpleWiFiLink.h:21,
from C:\Users\Chupil\AppData\Local\Temp\arduino_modified_sketch_967233\Arduino_org_UNO_WiFi.ino:43:
C:\Users\Chupil\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h: In member function ‘long long int BlynkParam::iterator::asLongLong() const’:
C:\Users\Chupil\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h:48:50: error: ‘atoll’ was not declared in this scope
long long asLongLong() const { return atoll(ptr); }
^~~~~
C:\Users\Chupil\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h:48:50: note: suggested alternative: ‘atol’
long long asLongLong() const { return atoll(ptr); }
^~~~~
atol
C:\Users\Chupil\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h: In member function ‘long long int BlynkParam::asLongLong() const’:
C:\Users\Chupil\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h:89:46: error: ‘atoll’ was not declared in this scope
long long asLongLong() const { return atoll(buff); }
^~~~~
C:\Users\Chupil\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkParam.h:89:46: note: suggested alternative: ‘atol’
long long asLongLong() const { return atoll(buff); }
^~~~~
atol
Using library WiFiLink-Library-master at version 1.0.1 in folder: C:\Users\Chupil\Documents\Arduino\libraries\WiFiLink-Library-master
Using library Blynk at version 1.0.1 in folder: C:\Users\Chupil\Documents\Arduino\libraries\Blynk
exit status 1
Error compiling for board Arduino Uno WiFi Rev2.