Wi-Fi Combo Forum Discussions
text.format{('custom.tabs.no.results')}
Ported WICED 3.5.2 to work with STM32F412 and attempting to integrate the Murata 1DX module wifi functionality over SDIO (as in the BCM94343WWCD1 devkit)
Currently wifi init is failing at 'waiting for high throughput clock'. Appears SDIO comm is working, but the 1DX part is not behaving, so we're thinking there's got to be a firmware file we're missing.
If WICED 3.5.2 does not include the correct image for 1DX part, looking for the correct firmware/nvram. In addition, are there any chip specific interface changes that need to be made to WICED?
Previous discussion (Wifi high throughput clock not starting ) mentions changing WWD thread startup, but this is done after firmware download on WICED 3.5.2
Thanks!
Show LessHello,
For the ble_wifi_introducer IOS app, how can we upload this app to an ipad or iphone. As far as I know, one has to pay an amount and be a licensed developer to publish an app to the Apple Store.
Has anybody already published the App in the Apple Store?
Thanks
rifo
Show LessI have a device that I want to be a ble central. I am not able to get connected to a ble device.
In wiced_bt_cfg_settings, I am using security settings BTM_SEC_NONE .
I have called wiced_bt_stack_init()
My p_bt_management_cback callback receives BTM_ENABLED_EVT with p_event_data->enabled.status == WICED_BT_SUCCESS
I call :
wiced_bt_gatt_register( gtwy_gatts_callback );
wiced_bt_ble_scan( BTM_BLE_SCAN_TYPE_HIGH_DUTY, WICED_FALSE, ble_gtwy_client_scan_results_callback );
In my scan_results callback, I identify the bd_addr which matches my device (p_scan_result->remote_bd_addr) and save the address.
I make the following call, with the correct address.
result = wiced_bt_gatt_le_connect( matched_bd_addr, BLE_ADDR_PUBLIC, BLE_CONN_MODE_HIGH_DUTY, WICED_TRUE);
I was expecting that after this call, my central would connect to the device and that gtwy_gatts_callback() would get called with
event == GATT_CONNECTION_STATUS_EVT.
Instead, I never see gtwy_gatts_callback() called. If I watch with a ble sniffer, I never see CONNECT_REQ sent from the my central device.
Am I missing a step? or does anyone have any idea about what might be the problem?
thanks.
Show LessHi,
Using Wiced SDK 4.0, I am having some issues with SoftAP Mode. This problem also happens with 3.5.x.
I am setting up a SoftAP, and then opening up a UDP socket. I'm then registering a callback function using wiced_udp_register_callbacks to process any received UDP packets (essentially just print out a counter).
I am connecting to the SoftAP from 4 different linux clients and sending UDP packets to the SoftAP. It works for 5 or so minutes, but then something happens and the WICED stack hangs and does not recover without a reset.
Any ideas?
Here is the code I am using. I've been messing with it all day, trying different things, so it's a hacked together mess at this point. Essentially it just waits for udp packets to arrive, prints info from the packet as well as where the packet came from, then echoes the packet back.
Notes:
- The system is more stable if I send packets less often. Right now I am sending a 16 byte packet every 5 ms. After about a minute, the system chokes up and the network goes down. I lose my connection and can no longer transmit or receive (tx fails saying it can't allocate space for a packet).
- Before the system goes down, it's dropping a bunch of packets, like it can't keep up
- If the system can't keep up, there's no reason it should hang up. It should just throw away packets if the queue is full.
- I've tried disabing the watchdog, with the idea that it's not being pet often enough. Problem persists.
#include "wiced.h"
#include "resources.h"
/******************************************************
* Macros
******************************************************/
/******************************************************
* Constants
******************************************************/
#define MAX_SOFT_AP_CLIENTS (5)
/******************************************************
* Enumerations
******************************************************/
/******************************************************
* Type Definitions
******************************************************/
/******************************************************
* Structures
******************************************************/
typedef struct
{
int count;
wiced_mac_t mac_list[MAX_SOFT_AP_CLIENTS];
} client_info_t;
/******************************************************
* Static Function Declarations
******************************************************/
/******************************************************
* Variable Definitions
******************************************************/
static const wiced_ip_setting_t ap_ip_settings =
{
INITIALISER_IPV4_ADDRESS( .ip_address, MAKE_IPV4_ADDRESS( 192,168, 0, 1 ) ),
INITIALISER_IPV4_ADDRESS( .netmask, MAKE_IPV4_ADDRESS( 255,255,255, 0 ) ),
INITIALISER_IPV4_ADDRESS( .gateway, MAKE_IPV4_ADDRESS( 192,168, 0, 1 ) ),
};
static wiced_timed_event_t process_udp_rx_event;
static wiced_timed_event_t process_udp_tx_event;
static wiced_udp_socket_t udp_socket;
static uint32_t tx_count = 1;
static uint32_t numClients = 0;
typedef struct rx_stats
{
wiced_ip_address_t src_ip;
uint32_t rx_count;
uint32_t rx_count_last_second;
uint32_t rx_count_last_second_latched;
wiced_time_t lastReportTime;
}rx_stats;
#define MAX_CLIENTS 8
static rx_stats rxStats[MAX_CLIENTS];
void initRxStats()
{
for( int i = 0; i < MAX_CLIENTS; i++ )
{
memset( &rxStats, 0, sizeof(rx_stats) );
}
}
int getIpIndex( wiced_ip_address_t ip )
{
for( int i = 0; i < MAX_CLIENTS; i++ )
{
if( memcmp( &rxStats.src_ip, &ip, sizeof(wiced_ip_address_t)) == 0 )
{
return i;
}
}
return -1;
}
int addIp( wiced_ip_address_t ip )
{
memcpy( &rxStats[numClients].src_ip, &ip, sizeof(wiced_ip_address_t) );
return numClients++;
}
static wiced_result_t send_udp_response (char* buffer, uint16_t buffer_length, wiced_ip_address_t ip_addr, uint32_t port)
{
wiced_packet_t* packet;
char* tx_data;
uint16_t available_data_length;
const wiced_ip_address_t INITIALISER_IPV4_ADDRESS( target_ip_addr, GET_IPV4_ADDRESS(ip_addr) );
/* Create the UDP packet. Memory for the TX data is automatically allocated */
if ( wiced_packet_create_udp( &udp_socket, buffer_length, &packet, (uint8_t**) &tx_data, &available_data_length ) != WICED_SUCCESS )
{
printf("Available data length: %d\n", available_data_length);
WPRINT_APP_INFO( ("UDP tx packet creation failed\n") );
return WICED_ERROR;
}
printf("Available data length: %d\n", available_data_length);
/* Copy buffer into tx_data which is located inside the UDP packet */
memcpy( tx_data, buffer, buffer_length + 1 );
/* Set the end of the data portion of the packet */
wiced_packet_set_data_end( packet, (uint8_t*) tx_data + buffer_length );
/* Send the UDP packet */
if ( wiced_udp_send( &udp_socket, &target_ip_addr, port, packet ) != WICED_SUCCESS )
{
WPRINT_APP_INFO( ("UDP packet send failed\n") );
/* Delete packet, since the send failed */
wiced_packet_delete( packet );
}
/*
* NOTE : It is not necessary to delete the packet created above, the packet
* will be automatically deleted *AFTER* it has been successfully sent
*/
return WICED_SUCCESS;
}
void process_received_udp_packet( wiced_thread_arg_t arg )
{
char* rx_data;
static uint16_t rx_data_length;
uint16_t available_data_length;
static wiced_ip_address_t udp_src_ip_addr;
static uint16_t udp_src_port;
while(1)
{
wiced_packet_t* packet;
/* Wait for UDP packet */
wiced_result_t result = wiced_udp_receive( &udp_socket, &packet, WICED_NEVER_TIMEOUT );
if ( ( result == WICED_ERROR ) || ( result == WICED_TIMEOUT ) )
{
continue;
}
wiced_time_t time;
wiced_time_get_time(&time);
//printf("(%d)RX Packet\n", time);
/* Get info about the received UDP packet */
wiced_udp_packet_get_info( packet, &udp_src_ip_addr, &udp_src_port );
int rxStatsIndex = getIpIndex(udp_src_ip_addr);
if( rxStatsIndex < 0 )
{
rxStatsIndex = addIp(udp_src_ip_addr);
}
/* Extract the received data from the UDP packet */
wiced_packet_get_data( packet, 0, (uint8_t**) &rx_data, &rx_data_length, &available_data_length );
wiced_time_t currentTime = 0;
wiced_time_get_time(¤tTime);
rxStats[rxStatsIndex].rx_count_last_second++;
rxStats[rxStatsIndex].rx_count++;
uint32_t sentCount = 0;
memcpy( &sentCount, rx_data, sizeof(sentCount) );
if( currentTime - rxStats[rxStatsIndex].lastReportTime > 1000 )
{
WPRINT_APP_INFO ( ("(%d)UDP Rx(%u.%u.%u.%u): \"%lu\" nRx: %d (%d) nRx Last Sec: %d\n",
time,
(unsigned char) ( ( udp_src_ip_addr.ip.v4 >> 24 ) & 0xff ),
(unsigned char) ( ( udp_src_ip_addr.ip.v4 >> 16 ) & 0xff ),
(unsigned char) ( ( udp_src_ip_addr.ip.v4 >> 8 ) & 0xff ),
(unsigned char) ( ( udp_src_ip_addr.ip.v4 >> 0 ) & 0xff ),
sentCount, rxStats[rxStatsIndex].rx_count,
(rxStats[rxStatsIndex].rx_count - sentCount),rxStats[rxStatsIndex].rx_count_last_second_latched));
rxStats[rxStatsIndex].rx_count_last_second_latched = rxStats[rxStatsIndex].rx_count_last_second;
rxStats[rxStatsIndex].rx_count_last_second = 0;
rxStats[rxStatsIndex].lastReportTime = currentTime;
}
wiced_packet_delete( packet );
uint32_t respPort = 0;
memcpy( &respPort, &rx_data[4], 4 );
/* Echo the received data to the sender */
send_udp_response( rx_data, rx_data_length, udp_src_ip_addr, respPort );
}
}
static int numConnections = 0;
wiced_thread_t rxThread;
/******************************************************
* Function Definitions
******************************************************/
void application_start(void)
{
int32_t rssi = 0;
int client_number = 0;
wiced_result_t result;
client_info_t client_info;
client_info.count = MAX_SOFT_AP_CLIENTS;
/* Initialise Wiced system */
wiced_init();
/* Bring up the softAP interface */
wiced_network_up( WICED_AP_INTERFACE, WICED_USE_INTERNAL_DHCP_SERVER, &ap_ip_settings );
/* Create UDP socket */
if (wiced_udp_create_socket(&udp_socket, 1234, WICED_AP_INTERFACE) != WICED_SUCCESS)
{
WPRINT_APP_INFO( ("UDP socket creation failed\n") );
}
wiced_rtos_create_thread( &rxThread, WICED_NETWORK_WORKER_PRIORITY, "rx thread", &process_received_udp_packet, 8000, NULL );
//wiced_udp_register_callbacks( &udp_socket, &process_received_udp_packet, NULL );
int loopCount = 0;
while ( 1 )
{
if( !wiced_network_is_up( WICED_AP_INTERFACE ) )
{
printf("Network is down\n");
}
printf("Still alive!\n");
loopCount++;
/* Sleep for a second and do it again */
//WPRINT_APP_INFO( ("Waiting for an update...\r\n\r\n") );
wiced_rtos_delay_milliseconds( 1000 );
}
}
Message was edited by: Nick Crast Adding code sample
Show LessHello,
I am basically unable to run this demo entirely:
- Clearing the DCT by holding down the button does not seem effective: I can still see most of the time the default “WICED_AWS” AP with security and sometimes I see a “Wiced Config” AP with open security. I guess the later one should be the default option, ie empty DCT.
- I am often seeing the issue where the network interface fails to mount properly, code ends up in an infinite loop :
else if ( config == WICED_USE_INTERNAL_DHCP_SERVER )
{
/* Create the DHCP Server. */
while ( IP_HANDLE(interface).nx_ip_driver_link_up == NX_FALSE ) // This case happens after p2p moves from group negotiation to starting the group owner
{
host_rtos_delay_milliseconds(10);
}
- Even if I can "sometimes" pass above issues, the scan request triggered from the provisioning webpage is never returning and the software is blocked waiting for a mutex.
I am using platform 3.7.0-3 which is the last one as far as I can tell.
Can someone confirm above issues? Do you know if a fix is available?
I hope this is the right place 🙂
Thanks.
Show LessPlatform: BCM94343W (Avnet EVB, SPIL N08 & our board)
SDK version : 4.0
Network : NetX
Symptoms : (two possibilities)
case 1 : "wiced_tcp_socket_callback_t disconnect_callback" registered by "wiced_tcp_register_callbacks" is called by network stack unexpectedly (may be after hours).
case 2 : semaphore is not got after publish
Reproduction :
build & download the modified version of snip.secure_mqtt in attached file.
without "GLOBAL_DEFINES += OTHER_SERVER" (this will use default server test.mosquitto.org), case 2 typically arises within minutes.
with "GLOBAL_DEFINES += OTHER_SERVER" (this will use server mqtt.sesamelab.co), case 1 typically arises after hours.
Modifications compared to original:
## modifications to original snip.secure_mqtt, only used in secure_mqtt.c
# connection-related
GLOBAL_DEFINES += OTHER_SERVER
GLOBAL_DEFINES += DONT_USE_TLS
# distinguish devices under testing
GLOBAL_DEFINES += USE_GENERATED_MAC
GLOBAL_DEFINES += MAC_AS_UNIQUE_STRING
# for testing
GLOBAL_DEFINES += PUBLISH_FOREVER
GLOBAL_DEFINES += CLEAR_MQTT_OBJECT_BEFORE_USE
GLOBAL_DEFINES += RETRY_WIFI_FOREVER
GLOBAL_DEFINES += REBOOT_ON_ERROR
GLOBAL_DEFINES += CHECK_ZERO_PKTID_WITH_WRAP_AROUND
GLOBAL_DEFINES += PRINT_PUBLISH_ERROR
GLOBAL_DEFINES += SUBSCRIBE_QOS=1
GLOBAL_DEFINES += PUBLISH_QOS=1
Note:
(1) Please modify generated_mac_address.txt if you're testing with multiple WICED devices so they won't collide.
(2) toggle "GLOBAL_DEFINES += OTHER_SERVER" in .mk file to switch between MQTT brokers. mqtt.sesamelab.co is a (mosquitto) MQTT broker hosted on AWS dedicated for this test so it should be quite fast.
(3) similar symptoms are seen when choosing QOS=2. yet another failure will be seen when choosing QOS=0
(4) with mosquitto_sub you can also monitor messages sent from WICED devices.
(5) similar symptoms are also seen in SDK 3.5.2, 3.6.3, 3.7.0, 3.7.0-3 and network NetX Duo. but currently we primarily work on 4.0.
Show LessHello,
I am quite new to encryption. I have a block of 100 bytes and want to send it to a server. I thought of using "aes_encrypt_ccm" function. Are there any examples that I can refer to?
Thank you
rifo
Show LessPrevious WICED versions were available as either an "IDE installer" or as a plain 7z file that just had the sources in. The latter is much more useful to us, but the only 4.0.1 releases I can find are "IDE installers". Is 4.0.1 also available in a just-the-sources form?
Peter
Show LessWICED SDK 3.7.0-7 IDE Installer
WICED SDK 3.7.0-7 .7z Source files
Changes for WICED-SDK 3.7.0-7
* Libraries, Protocols, Drivers
* Homekit
* BLE tunneling - Resolved issue with HTTP disconnection handling
Changes for WICED-SDK 3.7.0-6
* Libraries, Protocols, Drivers
* Homekit
* BLE tunneling - Added support to dynamically configure GATT MTU for better interoperability
Changes for WICED-SDK 3.7.0-5
* Applications
* OTA2 stability fixes
* Updated service discovery snippet app to demonstrate mDNS service discovery
* Libraries, Protocols, Drivers
* Homekit
* Stability fixes to BLE tunneling
* WAC improvements
* Resolved self-certification failures related to TLV error codes
* Resolved memory leaks with BESL and HTTP libraries
* Resolved issues associated with multiple connections/data transfer with DTLS server
If the radio firmware is updated, maybe from a SDK update, how does OTA process handle getting the new bin file updated in the radio? e.g. 4343WA1.bin in the resources/firmware directory.
Note: I'm not asking about the stripped elf file containing the application code. OTA handles that.
Show Less