Esp8266_sheild example fatal error

Hello guys,I am complete rookie on this.I have been using esp8266 esp-01 with arduino UNO for my project.It works fine when I upload standalone example.But whenever I want to compile Esp8266_shield example it gives an error as below:

fatal error: avr/pgmspace.h: No such file or directory
#include avr/pgmspace.h

I am using Arduino 1.6.12 and 0.4.1 Blynk library

@Kamrul_Haasan I think the problem will relate to the board you are selecting in the Arduino IDE.

You say standalone sketch for ESP01 and Uno is working but the standalone sketch is actually just for an ESP and without an Arduino. Presumably when you compile this sketch you are selecting Generic ESP8266 Module form the board selector. When you do this you have no control of the Arduino unless you add your own code to the sketch.

For the “Shield” sketch you need to change the board to an Uno as Arduino’s use the avr library whereas ESP’s don’t.

You are likely to have more problems along the way if you haven’t been very careful with how you wired up the ESP to the Uno.

Thank you for clarifying about board selection.I had selected esp generic for the sketch.Now that I am using Arduino uno board but still get an error says " ‘Serial1’ was not declared in this scope "
And I am following this diagram for wiring.
One more thing,after flashing standalone sketch AT firmware of esp8266 had gone.Do I nedd to re flash AT firmware?


If you read the comments at line 45 and elsewhere in the sketch you will see that Serial1 only applies to Arduino’s that have more than one serial interface. Mega and Leonardo have more than one but your Uno doesn’t.

So you are expected to add a USB 2 TTL adapter to the Uno (cost $1).

I believe it is possible to switch the serial interfaces around and do without the adapter but then you don’t have Serial Monitor available for debugging purposes. Once you get up and running with Blynk you can use the Terminal widget to debug your sketch.

Yes you need to flash the AT f/w back to the ESP now you have erased it with the Standalone sketch.
Much easier to use a decent ESP like the WeMos that has builtin USB port and far more powerful than the Arduino’s. Shield mode is not as stable as Standalone mode.