Post topics, source code that relate to the Arduino Platform

User avatar
By WalfasProject8
#34589 I have an issue loading a lua script programmed into an ESP via ESPlorer. I want to load it, first on the serial monitor, and then load it into an Arduino sketch.

Here's the code when I try to load the program on serial monitor:

Code: Select all#include <SoftwareSerial.h>

const byte rxPin = 3; // Wire this to Tx Pin of ESP8266
const byte txPin = 2; // Wire this to Rx Pin of ESP8266

// We'll use a software serial interface to connect to ESP8266
SoftwareSerial ESP8266 (rxPin, txPin);

void setup() {
  Serial.begin(9600);
  ESP8266.begin(9600); // Change this to the baudrate used by ESP8266
  delay(2000); // Let the module self-initialize
}

void loop() {
  while (Serial.available()){
     String Data = ESP8266.readStringUntil('\n');
     ESP8266.println(Data);
  } 
  while (ESP8266.available()){
     String inData = ESP8266.readStringUntil('\n');
     Serial.println("Got reponse from ESP8266: " + inData);
  } 
}


When I run this, I go to serial monitor and I write "dofile('server.lua')". It should show the IP of the ESP module, but it shows nothing at all. I already checked the baudrate of the serial monitor. Any help is aprecciated