Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing Softwareserial by Altsoftserial #44

Open
geologic opened this issue Feb 1, 2018 · 1 comment
Open

Replacing Softwareserial by Altsoftserial #44

geologic opened this issue Feb 1, 2018 · 1 comment

Comments

@geologic
Copy link

geologic commented Feb 1, 2018

Hi all

I have a Uno connected to a ESP8266 to send a GET request to a webserver. I use softwareserial and wifiesp library like this:

WiFiEspClient client;
#include <SoftwareSerial.h>
SoftwareSerial Serial1(8,9);

  // initialize serial for ESP module
  Serial1.begin(9600);
  // initialize ESP module
  WiFi.init(&Serial1);

...

    // Make a HTTP request
    client.println(F("GET /sensor.php?id=1 HTTP/1.1"));
    client.println(F("Host: www.domain.com"));
    client.println(F("Connection: close"));
    client.println();

    //read HTTP response
    while (client.connected()) {
      while (client.available()) { 
        char ch=client.read();
        Serial.print(ch);
      }
    }

The request is done and I can see the HTTP response on the serial monitor.
Now i want to replace softwareserial for Altsoftserial so i made this changes:

//#include <SoftwareSerial.h>
//SoftwareSerial Serial1(8,9);

#include <AltSoftSerial.h>
AltSoftSerial Serial1;

I double check my wires, ESP8266 module is working, request is sent to PHP page but i cannot see HTTP response on the serial monitor.

If i put back softwareserial on code, it works ok.

Any ideas?

@PaulStoffregen
Copy link
Owner

AltSoftSerial does not support ESP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants