GithubHelp home page GithubHelp logo

Comments (4)

blemasle avatar blemasle commented on August 29, 2024

Hi :)

#define _DEBUG should have worked. Don't forget to define it before the inclusion of SIM808.h. You find the other way so that's all good :)

What do you mean by "so i change it just like your bugfix" ? Don't you have the library with the bugfix applied ?
I cannot understand the chain of command you've get from the debug output.
After

-->AT+SAPBR=3,1,"CONTYPE","GPRS"
<--
<--OK

an +CSTT= with your apn, user & password sould be issued. So where do you get another round of -->AT+SAPBR=3,1,"","" (with empty parameter by the way, which is not possible with the current code) from ?

As for the AT_COMMAND_PARAMETER, BEARER and CONTYPE question, could you point me what lines you're referring to ?

Thanks

from arduino-sim808.

adelleodel avatar adelleodel commented on August 29, 2024

What do you mean by "so i change it just like your bugfix" ? Don't you have the library with the bugfix applied ?

Please click this link, this is your bugfix that i mean. i don't think it's your last fix code. it's contain direct parameter for CONTYPE like this:

AT_COMMAND(SET_BEARER_SETTING_CONTYPE_GPRS, "+SAPBR=3,1,\"CONTYPE\",\"GPRS\"");

which in your last code become multi setting parameter like this (see SIM808.Gprs.h):

AT_COMMAND(SET_BEARER_SETTING_PARAMETER, "+SAPBR=3,1,\"%S\",\"%s\"");

this line of code is doesn't work for me.

So where do you get another round of -->AT+SAPBR=3,1,"","" (with empty parameter by the way, which is not possible with the current code) from ?

this is where the issue begin with. the value I entered in the main code did not pass correctly. that happen with the CONTYPE value too, but i've changed it directly as I said before. I'm using ATmega328p system minimum with crystal 8MHz by the way. I don't know whether it has something to do with it.

by the way, i finally found out that you used #define for executing those line, right?
i'm sorry but cmiiw, i've searched out that using #define for passing values is not good enough, it's better to use inline function rather than #define. take a look at this and this

so maybe i've faced this error because it use #define or what? what do you think?

from arduino-sim808.

adelleodel avatar adelleodel commented on August 29, 2024

I cannot understand the chain of command you've get from the debug output.

by the way, i'm using your example code HttpPost in here if you want to know my chain of command.
i just change GPRS_APN value and some different number of SIM_pin. this is my full original debug output:

N: Powering on SIM808...
powerOnOff: T
Init...
Waiting for echo...

-->AT
Waiting for echo...

-->AT
Waiting for echo...

-->AT
<--⸮Waiting for echo...

-->AT
<--AT
<--OK
<--
<--RDY

-->ATE0
<--
<--+CFUN: 1
<--
<--+CPIN: READY
<--ATE0
<--OK

-->AT+CGREG?
<--
<--+CGREG: 0,2
<--
<--OK

-->AT+CSQ
<--
<--+CSQ: 0,0
<--
<--OK
N: No network yet...

-->AT+CGREG?
<--
<--Call Ready
<--
<--SMS Ready
<--
<--+CGREG: 0,2
<--
<--OK

-->AT+CSQ
<--
<--+CSQ: 9,0
<--
<--OK
N: No network yet...

-->AT+CGREG?
<--
<--+CGREG: 0,1
<--
<--OK

-->AT+CSQ
<--
<--+CSQ: 9,0
<--
<--OK
N: Network is ready.
N: Attenuation : -96 dBm, Estimated quality : 9
N: Powering on SIM808's GPRS...

-->AT+CIPSHUT
<--
<--SHUT OK

-->AT+CGATT=1
<--
<--OK

-->AT+SAPBR=3,1,"",""
<--
<--ERROR
N: Powering on SIM808's GPRS...

-->AT+CIPSHUT
<--
<--SHUT OK

-->AT+CGATT=1
<--
<--OK

-->AT+SAPBR=3,1,"",""
<--
<--ERROR
N: Powering on SIM808's GPRS...

-->AT+CIPSHUT
<--
<--SHUT OK

-->AT+CGATT=1
<--
<--OK

-->AT+SAPBR=3,1,"",""
<--
<--ERROR
N: Powering on SIM808's GPRS...

-->AT+CIPSHUT
<--
<--SHUT OK

-->AT+CGATT=1
<--
<--OK

-->AT+SAPBR=3,1,"",""
<--
<--ERROR
N: Powering on SIM808's GPRS...
...... ( it keeps looping)

Thanks for reply :)

from arduino-sim808.

blemasle avatar blemasle commented on August 29, 2024

Please click this link, this is your bugfix that i mean. i don't think it's your last fix code. it's contain direct parameter for CONTYPE like this:

Yep I already clicked the link in your first comment thansk. Got confused between files versions, sorry :)

I'm using ATmega328p system minimum with crystal 8MHz by the way. I don't know whether it has something to do with it.

That does not make a difference, I primarily develop that library to use with a custom board that use this exact same configuration.

by the way, i finally found out that you used #define for executing those line, right?
i'm sorry but cmiiw, i've searched out that using #define for passing values is not good enough, it's better to use inline function rather than #define. take a look at this and this

Both link you provided don't state that macros are bad :) They however say that macros should be used appropriately depending on the use case, which is exactly what has been done here. The library has been optimized to minimize ram and flash usage to a minimum. The macros you're referring to are just used to make life easier in both declaring and using flash stored variables (see here).
Most SIM808 libraries declare inline variables even when the token are reused accross the application which drastically increase the used flash storage space.
The library has been written for a project were flash space was a concern (at one point, I filled the ATmega328 entirely). The library string management is a result of those constraints. I even sometimes changed the code and de-factorized it in some places (if I recall correctly, it has been a while) to save some precious bytes of RAM and/or flash.

As for your issue. I must confess I'm a bit clueless. With the explanation you've given, I cannot see the actual code you're using. The fix you linked has been changed again for a reason I cannot remember and shouldn't be used, plus I'm not sure if you reverted all of it or just a part. Don't take this badly, but "I just changed" is not a reproductible situation. History tells me that sometimes, something else has been changed and the user don't remember it in all these forward/backward changes :) Could you please make sure you revert all your library changes and post an extract of the code your using, especially APN variables declaration and usage ?

I do not have hands on an Arduino right now and won't until at least a week, so I cannot test if "recent" changes in say Arduino SDK or Arduino-Log might cause the issue either :(

Thanks

from arduino-sim808.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.