C027_Support library test

Dependencies:   C027_Support

Dependents:   C027_SupportTest_xively_location software_test_v1

Fork of Seeed_GPRS_Library_HelloWorld by wei zou

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:
18:50e6c4ed8a4a
Parent:
17:c293780a40ac
Child:
19:f022ff746eb8
--- a/main.cpp	Wed May 14 12:24:04 2014 +0000
+++ b/main.cpp	Thu May 15 06:16:51 2014 +0000
@@ -25,34 +25,24 @@
 //----------------------------------------------------------------------
 /* This example was tested on C027-U20 and C027-G35 with the on board modem. 
    
-   Additionally it was tested with a shield where the SARA-G350 RX/TX/PWRON 
+   Additionally it was tested with a shield where the SARA-G350/U260/U270 RX/TX/PWRON 
    is connected to D0/D1/D4 and the GPS SCL/SDA is connected D15/D15. In this 
    configuration the following platforms were tested (it is likely that others 
    will work as well)
-   - U-BLOX:    C027-XX.
-   - NXP:       LPC1549v2 
-   - Freescale: FRDM-KL25Z, FRDM-KL46Z
+   - U-BLOX:    C027-G35, C027-U20, C027-C20 (for shield remove define C027_USEONBOARD)
+   - NXP:       LPC1549v2, LPC4088qsb
+   - Freescale: FRDM-KL05Z, FRDM-KL25Z, FRDM-KL46Z, FRDM-K64F
    - STM:       NUCLEO-F401RE, NUCLEO-F030R8
+                mount resistors SB13/14 1k, SB62/63 0R
 */
 #if defined(TARGET_UBLOX_C027)
-  #define C027_USEONBOARD // remove this if you have the GSM/GPS shield mounted
+  #define C027_USEONBOARD // remove if you have the GSM/GPS shield mounted to the C027
 #endif
 
 #ifdef C027_USEONBOARD
   #include "C027.h"
   C027 c027;
-#elif TARGET_LPC4088
-  // mapping for use with the EA QSB base board
-  #define GPSSCL    p20
-  #define GPSSDA    p19
-  #define GPSADR   (66<<1) // GPS I2C Address
-  #define MDMPWRON  p33
-  #define MDMTXD    p9
-  #define MDMRXD    p10
-  #define MDMCTS    NC
-  #define MDMRTS    NC
-  #define MDMBAUD   115200
-#else
+#else 
   #define GPSSCL    D15
   #define GPSSDA    D14
   #define GPSADR   (66<<1) // GPS I2C Address
@@ -64,6 +54,7 @@
   #define MDMBAUD   115200
 #endif
 
+//----------------------------------------------------------------------
 // no tracing if serial is shared with the VCP
 #define DOTRACE ((USBRX!=MDMRXD)&&(USBTX!=MDMTXD))
 #define TRACE     (!DOTRACE)?:printf