Cytron ESPWiFi Shield with Blynk

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

Cytron ESPWiFi Shield with Blynk

Postby azizi.afiq » Fri Sep 09, 2016 5:38 pm

I'm currently doing Blynk IoT project which we can control from Smartphone to the SHIELD-ESP-WIFI ESP8266 with CYTRON UNO. My ESP WIFI already connected to the Wifi, which I check through the AT+CIFSR command in Serial Monitor. It just a simple Blynk project, to turn ON and OFF the LED. However the problem I face is DHCP failed. Really appreciate if you can give me the solution, already look in other forum, but still not solved. Thanks.
azizi.afiq
Freshie
 
Posts: 4
Joined: Fri Sep 09, 2016 5:30 pm

Re: Cytron ESPWiFi Shield with Blynk

Postby bengchet » Sun Sep 11, 2016 7:33 pm

Hi,

A few photos or printscreens regarding results of serial monitor, hardware setup will be helpful. You can also attach here with the Arduino program so we can troubleshoot more easily.
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: ESP8266 with Cytron UNO DHCP failed

Postby azizi.afiq » Thu Sep 29, 2016 11:35 am

Sorry for late reply bengchet. Still new to forum, and didn't know you already replied coz don't get notification.

Here's the screenshot and some pictures of the problem I faced:
https://www.dropbox.com/s/3z2cas4gdxw5z ... 8.png?dl=0

https://drive.google.com/a/brainbytes.o ... sp=sharing

https://drive.google.com/a/brainbytes.o ... sp=sharing

Hope you can help. Thanks a lot!
azizi.afiq
Freshie
 
Posts: 4
Joined: Fri Sep 09, 2016 5:30 pm

Re: Cytron ESPWiFi Shield with Blynk

Postby bengchet » Fri Sep 30, 2016 9:53 am

Hi,

For your case, you have to use this sketch.

CODE: SELECT_ALL_CODE
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

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

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

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

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

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
  // Set console baud rate
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
}

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


You also need to install the attached library to Arduino Library folder. Extract to My Documents -> Arduino -> libraries.

After you have uploaded the program, you can open serial monitor to monitor the progress. If it shows "Ready (ping: XXms)", the blynk application is ready.

You can also find some reference here.

Hope this helps!
Attachments
BlynkESP8266_Lib.zip
(11.91 KiB) Downloaded 342 times
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Cytron ESPWiFi Shield with Blynk

Postby azizi.afiq » Fri Sep 30, 2016 3:41 pm

Hi bengchet,

Thanks a lot it really working!

Here's the link video if you wanna take a look:
https://youtu.be/2_R3TFYaoAw

Again to be clear on the problem. What I understand is the previous code for my .ino is not complete and it don't have the library for ESP8266, is it correct? Hope you can make a clear statement on what cause the problem for a learning process.

Again thanks a lot, you really helping me :)
azizi.afiq
Freshie
 
Posts: 4
Joined: Fri Sep 09, 2016 5:30 pm

Re: Cytron ESPWiFi Shield with Blynk

Postby bengchet » Fri Sep 30, 2016 3:59 pm

Hi,

You previous code actually includes wrong header file, which is meant for Ethernet shield. So if you want to use ESP8266 shield instead for your application, you have to include correct header file BlynkSimpleShieldEsp8266.h to let Arduino know actually you are launching Blynk application with ESP8266 shield.

Of course to allow ESP8266 to perform functions properly, ESP8266_Lib.h is the file you need to include in your sketch. It handles how ESP8266 connect to your WiFi network,send http request, fetch data from Blynk server, etc.

I have to admit Blynk community has done a good job for creating such powerful library which can support so many platforms, including ESP8266 shield.

Thanks for sharing video and have fun learning! :D
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Cytron ESPWiFi Shield with Blynk

Postby azizi.afiq » Tue Oct 04, 2016 9:23 am

Hi bengchet,

Thanks again for your explanation. I now understood and really thanks for your help and kind :D
azizi.afiq
Freshie
 
Posts: 4
Joined: Fri Sep 09, 2016 5:30 pm

Re: ESP8266 with Cytron UNO DHCP failed

Postby jim0 » Thu Oct 06, 2016 4:47 pm

Hi, faced this error even though have included all the mentioned files in libraries. Kindly advise tq!

Error:

Arduino: 1.6.10 (Mac OS X), Board: "Arduino/Genuino Uno"

In file included from /Users/Mac/Documents/Arduino/libraries/BlynkESP8266_Lib/BlynkSimpleShieldEsp8266.h:25:0,
from /Users/Mac/Documents/Arduino/Projects/Blynk/latestblynk2/latestblynk2.ino:3:
/Users/Mac/Documents/Arduino/libraries/BlynkESP8266_Lib/BlynkApiArduino.h:14:28: fatal error: Blynk/BlynkApi.h: No such file or directory
#include <Blynk/BlynkApi.h>
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
jim0
Freshie
 
Posts: 4
Joined: Sun Mar 06, 2016 10:26 pm

Re: ESP8266 with Cytron UNO DHCP failed

Postby bengchet » Fri Oct 07, 2016 7:43 pm

Hi,

Your Arduino seems can't find your Blynk main library. You might need to install Blynk library first. Go to Sketch -> Include library -> Manage libraries. Type 'Blynk' in textbox and there you go.
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: ESP8266 with Cytron UNO DHCP failed

Postby jim0 » Fri Oct 07, 2016 9:47 pm

Hi Bengchet,

Thanks for kind reply.

Still same error message:

Arduino: 1.6.12 (Mac OS X), Board: "Arduino/Genuino Uno"

In file included from /Users/Mac/Documents/Arduino/libraries/BlynkESP8266_Lib/BlynkSimpleShieldEsp8266.h:25:0,
from /Users/Mac/Documents/Arduino/Projects/Blynk/latestblynk2/latestblynk2.ino:3:
/Users/Mac/Documents/Arduino/libraries/BlynkESP8266_Lib/BlynkApiArduino.h:14:28: fatal error: Blynk/BlynkApi.h: No such file or directory
#include <Blynk/BlynkApi.h>
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.

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

Including screen shot of your advised steps too.
ArduinoBlynkError.jpg
jim0
Freshie
 
Posts: 4
Joined: Sun Mar 06, 2016 10:26 pm

Next

Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 15 guests

cron