Hello,
First of all, I searched the forum and tried the example sketches but it didn’t work…
I’m using a DFRduino R3 + Expansion Shield v7.1 + Wifi Bee ESP8266 module
I successfully managed to connect to my AP with this sketch, so I know the hardware is working:
`
#include "esp8266.h"
#include "SoftwareSerial.h"
#define ssid "XXXXXX" // you need to change the ssid and password to your wifi's name and password
#define password "XXXXXXX"
Esp8266 wifi;
bool flag=false;
SoftwareSerial mySerial(10, 11); // RX, TX
void setup() {
delay(2000); // it will be better to delay 2s to wait esp8266 module OK
pinMode(13, OUTPUT);
mySerial.begin(115200); // Serial is used to print debug information if you need
// if you used a serial to debug, then you can use wifi.debugPrintln() to print your debug info
Serial.begin(115200);
wifi.begin(&Serial, &mySerial); //Serial is used to communicate with esp8266 module, mySerial is used to print debug message
if (wifi.connectAP(ssid, password)) { // it will return TRUE if it connect successfully
flag = true;
wifi.debugPrintln("connected to AP"); // if you don't use a serial to debug, DON NOT use this function
} else {
wifi.debugPrintln("connect Fail");
}
}
void loop() {
if (flag) {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for 500ms
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for 500ms
}
}
`
But when I try the Shield example (with soft serial) sketch from Blynk librairies v0.3.7, my app says “Arduino not in network” :
`
#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[] = "XXXXXXX";
// 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 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, "XXXXX", "XXXXX");
}
void loop()
{
Blynk.run();
}
`
Both the expansion shield and the wifi module are in “boot” mode after code upload.
Any ideas why it doesn’t work?
Thanks for your help.