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

roaming costs #3

Open
haegar66 opened this issue May 3, 2015 · 14 comments
Open

roaming costs #3

haegar66 opened this issue May 3, 2015 · 14 comments

Comments

@haegar66
Copy link

haegar66 commented May 3, 2015

I live near to a country border.
The cost of GPRS are very expensive by international rooming.
I want to turn off the default rooming of the data connection and activate only with an SMS command again (eg in case of theft).
Can this be installed?
greeting
Claus

@m4rkw
Copy link
Contributor

m4rkw commented Jul 8, 2015

It should be possible, but probably not easy to implement. I think what you probably want to do is save the network code for your home network and then detect when it changes, but that's going to involve additional queries to the modem in the main loop. Also difficult to test as you'd have to roam in order to check that it works. I'll add it to my someday maybe list :)

@m4rkw
Copy link
Contributor

m4rkw commented Jul 18, 2015

@haegar66 Hi, I've just added two new SMS commands which allow you to enable and disable the sending of the data packets. These are "dataoff" and "dataon". In both cases it will confirm that the change has been made via sms. While in "dataoff" mode it will still poll for its location via GPS so you can still use the sms command "locate" to see where the tracker is. Also be sure to set GSM_SEND_FAILURES_REBOOT to 0 therwise a reboot may occur which will re-enable the data sending. Also note that if the device gets power cycled for any reason this will also occur.

Hope this helps :) Mark

@haegar66
Copy link
Author

haegar66 commented Aug 1, 2015

Am 18.07.2015 um 17:10 schrieb Mark Wadham:

@haegar66 https://github.com/haegar66 Hi, I've just added two new
SMS commands which allow you to enable and disable the sending of the
data packets. These are "dataoff" and "dataon". In both cases it will
confirm that the change has been made via sms. While in "dataoff" mode
it will still poll for its location via GPS so you can still use the
sms command "locate" to see where the tracker is. Also be sure to set
GSM_SEND_FAILURES_REBOOT to 0 therwise a reboot may occur which will
re-enable the data sending. Also note that if the device gets power
cycled for any reason this will also occur.

Hope this helps :) Mark


Reply to this email directly or view it on GitHub
#3 (comment).

Hi,

I have found the solution in theory.

AT+CREG Network Registration
Parameter
0 Disable network registration unsolicited result code
1 Enable network registration unsolicited result code +CREG:
2 Enable network registration unsolicited result code with location
information
0 Not registered, ME is not currently searching a new operator to
register to
1 Registered, home network
2 Not registered, but ME is currently searching a new operator to
register to
3 Registration denied
4 Unknown
5 Registered, roaming

so it could be implemitiert:

tracker.h

int ROAMING_ON = 0; //Roaming 0=off 1=on

#define E-Plus_de
// #define Vodafone_de
// #define t-mobile_de
// #define O2_de
// #define Orange_at
// #define A1_Mobilkom_Austria_at
// #define Drei_at
// #define t-mobile_at
// #define Bob_at

#ifdef Drei_at
#define DEFAULT_APN "orange.web" //default APN
#define DEFAULT_USER "drei.at" //default APN user
#define DEFAULT_PASS "" //default APN pass
#endif

#ifdef Orange_at
#define DEFAULT_APN "orange.web" //default APN
#define DEFAULT_USER "web" //default APN user
#define DEFAULT_PASS "web" //default APN pass
#endif

#ifdef A1_Mobilkom_Austria_at
#define DEFAULT_APN "orange.web" //default APN
#define DEFAULT_USER "web" //default APN user
#define DEFAULT_PASS "web" //default APN pass
#endif

#ifdef t-mobile_at
#define DEFAULT_APN "gprsinternet" //default APN
#define DEFAULT_USER "t-mobile" //default APN user
#define DEFAULT_PASS "tm" //default APN pass
#endif

#ifdef Bob_at
#define DEFAULT_APN "bob.at" //default APN
#define DEFAULT_USER "[email protected]" //default APN user
#define DEFAULT_PASS "ppp" //default APN pass
#endif

