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

Not working? (fixed) #2

Open
jankluiver opened this issue Apr 25, 2017 · 22 comments
Open

Not working? (fixed) #2

jankluiver opened this issue Apr 25, 2017 · 22 comments

Comments

@jankluiver
Copy link

Perhaps a personal issue, but I can't get the library to work.

I have a MEGA that talks via SoftwareSerial (10,11) to my SIM800L on 9600 using AT commands. So HW and SW Serial is OK.

I uploaded your library in IDE and tried several examples. It does not work. In the example below it does not even print normal text to monitor.

I really like the functionality you created. So it was a little disappointment that it did not work. Not sure what it is. I have used libraries many times, normally it works (almost) out of the box.

Any suggestion?

KR, Jan

#include <Sim800L.h>
#include <SoftwareSerial.h>
#define RX 10
#define TX 11
Sim800L GSM(RX, TX);

void setup(){
Serial.begin(9600);
GSM.begin(9600);
Serial.println("GET PRODUCT INFO: ");
Serial.println(GSM.getProductInfo());
}
void loop(){
}

@arthurmolina
Copy link

arthurmolina commented May 17, 2017

I made a pull request to fix it.
The changes are only in begin() methods.

@vittorioexp
Copy link
Owner

vittorioexp commented May 20, 2017

I released a new version (1.1.2). Does it work for you now?

@vittorioexp vittorioexp reopened this May 20, 2017
@jankluiver
Copy link
Author

jankluiver commented May 20, 2017 via email

@jankluiver
Copy link
Author

jankluiver commented May 20, 2017 via email

@vittorioexp
Copy link
Owner

Hi Jan,

Thanks for the work of testing and reporting you are doing.

Does it work if you try to get the product info, the operators list, or the operator you are connected to? I'm talking about "getInformations" example sketch. And what do the functions return?

To get GSM coordinates you should first calculate them with "calculateLocation()". Now i try to send the at command to get coords in a different way (see v. 1.1.3). Eventually, try to read the returns of AT+CIPGSMLOC=1,1\r\n;.

I took RTC functions from the original version of the library by Cristian Steib (https://github.com/cristiansteib/Sim800l) so we should ask him.

If you want, we can add your code ( to extract GSM coordinates, date, time, battery voltage and battery level from the SIM800L) into the library to replace the old not-working functions.

Kind regards,

Vittorio

@jankluiver
Copy link
Author

jankluiver commented May 21, 2017 via email

@jankluiver
Copy link
Author

jankluiver commented May 21, 2017 via email

@vittorioexp
Copy link
Owner

Hi Jan,

Can you please paste here what does "get information" returns?

Where is the document you mentioned, which contains the code that can be added to the library?

Vittorio

@jankluiver
Copy link
Author

jankluiver commented May 22, 2017 via email

@vittorioexp
Copy link
Owner

Hi Jan,

Thank you for sending the code.

I can't understand why there are three Serial3.println ("AT+SAPBR=...);

Today i'll try to integrate this functions into the library, replacing the code of some functions.

Can you please test if the sleep mode (and functionality mode) functions of the library work?

Vittorio

@jankluiver
Copy link
Author

jankluiver commented May 23, 2017 via email

@vittorioexp
Copy link
Owner

vittorioexp commented May 24, 2017

I edited the function calculateLocation() adding your AT commands.
Is this right?

`bool Sim800L::calculateLocation() {

this->SoftwareSerial::print("AT+SAPBR=3,1,"CONTYPE","GPRS"");

delay(50);

this->SoftwareSerial::print("AT+SAPBR=3,1,"APN","smartsites.t-mobile"");

delay(50);

this->SoftwareSerial::print("AT+SAPBR=1,1");

delay (50);

this->SoftwareSerial::print("AT+CIPGSMLOC=1,1");

// answer format: +CIPGSMLOC: 0,4.382148,52.032688,2016/10/28,14:08:16

String data = _readSerial(20000);

if (data.indexOf("ER")!=(-1)) return false;

uint8_t indexOne;
uint8_t indexTwo;

indexOne = data.indexOf(":") + 1;
indexTwo = data.indexOf(",");

_locationCode = data.substring(indexOne, indexTwo);

indexOne = data.indexOf(",") + 1;
indexTwo = data.indexOf(",", indexOne);

_longitude = data.substring(indexOne, indexTwo);

indexOne = data.indexOf(",", indexTwo) + 1;
indexTwo = data.indexOf(",", indexOne);

_latitude = data.substring(indexOne, indexTwo);

return true;
}`

@jankluiver
Copy link
Author

jankluiver commented May 24, 2017 via email

@jankluiver
Copy link
Author

jankluiver commented May 26, 2017 via email

@vittorioexp
Copy link
Owner

Hi,

Can you send me a picture of your hardware?

Thank you

@jankluiver
Copy link
Author

jankluiver commented May 26, 2017 via email

@vittorioexp
Copy link
Owner

I mean the hardware links between sim800l/arduino/battery. Because my module ever returns ERROR: SIM not inserted.
This is what i do.
AT
OK

AT+CFUN?
+CFUN: 1
OK

AT+CPIN?
+CME ERROR: SIM not inserted

@jankluiver
Copy link
Author

jankluiver commented May 26, 2017 via email

@jankluiver
Copy link
Author

jankluiver commented May 28, 2017 via email

@vittorioexp
Copy link
Owner

vittorioexp commented May 29, 2017

Hi Jan,

I'm glad to know the sleeping functionality is working.

My module still not works, maybe the 3 SIM cards i tried are too recent. When did you buy yours?

Maybe it is because i have this component between the battery and the module: https://www.amazon.it/gp/product/B01DRT4PWY/ref=oh_aui_detailpage_o08_s00?ie=UTF8&psc=1

Vittorio.

@vittorioexp vittorioexp changed the title Not working? Not working? (fixed) Jun 26, 2017
@vittorioexp
Copy link
Owner

Hi Jan,

did the example sketch "GSM_Coordinates.ino" work for you?
I remember i added your modifications about this in the last version of the library.

@jankluiver
Copy link
Author

jankluiver commented Jul 3, 2017 via email

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

No branches or pull requests

3 participants