Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Vindhya
#54837 I have been playing with ESP8266 module for last 6 months. the module is echoing now, strangely all 3 modules which i have. I am just running a test code, for AT commands it just echoes.

// cup_teensy_ESP8266
//
// Teensy based controller of the smartcup
// with WiFi interface ESP8266
// Interrupt driven with Tint=
// May 2016
// Authors: Vindhya & EJ
//

#define USB_Serial Serial
#define Test_Serial Serial2

int timerSamp;
int buffer[100];
int bufptr=0; /* buffer pointer */
int i;
int tempRead = 0; // serial input/output temp
int tempRead2 = 0; // serial input/output temp
// Pin Definitions
#define WIFI_CE 2
#define WIFI_RST 3
void setup(void) {

pinMode(WIFI_CE, OUTPUT);
pinMode(WIFI_RST, OUTPUT);
digitalWrite(WIFI_CE, HIGH);
digitalWrite(WIFI_RST, HIGH) ;

Serial.begin(115200); // usb serial connects to to pc
Serial1.begin(115200); // hardware serial connects to esp8266 module

delay(2000); //wait for usb serial enumeration on 'Serial' & device startup

}


//******** The main program
void loop(void) {

if(Serial1.available() > 0) {
// read the incoming byte
tempRead = Serial1.read();
Serial.write(tempRead);
Serial.println("WiFi");
} // end WiFi serial available

//**** check for new messages
if (Serial.available() > 0) {
// read the incoming byte
tempRead2 = Serial.read();
Serial1.write(tempRead2);
Serial.println("USB");
}

} // end loop