#ifdef Vodafone_de
#define DEFAULT_APN "web.vodafone.de" //default APN
#define DEFAULT_USER "vodafone" //default APN user
#define DEFAULT_PASS "vodafone" //default APN pass
#endif

#ifdef t-mobile_de
#define DEFAULT_APN "internet.t-mobile" //default APN
#define DEFAULT_USER "tm" //default APN user
#define DEFAULT_PASS "tm" //default APN pass
#endif

#ifdef E-Plus_de
#define DEFAULT_APN "internet.eplus.de" //default APN
#define DEFAULT_USER "eplus" //default APN user
#define DEFAULT_PASS "eplus" //default APN pass
#endif

#ifdef O2_de
#define DEFAULT_APN "wap.viaginterkorn.de" //default APN
#define DEFAULT_USER "" //default APN user
#define DEFAULT_PASS "" //default APN pass
#endif

gsm.ino

void gsm_status_read()
{
// gsm status

// 0 Disable network registration unsolicited result code
// 1 Enable network registration unsolicited result code +CREG:
// 2 Enable network registration unsolicited result code with
location information

// 0 Not registered, ME is not currently searching a new operator to
register to
// 1 Registered, home network
// 2 Not registered, but ME is currently searching a new operator to
register to
// 3 Registration denied
// 4 Unknown
// 5 Registered, roaming

char *status_str;
int auswahl = 0;

char *tmp1;
char *tmp1val;

debug_print(F("gsm_status() started."));

//todo check
gsm_port.print("AT+CREG?");
gsm_port.print("\r");

delay(500);
gsm_get_reply(0);

//todo check if everything is delivered
tmp1 = strstr(modem_reply, "AT+CREG: ");
tmp1 += strlen("+CREG: ");
tmp1val = strtok(tmp1, "\r");

//checking how many bytes NON-acked
status_str = strtok_r(tmp1val, ", ", &tmp1val);
auswahl = atoi(status_str);

switch (auswahl) {
case 0:
debug_print(F("Disable network registration unsolicited result
code"));
break;
case 1:
debug_print(F("Enable network registration unsolicited result
code +CREG: "));
break;
case 2:
debug_print(F("Enable network registration unsolicited result
code with location information"));
default:
debug_print(F("ERROR"));
};

status_str = strtok_r(NULL, ", ", &tmp1val);
auswahl = atoi(status_str);
switch (auswahl) {
case 0:
debug_print(F("Not registered, ME is not currently searching a
new operator to register to"));
break;
case 1:
debug_print(F("Registered, home network"));
gsm_status.at_home = 1;
gsm_status.at_roaming = 0;
break;
case 2:
debug_print(F("Not registered, but ME is currently searching a
new operator to register to"));
case 3:
debug_print(F("Registration denied"));
case 4:
debug_print(F("Unknown"));
case 5:
debug_print(F("Registered, roaming"));
gsm_status.at_home = 0;
gsm_status.at_roaming = 1;
default:
debug_print(F("ERROR"));
};

debug_print(F("gsm_validate_tcp() completed."));

}

sms.ino
tmp = strstr(cmd, "roaming");
if (tmp!=NULL)
{
debug_print(F("sms_cmd_run(): Roaming command detected"));
if (!ROAMING_ON)
{
sms_send_msg("Roaming ON", phone);
SEND_DATA = 1;
ROAMING_ON = 1;
}
else
{ sms_send_msg("Roaming OFF", phone);
SEND_DATA = 1;
ROAMING_ON = 0;
}
}

opentracker_3_0_1.ino

//gsm status
struct gsm_status_struct {
int at_home; //flag for Registered, home network
int at_roaming; //Flag for Registered, roaming
};

gsm_status_struct gsm_status;

debug_print(F("Current:"));
debug_print(data_current);

gsm_status_read(); // Roaming?

if ((SEND_DATA & gsm_status.at_home ) || (SEND_DATA &
gsm_status.at_roaming & ROAMING_ON)) {
int i = gsm_send_data();

    if(i != 1)
    {
   //current data not sent, save to sd card
       debug_print(F("Can not send data, saving to flash memory"));

/*
#ifdef STORAGE
storage_save_current(); //in case this fails - data is lost
#endif

*/

Claus Dickert

@dimetron
Copy link

Hi,

Is anyone going to merge above roaming to master or I can do it?

I suggest also to have different GPS timeouts to be set in roaming and potentially
use RAW TCP with compression of several points using polylinealgorithm https://developers.google.com/maps/documentation/utilities/polylinealgorithm?hl=en

@ghost
Copy link

ghost commented Jan 26, 2016

Hi,
I have the opposite problem than haegar66.
I want my tracker contiues working even out of my country but actually does not.
Maybe it is because I modified tracker.h as follows:

#define DEFAULT_APN "orangeworld"
#define DEFAULT_USER "orange"
#define DEFAULT_PASS "orange"

I made this because it is the APN I want to use and my SIM card does not allow SMS (it is cheaper!).

My question is: if I use default settings:

#define DEFAULT_APN "internet"
#define DEFAULT_USER ""
#define DEFAULT_PASS ""

my tracker will connect in every coutry?

I am far away from any border and it's difficult for my to test.
I'll be happy if someone can answer me.

Thanks
Alfredo

@bullshit
Copy link
Contributor

Hi Alfredo,

if think that your mobile operator blocks GPRS connections outside your country. The APN connections are always the same. This issue treated the possibility to turn off GPRS communication in foreign countries because GPRS roaming is mostly expensive.

I want to turn off the default roaming of the data connection and activate only with an SMS command again - @haegar66 commented on 3 May 2015

@m4rkw
Copy link
Contributor

m4rkw commented Jan 27, 2016

FWIW I had the same issue using giffgaff in the uk. Drove to france, tracker mysteriously stopped working. I think I checked that roaming was enabled on my account before we went, but not 100% sure. Might go back again sometime this year so if I do I'll check it again and try to figure out why it wasn't working.

@ghost
Copy link

ghost commented Jan 27, 2016

I think APN are not allways the same, in Spain APN for Orange is "orangeworld" in France it is "orange". When my vehicle went to France it stopped connecting. I have roaming activated in my SIM card.
I dont know how mobile phones do to switch APN when they travel to other country. I would like to do the same or maybe there is a generic APN which works in every country... if someone can help me...

@m4rkw
Copy link
Contributor

m4rkw commented Jan 27, 2016

Maybe there's a mechanism for pushing out APN updates when you roam, that mobile phones are programmed to handle but opentracker is not. Just a theory.

@ppescher ppescher changed the title rooming costs roaming costs Jan 29, 2016
@ghost
Copy link

ghost commented Jan 29, 2016

Please haegar66, maybe you can help me: which APN do you use that provokes your opentracker roam?

@ghost
Copy link

ghost commented May 13, 2016

Hi,
I want my tracker roams but it doesnt: when it gets out of Spain it stops transmiting.
Anyone can tell which APN should be used to make it roam???
Thanks

@ZdenekAster
Copy link

In Czech Republic GSM operators, APN is some at roaming. But some operators in roaming, send html page with text and button to accept roaming data connect.... Without this click to button roaming not working :-(

@m4rkw
Copy link
Contributor

m4rkw commented May 14, 2016

@agraciabona I haven't managed to get mine working with roaming yet either, probably because like you say the APN changes. I think with the current software the only way to get it to work would be to put the sim card into a modern mobile phone, see what the APN gets automatically set to and then configured that in the tracker.

@Daniel-dk
Copy link

Daniel-dk commented Jul 18, 2016

you could look at services like Jasper wireles or telit - They are "international network providers

They are a bit more expensive than regular operators but have the same APN and manage the roaming for you so the device does not need separate settings per country

We've used Telit before and it worked great ( sub-Saharan Africa )- They need to know how many devices and which countries you want to roam in to give you pricing, so it a bit of a pain, but can provide up to 3 test SIMS.

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

6 participants