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

Does not work with Multi-Network SIMs #5

Open
ChrisBingham1 opened this issue Mar 17, 2017 · 4 comments
Open

Does not work with Multi-Network SIMs #5

ChrisBingham1 opened this issue Mar 17, 2017 · 4 comments

Comments

@ChrisBingham1
Copy link

Hi,

Firstly, a great bit of serial feedback to COM6 when doing things in your code - something so often missed out and something which helped me understand what was going wrong!

Multi-Network SIMs - often used for MMI applications are normally Roaming SIMs. I have one of these in my Arduino SIM800L. This means that even though you are connected, the returned status is not :
+CREG:0,1
it is:
+CREG:0,5

Therefore, in http.cpp since you have the following defined:
#define CONNECTED "+CREG: 0,1"

This While statement causes it to be stuck in the loop:

Result HTTP::configureBearer(const char *apn){

Result result = SUCCESS;

unsigned int attempts = 0;
unsigned int MAX_ATTEMPTS = 10;

sendATTest();
// CONNECTED IN THE NEXT LINE FAILS THE ROAMING SIMS:
while (sendCmdAndWaitForResp(REGISTRATION_STATUS, CONNECTED, 2000) != TRUE && attempts < MAX_ATTEMPTS){
sendCmdAndWaitForResp(SIGNAL_QUALITY, CONNECTED, 1000);
attempts ++;
delay(1000 * attempts);
if (attempts == MAX_ATTEMPTS) {
attempts = 0;
preInit();
}
}

So it looks like that the code needs to be tweaked so that if CONNECTED fails then it looks for ROAMING which would be defined as:
#define ROAMING "+CREG: 0,5"

I've currently just cloned and changed CONNECTED in my copy to 0,5 and the code then works fine for my Roaming Multi Network SIM.

Cheers,

Chris

@carrascoacd
Copy link
Owner

Hi,

Ok, thank you for your contribution! I'll try to improve the "connected" concept by adding the Roaming Multi Network SIM state when I'd have a bit of free time.

Cheers

@jaka87
Copy link
Contributor

jaka87 commented May 16, 2019

Had the same problem, took me about half an hour to figure out the solution. I came here to write about it so maybe I can save someone's time but its already documented.
I would just add that using roaming is not that uncommon. Most of telephone operators offer large data packages which are overkill and cost more than we are willing to spend to use few MB per month. Some charge insane amount for 1MB with prepaid options, others are reasonable but are using crazy billing unit. I stumble upon one operator with billing unit of 1MB!!!! If you want cheap data search for "IOT sim card". Im my case i manage to cut down cost for 1MB for more than 50% comparing most optimal package while using the same network. If you are using IOT sim card (which I recommend to everybody) you are probably using roaming in at least 90% cases

@carrascoacd
Copy link
Owner

carrascoacd commented May 16, 2019

@jaka87 I just created a PR with some work I did using the code @ChrisBingham1 shared, I've tested a bit but I didn't release it because of I didn't have enough time to test it properly #28

@jaka87
Copy link
Contributor

jaka87 commented May 18, 2019

Great work. I tested it for more than one day with update intervals of about 5min. Everything seems fine.

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

3 participants