I manage to run ppp to connect GPRS using GSM modem Dail *99# and its working at least kinda But problem is It send USART AT command and modem return CONNECT I debug it using logic analyzer up to this stage after that RTE send a data packet and provider keep sending me data packets then suddenly the GSM modem return NO CARRIER and PPP_is_up never goes true GSM modem is SIM900 and MCU is STM32F107RCT6 MDK5.01 will try to UPDATE it to MDK 5. Code I user is like this
int main (void) { uint64_t PPP_timeout_counter=0; //osDelay(1000); net_initialize (); GPIO_PortClock(GPIOB,ENABLE); GPIO_PinConfigure(GPIOB,9,GPIO_OUT_PUSH_PULL,GPIO_MODE_OUT50MHZ); GPIO_PinConfigure(GPIOB,0,GPIO_OUT_PUSH_PULL,GPIO_MODE_OUT50MHZ); osDelay(100000); while(1) { net_main ();
GPIO_PinWrite(GPIOB,9,1);
osDelay(10000); GPIO_PinWrite(GPIOB,9,0);
osDelay(10000); //osDelay(5); //GPIO_PinWrite(GPIOB,9,0);
if (ppp_is_up()) { osDelay(100); GPIO_PinWrite(GPIOB,9,1); osDelay(100); GPIO_PinWrite(GPIOB,9,0);
} else { ppp_connect("*99***1#","",""); PPP_timeout_counter=0; while(!ppp_is_up()&&PPP_timeout_counter<PPP_TO) { PPP_timeout_counter++;// to time out wait for PPP to connect osDelay(PPP_TD); } osDelay(100); GPIO_PinWrite(GPIOB,9,1); osDelay(100); GPIO_PinWrite(GPIOB,9,0); osDelay(100); GPIO_PinWrite(GPIOB,9,1); osDelay(100); GPIO_PinWrite(GPIOB,9,0); osDelay(100); GPIO_PinWrite(GPIOB,9,1); osDelay(100); GPIO_PinWrite(GPIOB,9,0); }
if (ppp_is_up() && tcp_get_state(socket1)!=tcpStateESTABLISHED) { GPIO_PinWrite(GPIOB,0,1); socket1=tcp_get_socket(TCP_TYPE_CLIENT,0,5,tcp_callback1); if(socket1!=NULL) { } tcp_connect(socket1,IPDest,81,0);
} if(tcp_get_state(socket1)==tcpStateESTABLISHED) { uint8_t *sendbuf; strcpy((char *)sendbuf,"test\0"); tcp_send(socket1,sendbuf,4); osDelay(1000); tcp_close(socket1); osDelay(100); ppp_close(); GPIO_PinWrite(GPIOB,0,1); osDelay(10000); }
osThreadYield (); }
}
Yet another thing is after MODEM send NO CARRIER Program stop executing after a while or at least it seam to
First of all thanks for replaying to me so fast and for sure I know that its forum not a support section I'm not looking for support eater I looking for experience of people and sending something like still no hope or is there any one to help me is just to keep the post up so someone with higher experience my see that it have good feeling that someone at least replay to question even if it's not the answer And something else if you face a problem and if you want to know if it's you or the problem is really there is what I try to do to document this problem here to someone like me don’t face same feeling and still no hope to solve this problem
hellooooO any one any Idea