skorokithakis / A6lib

An ESP8266/Arduino library for communicating with the A6 GSM module. ⛺
MIT License
127 stars 49 forks source link

software serial library ?? #3

Closed beyondszine closed 7 years ago

beyondszine commented 7 years ago

hey I am using this with Arduino IDE 1.6.8 and 1.6.9 but in both of them there are two errors coming up.

  1. D6 and D5 are not defined. Got to change them to 6 and 5.
  2. Software Serial library in the default library folder is not matching with the Software serial that you are using. Correct me If I am wrong here.

https://www.arduino.cc/en/Reference/SoftwareSerial

I am using the default software serial library.

Your constructor:

A6lib::A6lib(int transmitPin, int receivePin) {
    A6conn = new SoftwareSerial(receivePin, transmitPin, false, 1024);
    A6conn->setTimeout(100);
}

default Softwareserial lib. takes the last argument ??

skorokithakis commented 7 years ago

Hello! Hmm, the SoftSerial library is, indeed, a problem, but I think there's an easy fix: Change the include to:

#include <SoftwareSerial.h>

The D5, though, should work fine. All the Arduino pins are defined with letters as well. Are you using the library on an actual Arduino board?

yvanovsk commented 7 years ago
  1. In a classic Arduino IDE digital pins D0-D13 are not defined. Same in Visual Micro. Need to #define them by your self.
  2. SoftwareSerial for Arduino is a bit different and takes only 3 parameters. Might be a good idea to wrap SoftwareSerial init with #ifdef to match the platform.
  3. Library props have platform/architecture set to esp only. Need to change this to "*" in order to be able to add this lib in Visual Micro.
skorokithakis commented 7 years ago

Thank you, @yvanovsk. Would you like to have a look at the PR that implements this (https://github.com/skorokithakis/A6lib/pull/4)?

@beyondszine, can you change item 3 in @yvanovsk's list too? Thanks!

beyondszine commented 7 years ago

@skorokithakis I can but I am just not sure about it. I am not familiar with this Visual Micro. But anyway, it seems that @yvanovsk is talking about libraries.json and library.properties files. I can surely edit both for platform and architecture for all. Am I right here ?

yvanovsk commented 7 years ago

@beyondszine - you are correct with the libraries.json and library.properties files. @skorokithakis - I've looked at the suggested PR - looks promising. I just added a couple comments to the code in PR.

beyondszine commented 7 years ago

@skorokithakis I guess this issue too has been resolved with the latest commits.

skorokithakis commented 7 years ago

I think so too, I'm going to close it, please reopen if the issue persists.