carrascoacd / ArduinoSIM800L

Arduino HTTP & FTP client for SIM800L/SIM800 boards to perform GET and POST requests to a JSON API as well as FTP uploads.
158 stars 58 forks source link

Aplications for STM32 using HardwareSerial Serial1, Serial2 and Serial3 #48

Open viniciusbarozzi opened 3 years ago

viniciusbarozzi commented 3 years ago

Hello, I'm working on the library changes to be able to work with the STM32 on Arduino Ide, but I can't find a way to identify which serial port will be used. I'm using as a base the version modified for ESP32 where some changes have already been made to work with HardwareSerial, but I can't understand where to define which Serial port to use.

I appreciate any contribution. Thank you.

carrascoacd commented 3 years ago

Hello, you can use SoftwareSerial and it should work properly.

viniciusbarozzi commented 3 years ago

Hello Antônio, I tried to use SoftwareSerial with Stm32, but it doesn't work because in the stm32duino repository there is no SoftwareSerial Function precisely because it already has 3 hardware serial ports. I tried to modify the construction method of your library, but I couldn't, finally, started to develop a program based on the procedures used in your library. My focus is only to use the POST function over HTTP. If you are interested, I can share here the development of the program I am doing.

carrascoacd commented 3 years ago

Ok, I understand.

Feel free to see this branch https://github.com/carrascoacd/ArduinoSIM800L/tree/add-compatibility-for-esp32 where I did some modifications to support it. Take a look especially at this file and line https://github.com/carrascoacd/ArduinoSIM800L/blob/add-compatibility-for-esp32/src/Sim800.h#L60

You will have to initialize your serial variable like this I think https://github.com/stm32duino/Arduino_Core_STM32/blob/master/cores/arduino/HardwareSerial.cpp#L37

If you manage to make it work we can add some configuration to support both software and hardware serial.