ESPSoftwareSerial problem
Posted: Sun Nov 24, 2019 5:14 pm
I am using the SoftwareSerial.h library with a Arduino Uno and a 800L modem module (simple Rx/Tx communication).
This works just fine, (running the program outputs modem result codes on the Serial Monitor), but after changing to a ESP32-Wrover the Rx/Tx communication no longer works.
I have updated the library to Peter Lerups ESPSoftwareSerial.h (version 6.30).
After the update the Uno still works fine with the modem, but not the ESP32-Wrover.
(Running the ESP32-wrover blink sketch, etc, works fine, so the ESP32 module is working)..
Here is the code that works with Uno (with the ESPSoftwareSerial.h library) :
When changing to ESP32-wrover the only thing I have changed in the sketch code is the line :
SoftwareSerial mySerial(3, 2);
that is changed to :
SoftwareSerial mySerial(34, 26);
(I have a level shifter from the ESP32 output pin ( GPIO26), to the 800L modem module, so I have checked that the voltage levels are correct...)
I assume that I may have to make more program changes, but I cant figure out what to do....
How can I proceed ???
/Gurra
This works just fine, (running the program outputs modem result codes on the Serial Monitor), but after changing to a ESP32-Wrover the Rx/Tx communication no longer works.
I have updated the library to Peter Lerups ESPSoftwareSerial.h (version 6.30).
After the update the Uno still works fine with the modem, but not the ESP32-Wrover.
(Running the ESP32-wrover blink sketch, etc, works fine, so the ESP32 module is working)..
Here is the code that works with Uno (with the ESPSoftwareSerial.h library) :
Code: Select all
#include <SoftwareSerial.h>
//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(3, 2); //SIM800L Tx & Rx is connected to Arduino #3 & #2
void setup()
{
//Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);
//Begin serial communication with Arduino and SIM800L
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT"); //Once the handshake test is successful, it will back to OK
updateSerial();
mySerial.println("AT+CSQ"); //Signal quality test, value range is 0-31 , 31 is the best
updateSerial();
mySerial.println("AT+CCID"); //Read SIM information to confirm whether the SIM is plugged
updateSerial();
mySerial.println("AT+CREG?"); //Check whether it has registered in the network
updateSerial();
}
void loop()
{
updateSerial();
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}
}
When changing to ESP32-wrover the only thing I have changed in the sketch code is the line :
SoftwareSerial mySerial(3, 2);
that is changed to :
SoftwareSerial mySerial(34, 26);
(I have a level shifter from the ESP32 output pin ( GPIO26), to the 800L modem module, so I have checked that the voltage levels are correct...)
I assume that I may have to make more program changes, but I cant figure out what to do....
How can I proceed ???
/Gurra