Comments (2)
I made it work with HardwareSerial with ESP32 NodeMCU. Here is how:
1) You need to change Sim800l.h defines first, like that:
#define RX_PIN 16 // This goes to your RX on UART 2 port, acordding to your hardware (ESP in my case)
#define TX_PIN 17 // This goes to your TX on UART 2 port, acordding to your hardware (ESP in my case)
#define BAUD_RATE 9600
2) Now you need to change Sim800l.cpp global variable SoftwareSerial to HardwareSerial:
/* This goes in your global scope. Remember, we initialize with HardwareSerial object(2) because we are using UART 2 with pins RX2(GPIO 16) and TX2 (GPIO 17)*/
HardwareSerial SIM(2);
3) Modify Sim800l begin method in Sim900l.cpp:
void Sim800l::begin(){
SIM.begin(BAUD_RATE, SERIAL_8N1, RX_PIN, TX_PIN, false);
Serial.begin(9600);
#if (LED)
pinMode(OUTPUT,LED_PIN);
#endif
_buffer.reserve(255); //reserve memory to prevent intern fragmention
}
4) In your main.cpp, just use it like usual, e.g:
Sim800l mySIM;
String text = "Testing library";
String number = "+999999999999";
void setup(){
mySIM.begin(); // initializate the library.
Serial.begin(9600);
// error = mySIM.sendSms(number,text);
mySIM.signalQuality();
}
Hope it helps! Best regards.
from sim800l.
I have same problem, any news to change from SoftwSerial to HardwareSerial?
from sim800l.
Related Issues (19)
- readSMS Not working... "'uint8_t index' redeclared as different kind of symbol" HOT 3
- Not sending SMS while moving HOT 9
- _readSerial problem HOT 1
- callNumber()
- APN with user and password
- Request for Signal Quality and Operator Name HOT 1
- Unicode problem HOT 2
- readSms return missing the sms content HOT 1
- GPS neo-6m+GSM Sim800l library HOT 1
- Mms HOT 4
- Return USSD code result by sending SMS
- SIM800L not responding
- Not compile HOT 2
- DTMF HOT 8
- Compatible with Sim800A? HOT 1
- Issue in sending sms
- Delete SMS Messages Not working on SIM800L module HOT 1
- Decoding DTMF if tones is not hearable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sim800l.