https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version
I understand the library ' softserial' is included in the esp8266 build so no need to add a softseriallibrary manually (so I thought).
Now when I/m trying to compile my code I do get an error:
SoftwareSerial.h: No such file or directoryThis is my script:
/*
* This sketch reads a command through a http connection
* depending on the text received it will send open, stop or close
* commands to the Esp8266. the ESP8266 is connected to the Axa Remote 2.0 electric window opener
*/
#include <SoftwareSerial.h> // For Swapping TX/RX
#define rxPin 1
#define txPin 3
#define MAX_MSG_LEN (128) // maximum MQTT recieved message length
const byte numChars = 128; // maximum SERIAL recieved message length
char receivedChars[numChars]; // an array to store the received message
const byte numCode = 4; // maximum SERIAL recieved message length
char receivedCode[numCode]; // an array to store the received code
boolean newData = false;
SoftwareSerial SoftSerial(rxPin, txPin); // Software serial
#include <ESP8266WiFi.h>
const char* ssid = "xxx";
const char* password = "xxx";
// Create an instance of the server
// specify the port to listen on as an argument
WiFiServer server(80);
void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
SoftSerial.begin(19200,SWSERIAL_8N1);
delay(10);
// Connect to WiFi network
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
// Start the server
server.begin();
}
void loop() {
// Check if a client has connected
WiFiClient client = server.available();
if (!client) {
return;
}
// Wait until the client sends some data
while(!client.available()){
delay(1);
}
// Read the first line of the request
String req = client.readStringUntil('\r');
client.flush();
// Match the request
int val;
if (req.indexOf("/open") != -1)
open_axa();
else
if (req.indexOf("/close") != -1)
close_axa();
else if (req.indexOf("/stop") != -1)
stop_axa();
else {
SoftSerial.println("invalid request");
client.stop();
return;
}
}
void open_axa() {
SoftSerial.print("O");
delay(20);
SoftSerial.print("P");
delay(20);
SoftSerial.print("E");
delay(20);
SoftSerial.print("N");
delay(20);
SoftSerial.println("\r");
delay(200);
SoftSerial.print("O");
delay(20);
SoftSerial.print("P");
delay(20);
SoftSerial.print("E");
delay(20);
SoftSerial.print("N");
delay(20);
SoftSerial.println("\r");
delay(200);
SoftSerial.print("O");
delay(20);
SoftSerial.print("P");
delay(20);
SoftSerial.print("E");
delay(20);
SoftSerial.print("N");
delay(20);
SoftSerial.println("\r");
delay(2000);
}
void close_axa() {
SoftSerial.print("C");
delay(20);
SoftSerial.print("L");
delay(20);
SoftSerial.print("O");
delay(20);
SoftSerial.print("S");
delay(20);
SoftSerial.print("E");
delay(20);
SoftSerial.println("\r");
delay(2000);
SoftSerial.print("C");
delay(20);
SoftSerial.print("L");
delay(20);
SoftSerial.print("O");
delay(20);
SoftSerial.print("S");
delay(20);
SoftSerial.print("E");
delay(20);
SoftSerial.println("\r");
delay(2000);
SoftSerial.print("C");
delay(20);
SoftSerial.print("L");
delay(20);
SoftSerial.print("O");
delay(20);
SoftSerial.print("S");
delay(20);
SoftSerial.print("E");
delay(20);
SoftSerial.println("\r");
delay(2000);
}
void stop_axa() {
SoftSerial.print("S");
delay(20);
SoftSerial.print("T");
delay(20);
SoftSerial.print("O");
delay(20);
SoftSerial.print("P");
delay(20);
SoftSerial.println("\r");
SoftSerial.print("S");
delay(20);
SoftSerial.print("T");
delay(20);
SoftSerial.print("O");
delay(20);
SoftSerial.print("P");
delay(20);
SoftSerial.println("\r");
SoftSerial.print("S");
delay(20);
SoftSerial.print("T");
delay(20);
SoftSerial.print("O");
delay(20);
SoftSerial.print("P");
delay(20);
SoftSerial.println("\r");
}Do I misunderstand the fact the softserial library is included in the esp8266 build? Do I have to do something else to implant this library?