Hi, I would transmit ESP8266-01 serial.println messages to Arduino in order to output them on serial monitor and/or execute code depending on the message arrivated to Arduino. I tried with
#include <SoftwareSerial.h> //Including the AltSoftSerial library
SoftwareSerial esp (8,9);
The first thing I would do is verify that the pin and voltage levels were correct by having a program on the esp that raised whatever pin you are using for signalling up and down at a low frequency like 5 hertz, and verify that the arduino sees that pin going up and down, perhaps by lighting up an led on another pin.
#1: ESP runs at 3.3Volt. Most Arduinos are 5V. You might be forced to put a Level Shifter in between.
(and otherwise you could risk burning your ESP’ Rx - if you use it)
#2: Verify that your Rx and TX are connected correctly (Arduino_Rx to ESP_Tx - and vice versa in case you want bidirectional communication).
#3: If you have tested your pins (8 and 9) successfully (by lighting an LED) you could let the Arduino’s SoftwareSerial communicate with it’s own HW-serial, and write a simple sketch that let’s an LED blink (on another pin of course) if the serial communication is successful.
That way you can test initialization of the SWserial.
Try connecting your USB programming cable to those pins first, and see if you see any output, that will confirm your ESP is programmed and working as expected. Arduino at 5v should recognize 3.3v as a logic high, if you want 2 way coms, definitely put a shifter on the arduino output.
some strange code, both devices listen soft.serial ports. and what serial pins do you use on Esp01? there are only two freepins, 0 and 2, they must be connected to+3.3v via resistors. May be better use hard.serial?