Skip to content

Commit 27fa717

Browse files
committed
Simcom800: change APN setting for IoT SIM Card of China Mobile
1 parent 7b80963 commit 27fa717

File tree

2 files changed

+8
-3
lines changed
  • applications/juma/sim800
  • system/middlewares/juma/simcom

2 files changed

+8
-3
lines changed

applications/juma/sim800/app.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ void on_ready(void)
4343
if(SUCCESS == sim800_init()){
4444

4545
// Test to make a phone call
46-
printf("\r\nTest to make a phone call\r\n");
47-
sim800_test_phone_call("18621797323");
46+
//printf("\r\nTest to make a phone call\r\n");
47+
//sim800_test_phone_call("18621797323");
4848

4949
// Test HTTP post JSON data
5050
printf("\r\nTest HTTP post JSON data\r\n");

system/middlewares/juma/simcom/sim800.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,15 @@ static int sim800_setup(){
104104
if(ERROR == send_AT_cmd("AT+SAPBR=3,1,\"Contype\",\"GPRS\"\r\n", "OK", AT_CMD_TIMEOUT))
105105
return ERROR;
106106

107+
#if 1 /* APN Setting for IOT SIM Card of CHINA MOBILE */
108+
if(ERROR == send_AT_cmd("AT+SAPBR=3,1,\"APN\",\"CMIOT\"\r\n", "OK", AT_CMD_TIMEOUT))
109+
return ERROR;
110+
#else /* Normal SIM Card */
107111
if(ERROR == send_AT_cmd("AT+SAPBR=3,1,\"APN\",\"CMNET\"\r\n", "OK", AT_CMD_TIMEOUT))
108112
return ERROR;
113+
#endif
109114

110-
if(ERROR == send_AT_cmd("AT+SAPBR=1,1\r\n", "OK", 1000)){
115+
if(ERROR == send_AT_cmd("AT+SAPBR=1,1\r\n", "OK", 3000)){
111116

112117
//ERROR, maybe it's because that it's already be opened, let's check:
113118
if(ERROR == send_AT_cmd("AT+SAPBR=2,1\r\n", "+SAPBR: 1,1", 2000))

0 commit comments

Comments
 (0)