Wi-Fi Combo Forum Discussions
Hi ,
I am using cyw43438 to develop on wiced,now I want to transfer and receive some data over sdio,
which api can I use?
At wwd_thread_func() function,I found below api:
wwd_thread_receive_one_packet()
wwd_thread_send_one_packet();
Can I use above api to transfer and receive some data?
BR,
Leo
Show LessIs it possible to receive HTTP / POST communication in AP mode as in the sample program below?
please tell me.
◆example
static wiced_result_t WiFi_ap_http_receive_callback ( wiced_http_response_stream_t* stream, uint8_t** data, uint16_t* data_length )
{
・・・
}
void test()
{
wiced_result = wiced_network_up(WICED_AP_INTERFACE, WICED_USE_INTERNAL_DHCP_SERVER, &s_ap_ip_settings);
if (WICED_SUCCESS != wiced_result) {
・・・
}
wiced_result = wiced_http_server_start(&s_ap_http_server, 80, max_sockets, ap_web_pages, WICED_AP_INTERFACE, DEFAULT_URL_PROCESSOR_STACK_SIZE);
if (WICED_SUCCESS != wiced_result) {
・・・
}
wiced_result = wiced_http_server_register_callbacks(&s_ap_http_server, WiFi_ap_http_receive_callback, NULL);
if(WICED_SUCCESS != wiced_result) {
・・・
}
・・・
}
<Japanese>
HTTP APモードにおける、POST通信の受信について
以下のサンプルプログラムのように、APモードで、HTTP・POST通信の受信は可能でしょうか。
教えてください。
Show LessWe have a customer whose product is based on a BCM4390 Wi-Fi SoC running WICED 3.1.2. They are setting the country code to WICED_COUNTRY_WORLD_WIDE_XX, and shipping units to the United States. They have questions about meeting regulatory requirements in the United States.
According to their testing, the find that with this country code, they are able to join Access points advertising on channels 12 and 13. Will that behaviour invalidate certification in the United States for their product?
Also, what is the maximum output power of this SoC when transmitting data?
Thanks and regards,
Peter Hunt
Show LessI have tried aws.iot.shadow.thing example of WICED 6.4 on Murata Type1LD EVB. The Make Target is this:
demo.aws.iot.shadow.thing_shadow-MurataType1LD download download_apps run
Type1LD is CYW43438+STM32F4.
After configuring the device via web browser Chrome, it automatically reboots and tries to connect with AWS, but wiced_aws_init() fails with 4 (WICED_ERROR) as its return value. If I use Firefox, then there is no issue and could control the status from AWS IoT Core (could turn on/off the LED).
Chrome Version 83.0.4103.61 (Official Build) (32-bit) didn't work.
Firefox 76.0.1 (64-bit) worked.
Windows 10 Pro Version 10.0.17763 Build 17763
Hope this post can help other people who are seeing the same issue and hopefully there is a way to solve this on Chrome.
The UART output when failing is like this:
Joining : MyAP
Successfully joined : MyAP
Obtaining IPv4 address via DHCP
L1420 : dhcp_client_init() : DHCP CLIENT hostname = [WICED IP]
IPv4 network ready IP: 10.0.0.251
Setting IPv6 link-local address
IPv6 network ready IP: FE80:0000:0000:0000:029D:6BFF:FE59:D7AC
[Shadow] Reading Device's certificate and private key from DCT...
[Shadow] Failed to Initialize Wiced AWS library
Show Less客户用的CYW43438 COB,请问在产线如何将WIFI/BT的MAC地址烧写到CYW43438的OTP。
i Team,
I would like to try X509 security method MQTT over wiced studio for Murata type 1LD module.
Regular SAS token method is working with link MQTT with Microsoft Azure
The credentials are validated with PC application "MQTT Explorer". X509 does'nt required CA Root file from client side. Only Client Cert and Key.
Also username is must and password is not required.
I have tried following changes. But, not connecting to server .
Tried Wiced version 6.4 as well. The code stuck at Opening connection. ....
Please help.
Thanks and Regards
Sreejith KK
Show LessI defined a structure within our application DCT and increased DCT size accordingly.
There are no write commands for the application DCT area.
I added multiple lock/read/print/unlock cycles to make it is not an unlock
Problem:
- the DCT contents are loaded correctly when I load the code via JTAG but some parts are changed after a reset.
- the changed values are always changed to the same values,which points to another part of the code overwriting application DCT
- we have code that writes to DCT_WIFI_CONFIG_SECTION to update wifi credentials
Questions:
- are there any other changes needed besides updating dct.ld? Based on where the the overwrite is happening, it s past the old DCT.
- read_lock / read_unlock should not change the contents, right?
dct.ld increased from 16k to 64k:
MEMORY
{
/* DCT1_FLASH (rx) : ORIGIN = 0x0, LENGTH = 16K */
DCT1_FLASH (rx) : ORIGIN = 0x0, LENGTH = 64K
}
application_dct.h (some names are obscured)
#define DCT_SCHEMA_VERSION 1
#define DCT_CONFIG_FILE_SIZE (20*1024)
#define DCT_WIFI_FILE_SIZE (2*1024)
pragma pack (1)
typedef struct
{
//overall content
uint32_t schemaVersion; // BUILD
uint32_t dummyTop[7]; // FFS
// configuration.json
uint32_t configJsonSize; // redundant size of string
uint32_t dummyConfigJson[7]; // FFS
char configJsonStr[DCT_CONFIG_FILE_SIZE]; // BUILD
// wifi.json
uint32_t wifiJsonSize; // redundant size of string
uint32_t dummyWifiJson[7]; // FFS
char wifiJsonStr[DCT_WIFI_FILE_SIZE]; // BUILD
} ...Dct_t;
#pragma pack ()
} ...Dct_t;
#pragma pack ()
application_dct.c
DEFINE_APP_DCT(...Dct_t)
{
.schemaVersion = DCT_SCHEMA_VERSION,
.dummyTop = {0,1,2,3,4,5,6},
.configJsonSize = 6,
.dummyConfigJson = {0,7,8,9,0xA,0xB,0xC},
.configJsonStr = "config",
.wifiJsonSize = 4,
.dummyWifiJson = {0,0xD,0xE,0xF,1,2,3},
.wifiJsonStr = "wifi"
};
application
...Dct_t *...Dct=NULL;
during startup,the application runs the following code three times
// First check DCT to see if it has a valid file
wResult = wiced_dct_read_lock( (void**) &...Dct, WICED_TRUE, DCT_APP_SECTION, 0, sizeof( ...Dct_t ) );
if ( wResult == WICED_SUCCESS)
{
WPRINT_APP_DEBUG( ( "APP DCT\n" ) );
WPRINT_APP_DEBUG( ( " schemaVersion : %lu\n",datablizzard2Dct->schemaVersion ) );
DEBUG_HEX_DUMP ( " dummyTop :",datablizzard2Dct->dummyTop,7);
WPRINT_APP_DEBUG( ( " configJsonSize : %lu\n",datablizzard2Dct->configJsonSize ) );
DEBUG_HEX_DUMP ( " dummyConfigJson :",datablizzard2Dct->dummyConfigJson,7);
WPRINT_APP_DEBUG( ( " configJsonStr : %.10s\n",datablizzard2Dct->configJsonStr ) );
WPRINT_APP_DEBUG( ( " wifiJsonSize : %lu\n",datablizzard2Dct->wifiJsonSize ) );
DEBUG_HEX_DUMP ( " dummyWifiJson :",datablizzard2Dct->dummyWifiJson,7);
WPRINT_APP_DEBUG( ( " wifiJsonStr : %.10s\n",datablizzard2Dct->wifiJsonStr ) );
// done with DCT, close it
wResult = wiced_dct_read_unlock( ...Dct, WICED_TRUE );
if ( wResult != WICED_SUCCESS)
{
WPRINT_APP_ERROR( ( "%s wiced_dct_read_unlock failed: %u\n", __FUNCTION__, wResult) );
}
else
{
WPRINT_APP_DEBUG( ( "%s wiced_dct_read_unlock done\n", __FUNCTION__) );
}
}
the attached log file shows the correct DCT being printed 3 times.
then following a reset, some of the values are changed.
Show LessIn data transmission-reception using WIFI, the interface is declared as follows:
wiced_interface_t interface;
and used as follows:
result = wiced_network_up_default( &interface, &device_init_ip_settings );
However, upon seeing the declaration, we find the following:
typedef enum
{
WICED_STA_INTERFACE = WWD_STA_INTERFACE, /**< STA or Client Interface */
WICED_AP_INTERFACE = WWD_AP_INTERFACE, /**< softAP Interface */
WICED_P2P_INTERFACE = WWD_P2P_INTERFACE, /**< P2P Interface */
WICED_ETHERNET_INTERFACE = WWD_ETHERNET_INTERFACE, /**< Ethernet Interface */
WICED_INTERFACE_MAX, /** DO NOT USE - MUST BE AFTER ALL NORMAL INTERFACES - used for counting interfaces */
WICED_CONFIG_INTERFACE = WICED_AP_INTERFACE | (1 << 7), /**< config softAP Interface */
} wiced_interface_t;
So how do I change my WIFI module as a station? Just by changing WICED_CONFIG_INTERFACE = WICED_STA_INTERFACE | (1 << 7)?
I could not understand the variable "interface" declaration and value assignment.
References:
- udp_transmit
- udp_receive
- wiced_constants.h
I have a WiFi connection by WPS, and I have acquired the SSID and password with the WPS function "wiced_wps_enrollee", but when I repeat the WiFi connection ⇒ disconnection, the WPS function "wiced_wps_enrollee" becomes a permanent loop state and the process does not end The phenomenon is occurring.
# Repeat 10 times and it will stop once.
For a rough processing procedure, see "◆ Processing".
When I log the wiced_wps_enrollee function and execute it, "wiced_wps_enrollee - 03" causes an endless loop, and the part of the endless loop becomes a while loop of the "wwd_rtos.c" - "host_rtos_join_thread" function.
For confirmation by running the debugger, see the image file "snap-01.png".
I have two questions.
◆ QA
1. wiced_wps_thread_main(\WICED-Studio-6.4\43xxx_Wi-Fi\WICED\security\BESL\host\WICED\wiced_wps.c)
I think that it is waiting for the processing of the wps_enrollee_start function. Is there a way to end the processing?
▼wiced_wps_thread_main function code
WPS_INFO(("Starting WPS Enrollee\n"));
wps_enrollee_start( workspace, workspace->interface );
2. I would like to safely end the part of the endless loop, I'm considering the additional code below, is that okay?
If you have any problems, please comment.
▼ Code under consideration
wwd_result_t host_rtos_join_thread( host_thread_type_t* thread )
{
int cnt = 0; // ★additional code
if (thread == NULL || thread->tx_thread_id != TX_THREAD_ID)
{
/*
* Invalid thread pointer.
*/
return WWD_BADARG;
}
while ( ( thread->tx_thread_state != TX_COMPLETED ) && ( thread->tx_thread_state != TX_TERMINATED ) )
{
host_rtos_delay_milliseconds( 10 );
cnt++; // ★additional code.
if(12000 <= cnt) { // ★additional code. ※End after 120 seconds
break; // ★additional code.
} // ★additional code.
}
return WWD_SUCCESS;
}
◆ Processing
1. wiced_wps_enrollee: Get information
2. wifi_utils_join: Wifi connection
3. Execute SNTP time acquisition, MQTT connection, MQTT subscribe, MQTT publish, etc.
4. wwd_wifi_is_ready_to_transceive & wiced_network_down: Network disconnection
◆Log
[2020-04-23 16:12:25.211] [WIF_INF] wiced_wps_enrollee start. ... XXX(XXX)
[2020-04-23 16:12:29.224] wiced_wps_enrollee - 01
[2020-04-23 16:12:29.224] wiced_wps_enrollee - 02
[2020-04-23 16:12:29.977] wiced_wps_enrollee - 03 ★03 is a permanent loop state
◆Code with log for wiced_wps_enrollee function(\WICED-Studio-6.4\43xxx_Wi-Fi\WICED\internal\wifi.c)
wiced_result_t wiced_wps_enrollee(wiced_wps_mode_t mode, const wiced_wps_device_detail_t* details, const char* password, wiced_wps_credential_t* credentials, uint16_t credential_count)
{
wiced_result_t result = WICED_SUCCESS;
wps_agent_t* workspace = (wps_agent_t*) calloc_named("wps", 1, sizeof(wps_agent_t));
if ( workspace == NULL )
{
return WICED_OUT_OF_HEAP_SPACE;
}
WPRINT_APP_INFO(("wiced_wps_enrollee - 01 \n"));
besl_wps_init ( workspace, (besl_wps_device_detail_t*) details, WPS_ENROLLEE_AGENT, WWD_STA_INTERFACE );
WPRINT_APP_INFO(("wiced_wps_enrollee - 02 \n"));
result = (wiced_result_t) besl_wps_start( workspace, (besl_wps_mode_t) mode, password, (besl_wps_credential_t*) credentials, credential_count );
host_rtos_delay_milliseconds( 10 ); /* Delay required to allow WPS thread to run and initialize */
if ( result == WICED_SUCCESS )
{
WPRINT_APP_INFO(("wiced_wps_enrollee - 03 \n"));
besl_wps_wait_till_complete( workspace );
result = (wiced_result_t) besl_wps_get_result( workspace );
}
WPRINT_APP_INFO(("wiced_wps_enrollee - 04 \n"));
besl_wps_deinit( workspace );
free( workspace );
workspace = NULL;
return result;
}
◆Code for an endless loop(\WICED-Studio-6.4\43xxx_Wi-Fi\WICED\RTOS\ThreadX\WWD\wwd_rtos.c)
/**
* Blocks the current thread until the indicated thread is complete
*
* @param thread : handle of the thread to terminate
*
* @returns WWD_SUCCESS on success, WICED_ERROR otherwise
*/
wwd_result_t host_rtos_join_thread( host_thread_type_t* thread )
{
if (thread == NULL || thread->tx_thread_id != TX_THREAD_ID)
{
/*
* Invalid thread pointer.
*/
return WWD_BADARG;
}
while ( ( thread->tx_thread_state != TX_COMPLETED ) && ( thread->tx_thread_state != TX_TERMINATED ) ) ★This loop puts you in a waiting state forever
{
host_rtos_delay_milliseconds( 10 );
}
return WWD_SUCCESS;
}
Show Less