Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C027_Support
Dependents: C027_SupportTest_xively_location software_test_v1
Fork of Seeed_GPRS_Library_HelloWorld by
When running this example make sure you have:
- edited the SIM PIN, APN, USER and PASSWORD for you network operator
- have inserted a SIM card with enough credits
- the antennas connected
- have good reception (especially for GPS)
- installed the mbed CDC drivers if you run windows
- connected a terminal program, such as teraterm
The example will connect the modem to the network and attach it. I will place a post request to download a file from mbed website. It will do a USSD request and finally wait for incoming SMS. It will try to answer your SMS (try asking "where are you").
You should see a similar output in your preferred console program:
C027 Support Example Device Init Device Status: Device: SARA-G350 Power Save: Active SIM: Ready CCID: xxxxxxxxxxxxxxxxxxxxxxxxxxx IMEI: xxxxxxxxxxxxxxxxxxx IMSI: xxxxxxxxxxxxxxxxxxx Manufacturer: u-blox Model: SARA-G350 Version: 08.49 Network Check Network Status: Registration: Home Signal Strength: -87 dBm Operator: Swisscom Phone Number: +41xxxxxxxxxxx Network Join IP Address: xx.xx.xx.xx Socket Create Socket Connect Make a Http Post Request Socket Send Socket Recving Socket 0: 337 bytes pending Socket 0: 145 bytes pending Socket 0: closed by remote host Socket Recv "HTTP/1.1 200 OK Server: nginx/1.1.19 Date: Thu, 10 Apr 2014 13:09:02 GMT Content-Type: text/plain Connection: close Last-Modified: Fri, 27 Jul 2012 13:30:34 GMT Cache-Control: max-age=36000 Expires: Thu, 10 Apr 2014 20:43:53 GMT Vary: Accept-Encoding X-Mystery-Header: 260358892 X-be: web0_prod_sjc Age: 8709 Hello world! " Socket Close Socket Free Network Disconnect Send Ussd Command *#134# Got Ussd Answer: "UNKNOWN APPLICATION" Checking SMS and GPS GPS Location: 47.28xxx 8.56xxx GPS Location: 47.28xxx 8.56xxx ... GPS Location: 47.28xxx 8.56xxx GPS Location: 47.28xxx 8.56xxx Network Status: Registration: Home Signal Strength: -89 dBm Operator: Swisscom Phone Number: +41xxxxxxxxx GPS Location: 47.28xxx 8.56xxx GPS Location: 47.28xxx 8.56xxx ...
Revision 33:e27f40fada64, committed 2016-08-11
- Comitter:
- mazgch
- Date:
- Thu Aug 11 07:12:02 2016 +0000
- Parent:
- 32:b838fcaba45e
- Parent:
- 30:062717f25e41
- Commit message:
- merged
Changed in this revision
| C027_Support.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r b838fcaba45e -r e27f40fada64 C027_Support.lib --- a/C027_Support.lib Thu Aug 11 07:09:44 2016 +0000 +++ b/C027_Support.lib Thu Aug 11 07:12:02 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/ublox/code/C027_Support/#dafbbf31bf76 +http://mbed.org/teams/ublox/code/C027_Support/#7b747676de86 \ No newline at end of file
diff -r b838fcaba45e -r e27f40fada64 main.cpp
--- a/main.cpp Thu Aug 11 07:09:44 2016 +0000
+++ b/main.cpp Thu Aug 11 07:12:02 2016 +0000
@@ -20,7 +20,7 @@
// These parameters are ignored for LISA-C200 variants and can be left NULL.
//------------------------------------------------------------------------------------
//! Set your secret SIM pin here (e.g. "1234"). Check your SIM manual.
-#define SIMPIN NULL
+#define SIMPIN "1922"
/*! The APN of your network operator SIM, sometimes it is "internet" check your
contract with the network operator. You can also try to look-up your settings in
google: https://www.google.de/search?q=APN+list */
@@ -78,14 +78,6 @@
}
if (mdmOk)
{
- // http://www.geckobeach.com/cellular/secrets/gsmcodes.php
- // http://de.wikipedia.org/wiki/USSD-Codes
- const char* ussd = "*130#"; // You may get answer "UNKNOWN APPLICATION"
- printf("Ussd Send Command %s\r\n", ussd);
- ret = mdm.ussdCommand(ussd, buf);
- if (ret > 0)
- printf("Ussd Got Answer: \"%*s\"\r\n", ret, buf);
-
// join the internet connection
MDMParser::IP ip = mdm.join(APN,USERNAME,PASSWORD);
if (ip == NOIP)
@@ -182,7 +174,16 @@
// disconnect
mdm.disconnect();
}
+
+ // http://www.geckobeach.com/cellular/secrets/gsmcodes.php
+ // http://de.wikipedia.org/wiki/USSD-Codes
+ const char* ussd = "*130#"; // You may get answer "UNKNOWN APPLICATION"
+ printf("Ussd Send Command %s\r\n", ussd);
+ ret = mdm.ussdCommand(ussd, buf);
+ if (ret > 0)
+ printf("Ussd Got Answer: \"%s\"\r\n", buf);
}
+
printf("SMS and GPS Loop\r\n");
char link[128] = "";
unsigned int i = 0xFFFFFFFF;



u-blox / EA Cellular and Positioning Shield