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

Uno with Sparkfun's ESP8266 Shield


#1

Hi Everyone,

I’m trying to interface Sparkfun’s ESP8266 shield to work together with my Uno to run the Blynk app but have been majorly unsuccessful, possibly because I have zero understanding on how to get this to work. I can get the shield to connect up to the internet, but somehow cannot connect blynk. I basically modified the user defined code and came up with the code attached below. Any help or idea on how to integrate the shield into blynk will be much appreciated!


-#include (SoftwareSerial.h) // changed parenthesis so as to be able to post this on the forum
-#include (SparkFunESP8266WiFi.h) 
-#include (BlynkSimpleUserDefined.h)

const char mySSID[] = "ssid";
const char myPSK[] = "password";


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

bool connected = false;

// This function is used by Blynk to receive data
size_t BlynkStreamRead(void* buf, size_t len)
{
  return Serial.readBytes((byte*)buf, len);
}

// This function is used by Blynk to send data
size_t BlynkStreamWrite(const void* buf, size_t len)
{
  return Serial.write((byte*)buf, len);
}

void setup()
{
  // Setup your connection here.
  Serial.begin(9600);
if (esp8266.begin()) // Initialize the ESP8266 and check it's return status
    Serial.println("ESP8266 ready to go!"); // Communication and setup successful
else
    Serial.println("Unable to communicate with the ESP8266 :(");
    int retVal;
retVal = esp8266.connect("Glen X", "yourmumisgay");
if (retVal < 0)
{
    Serial.print(F("Error connecting: "));
    Serial.println(retVal);
}
IPAddress myIP = esp8266.localIP(); // Get the ESP8266's local IP
Serial.print(F("My IP is: ")); Serial.println(myIP);


  Blynk.begin(auth);

  do {
    connected = Blynk.connect();
  } while (!connected);
}

void loop()
{
  // Make sure that Blynk.run() is called
  // only when the connection is established
  if (connected) {
    // Okay, handle Blynk protocol
    bool hasIncomingData = (Serial.available() > 0);
    // Tell Blynk if it has incoming data
    // (this allows to skip unneeded BlynkStreamRead calls)
    if (!Blynk.run(hasIncomingData)) {
      // Error happened. No action for serial.
    }
  }
}

#2

I’m not seeing Blynk.run() called I think … that would explain your issue.


#3

Overall, we don’t support SparkFun hardware yet.


#4

Overall, we don’t support SparkFun hardware yet.

Any chance of getting some support soon so perhaps a little assistance? What about some generic code that I could try adapting to the shield? I tried the Blynk.run() command but it didn’t work. :frowning:


#5

We are trying to connect with SparkFun, but they never reply. If you could ping them from your side as a customer - that might shift it from dead point.


#6

SparkFun hardware is always good but , the problem here is this $ 15 shield to work with blynk.
must the ESP8266 Soc must flashed with SDK firmware 1.0 running AT command V22.

you can easier get ESP-01 or better ESP-12 for $ 2-5 and you free to flash it either with AT or any other FW.

P.S AT v22 is a must to work with Blynk , i suffered because of wrong FW version flasher on my ESP-01


#7

Hi all, Check out the latest library release, it comes bundled with some required libraries for ESP8266 Shield and improved stability: https://github.com/blynkkk/blynk-library/releases/latest


#8

I just got an email from Sparkfun’s tech support that they’ve contacted the team at Blynk to see how they can work together. Keeping my fingers and toes crossed that something’s worked out soon. For now I’m just connecting to my uno via serial/pc connection.

Hopefully in time for when my prototype is fully operational without the kinks. :sweat_smile:


#9

This worked for me from the example code, make sure you update the EspSerial Ports to (8, 9) for the SparkFun Software Serial:

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

// Set ESP8266 Serial object
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(8, 9); // RX, TX

ESP8266 wifi(EspSerial);

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

void setup()
{
  // Set console baud rate
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  // 9600 is recommended for Software Serial
  EspSerial.begin(9600);
  delay(10);

  Blynk.begin(auth, wifi, "name", "pw");
}

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

[SOLVED] Connecting to Blynk with Sparkfun ESP8266
#10

IT WORKED!!! THANK YOU!!! :grinning::grinning::grinning::grinning::grinning::grinning:


#11

It worked for me too! All I had to do to get it working was change the SoftwareSerial RX / TX pin numbers. How simple, Thank you!!!

Sparkfun ESP8266 Wifi Shield
Sparkfun RedBoard.


#12

Is this solution still valid? I am having the same issues and the proposed solution isn’t working for me. However, I could be doing it wrong…


#13

FYI, this topic is 1&1/2+ years old… much has changed in the libraries and even on this sites documentation, as shown in your own topic.


#14