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

Hardware Serial #8

Open
Travis92 opened this issue Feb 25, 2018 · 6 comments
Open

Hardware Serial #8

Travis92 opened this issue Feb 25, 2018 · 6 comments

Comments

@Travis92
Copy link

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.

@carrascoacd
Copy link
Owner

carrascoacd commented Feb 25, 2018 via email

@ankgt
Copy link

ankgt commented Mar 10, 2018

@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.

@fedy0
Copy link

fedy0 commented May 19, 2018

@ankgt

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

Thanks in advance

@ankgt
Copy link

ankgt commented May 22, 2018

@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.

@kierenblack
Copy link

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

@ankgt
Copy link

ankgt commented May 20, 2019

@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?

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

No branches or pull requests

5 participants