I want to use ESP8266 to connect to my Wifi (dont want to use as standalone), is there any way i can use it without updating ESP firmware.
I have searched for the topic where it suggested to use ESP8266_Shield_SoftSer example, but it is not available in the current library of Blynk from git hub.
I am just using ESP8266 module not the shield.
`
> #include <ESP8266_HardSer.h>
> #include <BlynkSimpleShieldEsp8266_HardSer.h>
> #define BLYNK_PRINT Serial // Comment this out to disable prints and save space
> #define EspSerial Serial
> #define SSID "\"test\""
> #define PASSWORD "\"wifi\""
> ESP8266 wifi(EspSerial);
> char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
> const int analogInPin = A0; // Analog input pin
> const int analogInPin1 = A3;
> const int analogInPin2 = A2;
> // digital pin 2 has a pushbutton attached to it. Give it a name:
> int gassensor = 2;
> int ldr =3;
> int sensorValue = 0; // value read from the temp
> int sensorValue1 = 0; // value read from the Hum
> const int RPin1 = 13;
> const int RPin2 = 12;
> const int RPin3 = 11;
> const int RPin4 = 10;
> char inByte;
> void setup() {
> // initialize serial communications and wait for port to open:
> Serial.begin(115200);
> delay(1000);
> EspSerial.begin(115200);
> Serial.println("AT");
> delay(500);
> Serial.println("AT+RST");
> delay(2000);
> Serial.println("AT+CWJAP?");
> delay(1000);
> //Serial.println("AT+CWSAP="SSID","PASSWORD",3,0");
> Serial.println("AT+CWJAP="SSID","PASSWORD"");
>
> delay(15000);
> Serial.println("AT+CIFSR");
> delay(500);
> Serial.println("AT+CIPMUX=1");
> delay(500);
> Blynk.begin(auth, wifi, "test", "wifi");
> //delay(500);
>
> ; // wait for serial port to connect. Needed for native USB port only
> pinMode(gassensor, INPUT);
> pinMode(ldr, INPUT);
> pinMode(RPin1, OUTPUT);
> pinMode(RPin2, OUTPUT);
> pinMode(RPin3, OUTPUT);
> pinMode(RPin4, OUTPUT);
> }
> void loop() {
> unsigned char value;
> unsigned int v;
> float val,hum;
> sensorValue = analogRead(analogInPin);
> Blynk.run();
> }
It’s working for hardware serial connetion.
I strongly recommend to use the hardware serial
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; //walid auth
char ssid[] = "aaa";
char pass[] = "bbbbbb";
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#define EspSerial Serial // Set ESP8266 Serial object
ESP8266 wifi(&EspSerial);
void setup() {
Serial.begin(115200); // Set console baud rate
EspSerial.begin(115200); // Set ESP8266 baud rate
}
void loop() {
Blynk.run();
}