ArduinoSIM800L icon indicating copy to clipboard operation
ArduinoSIM800L copied to clipboard

Hardware Serial

Open Travis92 opened this issue 7 years ago • 6 comments

Hi, i am currently working with your library and i would like to implement it with HW serial2 on a Mega. Are you working for developing it?

Thanks

P.

Travis92 avatar Feb 25 '18 15:02 Travis92

Hi,

No, I'm not working at the moment in this feature. You are very welcome to contribute to the library

Thanks!

carrascoacd avatar Feb 25 '18 15:02 carrascoacd

@Travis92 I am not sure about the Mega, but it was very easy to do on my ESP32 based board. Just modified a couple of lines in Sim800.h to use HardwareSerial instead of SoftwareSerial.

Just make sure to comment out the serialSim800.listen() line in Sim800.c sendCmd() as it is not needed for HardwareSerial.

ankgt avatar Mar 10 '18 18:03 ankgt

@ankgt

Could open a pull request or could you share your esp32 based code for this same library?

Thanks in advance

fedy0 avatar May 19 '18 11:05 fedy0

@fedy0

I have made a lot of changes to the library so it will be confusing if I post it. I believe the main change that is required to work with the ESP32 is very simple and it is in Sim800.h:

SIM800(unsigned int baudRate, unsigned int rxPin, unsigned int txPin, unsigned int rstPin, bool debug):serialSIM800(1) { serialSIM800.begin(baudRate, SERIAL_8N1, rxPin, txPin, false); debugMode = debug; resetPin = rstPin; };

Also change the following at the end of Sim800.h: Remove: SoftwareSerial serialSIM800 Add: HardwareSerial serialSIM800

You will have to change the definitions for Http.h also to accept the rxPin and txPin. I don't believe anything else was required.

There are some small bugs in the library which cause it to crash in some cases, and I do plan to open a separate thread for that, just not got a change to get to it. Will do it shortly.

Hope it helps.

ankgt avatar May 22 '18 12:05 ankgt

@ankgt How did you get on with this? Did you manage to post your code somewhere?

kierenblack avatar May 19 '19 05:05 kierenblack

@kierenblack I have changed my modem to Quectel M66 instead of the Simcom, but continued using this base library. However, I have heavily customised it my specific requirements.

Where are you getting stuck?

ankgt avatar May 20 '19 06:05 ankgt