diff --git a/demos/oc_mqtt_demo/oc_mqtt_v5_demo.c b/demos/oc_mqtt_demo/oc_mqtt_v5_demo.c index 2475ed2bd..9be9d8919 100644 --- a/demos/oc_mqtt_demo/oc_mqtt_v5_demo.c +++ b/demos/oc_mqtt_demo/oc_mqtt_v5_demo.c @@ -336,7 +336,7 @@ static int task_reportmsg_entry(void *args) connect_para.boostrap = CN_BOOT_MODE; connect_para.device_id = CN_EP_DEVICEID; - connect_para.device_passwd = NULL; + connect_para.device_passwd = CN_EP_PASSWD; connect_para.server_addr = CN_SERVER_IPV4; connect_para.sevver_port = CN_SERVER_PORT; connect_para.life_time = CN_LIFE_TIME; diff --git a/iot_link/network/tcpip/esp8266_socket/esp8266_socket_imp.c b/iot_link/network/tcpip/esp8266_socket/esp8266_socket_imp.c index a8afed9c0..82db5429b 100644 --- a/iot_link/network/tcpip/esp8266_socket/esp8266_socket_imp.c +++ b/iot_link/network/tcpip/esp8266_socket/esp8266_socket_imp.c @@ -564,6 +564,7 @@ int link_tcpip_imp_init(void) at_oobregister("esp8266rcv",CN_ESP8266_RCVINDEX,strlen(CN_ESP8266_RCVINDEX),esp8266_rcvdeal,NULL); ring_buffer_init(&s_esp8266_sock_cb.esp8266_rcvring,s_esp8266_sock_cb.esp8266_rcvbuf,CN_ESP8266_CACHELEN,0,0); + osal_task_sleep(1000); esp8266_reset(); esp8266_echo_off(); @@ -573,7 +574,13 @@ int link_tcpip_imp_init(void) while(false == esp8266_joinap(WIFI_SSID, WIFI_PASSWD)) { - LINK_LOG_DEBUG("connect ap failed, repeat...\r\n"); + osal_task_sleep(1000); + esp8266_reset(); + esp8266_echo_off(); + esp8266_show_dinfo(0); + esp8266_set_mode(STA); + esp8266_set_mux(0); + LINK_LOG_DEBUG("connect ap failed, retry..\r\n"); } //reach here means everything is ok, we can go now ret = link_sal_install(&s_tcpip_socket); diff --git a/targets/GD32F303_BearPi/BearPi_IoT_GD.CFG b/targets/GD32F303_BearPi/BearPi_IoT_GD.CFG new file mode 100644 index 000000000..e7c7b0f4e --- /dev/null +++ b/targets/GD32F303_BearPi/BearPi_IoT_GD.CFG @@ -0,0 +1,3 @@ +interface cmsis-dap +transport select swd +source [find target/stm32f3x.cfg] \ No newline at end of file diff --git a/targets/GD32F303_BearPi/GCC/config.mk b/targets/GD32F303_BearPi/GCC/config.mk index f9bfa6552..93fe47eae 100644 --- a/targets/GD32F303_BearPi/GCC/config.mk +++ b/targets/GD32F303_BearPi/GCC/config.mk @@ -75,9 +75,10 @@ CONFIG_AT_ENABLE := y ########################INDEPENDENT SERVICE START################################# #CONFIG_CJSON_ENABLE , we port the cJSON based on the osal,you could choose yes or no -CONFIG_CJSON_ENABLE := n +CONFIG_CJSON_ENABLE := y ########################INDEPENDENT SERVICE END################################# +CONFIG_LOG_ENABLE := y ########################NETWORK SERVICE START################################### @@ -93,13 +94,13 @@ CONFIG_TCPIP_TYPE := "esp8266_socket" #CONFIG_DTLS_ENABLE , we supply a DTLS AL (building),you could choose yes or no #CONFIG_DTLS_TYPE, could be "mbeddtls_psk" "mbedtls_cert" "none" -CONFIG_DTLS_ENABLE := n -CONFIG_DTLS_TYPE := "mbedtls_psk" +CONFIG_DTLS_ENABLE := y +CONFIG_DTLS_TYPE := "mbedtls_cert" #CONFIG_MQTT_ENABLE, we build a mqtt abstraction, which shield the difference of #the implement of mqtt. #CONFIG_MQTT_TYPE could be "paho_mqtt" "none" -CONFIG_MQTT_ENABLE := n +CONFIG_MQTT_ENABLE := y CONFIG_MQTT_TYPE := "paho_mqtt" #CONFIG_LWM2M_ENABLE, we build a lwm2m abstraction, which shield the difference of @@ -111,7 +112,7 @@ CONFIG_LWM2M_TYPE := "wakaama_lwm2m" #CONFIG_COAP_ENABLE, we build a coap abstraction, which shield the difference of #the implement of coap. #CONFIG_COAP_TYPE could be "lite_coap" "none" -CONFIG_COAP_ENABLE := y +CONFIG_COAP_ENABLE := n CONFIG_COAP_TYPE := "lite_coap" ########################NETWORK SERVICE END##################################### @@ -120,7 +121,7 @@ CONFIG_COAP_TYPE := "lite_coap" #CONFIG_OC_COAP_ENABLE, we build a oc coap abstraction for huawei OceanConnect service, #which shield the difference of the implement of oc coap. #CONFIG_OC_MQTT_TYPE could be "soft" "none" -CONFIG_OC_COAP_ENABLE := y +CONFIG_OC_COAP_ENABLE := n CONFIG_OC_COAP_TYPE := "soft" #CONFIG_OC_MQTT_ENABLE, we build a oc mqtt abstraction for huawei OceanConnect service, @@ -129,10 +130,10 @@ CONFIG_OC_COAP_TYPE := "soft" #CONFIG_OC_MQTT_VERSION could be "V5" "V1",use this to select the used interface #CONFIG_OCMQTT_DEMO_ENABLE could be y or n, use this to enable the oc mqtt demo #CONFIG_OCMQTT_DEMO_BSENABLE could be y or n, use this to enable the bootstrap or not -CONFIG_OC_MQTT_ENABLE := n +CONFIG_OC_MQTT_ENABLE := y CONFIG_OC_MQTT_TYPE := "soft" -CONFIG_OC_MQTT_VERSION := "V1" -CONFIG_OC_MQTTDEMO_ENABLE := n +CONFIG_OC_MQTT_VERSION := "V5" +CONFIG_OC_MQTTDEMO_ENABLE := y CONFIG_OC_MQTTDEMO_BSENABLE := y @@ -169,7 +170,7 @@ CONFIG_PCP_ENABLE := n #"oc_lwm2m_bs_demo" "oc_lwm2m_demo" "oc_lwm2m_ota_demo" "stimer_demo" CONFIG_DEMO_ENABLE := y -CONFIG_DEMO_TYPE := "oc_coap_demo" +CONFIG_DEMO_TYPE := "" #########################STANDARD DEMO END###################################### include $(TOP_DIR)/iot_link/iot.mk diff --git a/targets/GD32F303_BearPi/Src/main.c b/targets/GD32F303_BearPi/Src/main.c index 1f0212c7d..22f87fbc7 100644 --- a/targets/GD32F303_BearPi/Src/main.c +++ b/targets/GD32F303_BearPi/Src/main.c @@ -109,7 +109,7 @@ static int link_test() int main(void) { - UINT32 uwRet = LOS_OK; + UINT32 uwRet; HardWare_Init(); @@ -126,4 +126,5 @@ int main(void) LOS_Start(); + return uwRet; } diff --git a/targets/GD32F303_BearPi/uart_at/uart_at.c b/targets/GD32F303_BearPi/uart_at/uart_at.c index 94c89aa67..49e365993 100644 --- a/targets/GD32F303_BearPi/uart_at/uart_at.c +++ b/targets/GD32F303_BearPi/uart_at/uart_at.c @@ -34,6 +34,7 @@ #include "gd32f30x.h" #include "BearPi-IoT_gd32f303.h" +#include #include #include #include