百度
百度
把server改為client才能獲取信號強度。
wifi模塊端無法獲取同一局域網中其他設備的ip地址和端口號呀。
看SDK Demo使用指導
看這個文檔。
進入透傳模式後,發送 +++ 三個字符退出透傳模式,發送時不能勾選換行符。
W806 SDK用的就是模擬I2C可以參考。
配網已經實現好了,不需要修改。
/*****************************************************************************
*
* File Name : main.c
*
* Description: main
*
* Copyright (c) 2014 Winner Micro Electronic Design Co., Ltd.
* All rights reserved.
*
* Author : dave
*
* Date : 2014-6-14
*****************************************************************************/
#include "wm_include.h"
static OS_STK TaskStk1[512];
static OS_STK TaskStk2[512];
static void user_task1(void)
{
while(1)
{
printf("---> %s\r\n",__func__);
tls_os_time_delay(HZ);
}
}
static void user_task2(void)
{
while(1)
{
printf("---> %s\r\n",__func__);
tls_os_time_delay(HZ);
}
}
void UserMain(void)
{
printf("\n user task \n");
tls_os_task_create(NULL, "task1",
( void (*))user_task1,
NULL,
(void *)TaskStk1, /* task's stack start address */
sizeof(TaskStk1), /* task's stack size, unit:byte */
31,
0);
tls_os_task_create(NULL, "task2",
( void (*))user_task2,
NULL,
(void *)TaskStk2, /* task's stack start address */
sizeof(TaskStk2), /* task's stack size, unit:byte */
32,
0);
#if DEMO_CONSOLE
CreateDemoTask();
#endif
//用戶自己的task
}
應該是通訊時序問題,可以用邏輯分析儀看下波形。
i2c通訊可以參考這個http://ask.winnermicro.com/question/58.html
淘寶官方店鋪有售
[W80X/W60X 離線燒錄板卡]
W801確實沒有wakeup腳,沒辦法gpio喚醒,只能定時器喚醒,可以嘗試定時器間歇性喚醒查詢gpio口的引腳狀態,來降低功耗。
printf(" ---> GetHeap:%d\n",tls_mem_get_avail_heapsize());
檢查下你新建的任務有沒有加延時函數
while(1)
{
tls_os_time_delay(HZ/1000)
}
建議用法
// 可以在網絡狀態回調函數中發送信號量
static void con_net_status_changed_event(u8 status )
{
switch(status)
{
case NETIF_WIFI_JOIN_SUCCESS:
printf("--->NETIF_WIFI_JOIN_SUCCESS\n");
break;
case NETIF_WIFI_JOIN_FAILED:
printf("--->NETIF_WIFI_JOIN_FAILED\n");
light_off(&led0);
break;
case NETIF_WIFI_DISCONNECTED:
printf("--->NETIF_WIFI_DISCONNECTED\n");
break;
case NETIF_IP_NET_UP:
{
struct tls_ethif *tmpethif = tls_netif_get_ethif();
print_ipaddr(&tmpethif->ip_addr);
#if TLS_CONFIG_IPV6
print_ipaddr(&tmpethif->ip6_addr[0]);
print_ipaddr(&tmpethif->ip6_addr[1]);
print_ipaddr(&tmpethif->ip6_addr[2]);
#endif
}
break;
default:
//printf("UNKONWN STATE:%d\n", status);
break;
}
}
void UserMain(void)
{
printf("\n user task \n");
u8 auto_reconnect = 0xff;
tls_wifi_auto_connect_flag(WIFI_AUTO_CNT_FLAG_GET, &auto_reconnect);
if(auto_reconnect != WIFI_AUTO_CNT_ON)
{
auto_reconnect = WIFI_AUTO_CNT_ON;
tls_wifi_auto_connect_flag(WIFI_AUTO_CNT_FLAG_SET, &auto_reconnect);
tls_wifi_connect((u8 *)"w600", strlen("w600"), (u8 *)"12345678", strlen("12345678"));
printf("--->WIFI_AUTO_CNT_FLAG_SET ON\n");
}
// 注冊網絡狀態回調
tls_netif_add_status_event(con_net_status_changed_event);
#if DEMO_CONSOLE
CreateDemoTask();
#endif
//用戶自己的task
}
問 MQTTBox軟件在哪裡下載?