Skip navigation
Home > All Places > WICED Studio Wi-Fi/Combo > WICED Studio Wi-Fi/Combo Forums > Blog > Authors JaeyoungY_71

<Notify/Indicate Features>

We have new notify/indicate features implemented in the BIG Smart Server that will be included in the next release. In this guide we will how you how to get notifications/indications using curl commands on Cygwin. For a basic guide of how to use the BIG RESTful Smart Server please refer to the following blog.

BIG RESTful Smart Server Demo

 

In this example, we will sign up for notifications for the heart rate value on a virtual heart rate monitor device on iOS LightBlue. This was verified in SDK 3.5.2 on BCM943341WCD1. Please download the attached patch and copy the three files over to <SDK>/libraries/daemons/bt_internet_gateway/restful_smart_server.

 

<Prerequisites>

  1. Scan for devices

          a. curl -v -X GET “http://<BIG_SERVER_ADDR>/gap/nodes?passive=1

 

          b. If you add the following options to the curl command when you scan, it will skip the redundancies and only print out unique device handles.

 

          c. curl -v -X GET "http:// <BIG_SERVER_ADDR>/gap/nodes?passive=1" 2>/dev/null | grep handle | sort -u

scan_unique.png

 

   d. You might get multiple handles if you are in a busy environment. In order to narrow down the possibility of the handles that could be the device you wish to test, try running the above (c) command without your device powered up (or deactivated in LightBlue), and do another scan with the device powered up. Then you can run the command (a) and check the RSSI value associated with the possible handles. The one with the highest signal strength should be your device if it is set close to your WICED device.

 

      **NOTE: Using a LightBlue virtual peripheral device, the BD_ADDR handle can change after disconnection so be sure to scan and check the BD_ADDR handle again.

 

     2. Connect to BLE device

          a. curl -v -X PUT "http://<BIG_SERVER_ADDR>/gap/nodes/<node_handle>?connect=1"

 

     3. Perform primary service discovery

          a. curl -v -X GET “http://<BIG_SERVER_ADDR>/gatt/nodes/<node_handle>/services?primary=1”    

 

          **NOTE: Same with BD_ADDR, service handles might change after disconnection on the same LightBlue devices. The uuids will stay the same though.

 

     4. Perform characteristic discovery of the service

          c. curl -v -X GET "http://<BIG_SERVER_ADDR>/gatt/nodes/<node_handle>/services/<service_ref_handle>/characteristics"

 

          **NOTE: Same with BD_ADDR, service handles might change after disconnection on the same LightBlue devices. The uuids will stay the same though.

    **NOTE: in the service and characteristic handle, you need to use the values on the end of “self” : { “href”: …/003700360035”}, instead of the 4 digit “handle” number.

          handle.png

 

<Notify/Indicate>

Now you should have all the handles you need to sign up for the desired characteristic. You can follow the steps below to turn on notify/indicate and you will see the results streaming into your WICED device.

  1. Enable Notify or Indicate

          a.      curl -v -X GET “http://<BIG_SERVER_ADDR>/gatt/nodes/<node_handle>/characteristics/<characteristic_ref_handle>?notify=1

          b.      curl -v -X GET “http://<BIG_SERVER_ADDR>/gatt/nodes/<node_handle>/characteristics/<characteristic_ref_handle>?indicate=1

 

          **NOTE: Check if your device characteristic has the notify/indicate property. It will show as the following in LightBlue.

          LightBlue.jpg

 

    2. Subscribe to Notify or Indicate and wait for notifications / indications

          a.      curl -v -X GET “http://<BIG_SERVER_ADDR>/gatt/nodes/<node_handle>/characteristics/<characteristic_ref_handle>/value?notify=1&event=1

          b.      curl -v -X GET "http://<BIG_SERVER_ADDR>/gatt/nodes/<node_handle>/characteristics/<characteristic_ref_handle>/value?indicate=1&event=1"

 

     3. Results

     This is the reply you should be getting afterwards. You will see the notify values streaming in through your device. In the below screen I am manually changing the numbers on LightBlue. 

 

* STATE: DO => DO_DONE handle 0x600057380; line 1337 (connection #0)

* STATE: DO_DONE => WAITPERFORM handle 0x600057380; line 1464 (connection #0)

* STATE: WAITPERFORM => PERFORM handle 0x600057380; line 1474 (connection #0)

* HTTP 1.1 or later with persistent connection, pipelining supported

< HTTP/1.1 200 OK

< Content-Type: text/event-stream

< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0

< Pragma: no-cache

< Connection: Keep-Alive

* no chunk, no close, no size. Assume close to signal end

<

data: 0050

 

data: 0064

 

data: 0064

 

data: 0064

 

data: 0078

 

data: 0078

 

data: 0078

 

data: 0078

 

data: 1111

 

data: 0078

 

data: 0078

 

data: 0078

 

data: 2222

 

data: 0078

 

data: 0078

 

data: 3333

 

...

 

<Scripts>

One thing to keep in mind is that if you are testing with LightBlue, connection will be dropped quickly so you will have to use a script to process all the commands within the time frame. From the moment you lose connection and reconnect again, the BD_ADDR or the handles for services and characteristics could change so you will have to double check them. For this reason it will be easier to maintain the connection using scripts. Make a file run_notification.bat and copy the following contents. You can run it as

>run_notification.bat <BD_ADDR>

 

and you will have to change addr, serv(service) and char(characteristic) in the file accordingly to the device and characteristic you are using.

 

addr=10.14.12.163

serv=00F40047

char=00F4004E004D

curl -v -X PUT "http://$addr/gap/nodes/$1?connect=1&enable=1"

curl -v -X GET "http://$addr/gatt/nodes/$1/services?primary=1&uuid=180D"

curl -v -X GET "http://$addr/gatt/nodes/$1/services/$serv/characteristics"

 

curl -v -X GET "http://$addr/gatt/nodes/$1/characteristics/$char?notify=1"

curl -v -X GET http://$addr/gatt/nodes/$1/characteristics/$char/value?notify=1&event=

To write a user defined string for CHAR_DESCRIPTOR_UUID16, you need to do the following.

 

1. Add a char description and make the permission readable in wiced_bt_gatt_db.c

CHAR_DESCRIPTOR_UUID16(USER_DESCRIPTOR, GATT_UUID_CHAR_DESCRIPTION, LEGATTDB_PERM_READABLE ),

 

2. Add USER_DESCRIPTOR in enum in wiced_bt_gatt_db.h

 

3. In ble_proximity_reporter.c, define a global user_defined_str

static char user_defined_str[] = "Temperature in the room";

 

4. Add the following switch clause to ble_proximity_gatt_read_request() in ble_proximity_reporter.c

   case USER_DESCRIPTOR:

       p_attribute_value_source = user_defined_str;

       attribute_value_length = sizeof( user_defined_str );

       break;

 

5. In your LightBlue you should now see the string attached to the characteristic

 

  IMG_0844.jpg

In order to use notifications in BLE peripheral mode, you will need to define the CCCD in the GATT database and send the notifications or indications according to the value the client sets it. I attached a zip file that has addition of code using a CCCD for notifications in the ble_proximity_reporter. Please look at the following for a description of changes made (in red).

 

** This was verified on a BCM943341WCD1 board with the iPhone LightBlue app.

 

1. First you will need to define the characteristic descriptor in wiced_bt_gatt_db.c, and also add properties to the characteristic that you want to receive notifications.

 

wiced_bt_gatt_db.c

<Modify>

CHARACTERISTIC_UUID16 (HDLC_TX_POWER_LEVEL,

                      HDLC_TX_POWER_LEVEL_VALUE,

                      GATT_UUID_TX_POWER_LEVEL,

                      LEGATTDB_CHAR_PROP_READ | LEGATTDB_CHAR_PROP_NOTIFY | LEGATTDB_CHAR_PROP_INDICATE,

                      LEGATTDB_PERM_READABLE),

 

 

<Add>

CHAR_DESCRIPTOR_UUID16_WRITABLE (HDLC_TX_POWER_LEVEL_DESCRIPTOR,

                      GATT_UUID_CHAR_CLIENT_CONFIG,

                      LEGATTDB_PERM_READABLE | LEGATTDB_PERM_WRITE_REQ ),

 

 

 

2. In wiced_bt_gatt_db.h, add a handle for HDLC_TX_POWER_LEVEL_DESCRIPTOR,

 

wiced_bt_gatt_db.h

    // ***** Primary service 'TX Power'

    HDLS_TX_POWER,

    HDLC_TX_POWER_LEVEL,

    HDLC_TX_POWER_LEVEL_VALUE,

    HDLC_TX_POWER_LEVEL_DESCRIPTOR,

 

 

 

3. In ble_proximity_reporter.c, add a global descriptor value and add a clause to function ble_proximity_gatt_write_request() to enable the client writing to the descriptor.

 

ble_proximity_reporter.c

static int8_t  proximity_tx_power_level_descriptor;

 

 

case HDLC_TX_POWER_LEVEL_DESCRIPTOR:

      proximity_tx_power_level_descriptor = attribute_value;

      WPRINT_APP_INFO( ("POWER_LEVEL_DESCRIPTOR written as 0x%x\n", attribute_value));

      break;

 

 

4. Once the descriptor is defined, we are going to use the function wiced_bt_gatt_send_notification() to send notifications every 2 seconds. We shall set the value to decrease from 20 to 1. The following code should be added in application_start() afterwiced_bt_stack_init() in ble_proximity_reporter.c.

 

ble_proximity_reporter.c

void application_start( void )

{

    /* Initialize WICED platform */

    wiced_init( );

 

    /* Initialize Bluetooth controller and host stack */

    wiced_bt_stack_init( ble_proximity_management_callback, &wiced_bt_cfg_settings, wiced_bt_cfg_buf_pools );

 

    wiced_rtos_delay_milliseconds(2000);

    for (uint8_t i = 20; i > 0; i-- )

    {

        // If notification is set

        if ( proximity_tx_power_level_descriptor == 0x1 )

        {

            proximity_tx_power_level = i;

            wiced_bt_gatt_send_notification (proximity_connection_handle, HDLC_TX_POWER_LEVEL_VALUE, sizeof(proximity_tx_power_level), &proximity_tx_power_level );

        }

        wiced_rtos_delay_milliseconds(2000);

    }

}

 

 

**For indications, use the function wiced_bt_gatt_send_indication() when the proximity_tx_power_level_descriptor == 0x2

 

 

5. For the first parameter in the function, proximity_connection_handle, this should be defined as a global variable and maintained inble_proximity_gatt_cback(). Whenever a new connection is established it should store the connection handle, and when connection is lost it should reset it to 0. ( Add red code in ble_proximity_reporter.c )

 

ble_proximity_reporter.c

static uint16_t proximity_connection_handle = 0;

 

/* GATT event handler */

static wiced_bt_gatt_status_t ble_proximity_gatt_cback( wiced_bt_gatt_evt_t event, wiced_bt_gatt_event_data_t *p_event_data )

{

    wiced_bt_gatt_status_t status = WICED_BT_GATT_SUCCESS;

    uint8_t *bda;

 

    switch ( event )

    {

        case GATT_CONNECTION_STATUS_EVT:

            /* GATT connection status change */

            bda = p_event_data->connection_status.bd_addr;

            WPRINT_BT_APP_INFO( ("GATT connection to [%02X:%02X:%02X:%02X:%02X:%02X] %s.\n", bda[0], bda[1], bda[2], bda[3], bda[4], bda[5], (p_event_data->connection_status.connected ? "established" : "released")) );

 

            if ( p_event_data->connection_status.connected )

            {

                /* Connection established. Get current TX power  (required for setting TX power attribute in GATT database) */

                wiced_bt_dev_read_tx_power( p_event_data->connection_status.bd_addr, p_event_data->connection_status.transport, (wiced_bt_dev_cmpl_cback_t *) ble_proximity_tx_power_callback );

 

                /* Store information  */

                proximity_connection_handle = p_event_data->connection_status.conn_id;

 

                /* Disable connectability. */

                wiced_bt_start_advertisements( BTM_BLE_ADVERT_OFF, 0, NULL );

            }

            else

            {

                /* Connection released. Re-enable BLE connectability. */

                wiced_bt_start_advertisements( BTM_BLE_ADVERT_UNDIRECTED_HIGH, 0, NULL );

                /* test code for directed adv */

                /* wiced_bt_start_advertisements (BTM_BLE_ADVERT_DIRECTED_HIGH, 0, p_event_data->connection_status.bd_addr); */

 

                proximity_connection_handle = 0;

 

                WPRINT_BT_APP_INFO( ("Waiting for proximity monitor to connect...\n") );

            }

            break;

 

            ...

 

 

 

6. That's it! Now compile the code and download it to your WICED board. When you connect to "WICED Proximity" and select "Tx Power Level" from the LightBlue app of your iPhone (below) or the WICED Smart Explorer app in your Android device.

 

You should see the notifications arriving once you set "Listen to notifications". This app only counts down from 20 to 1 every 2 seconds after it resets, so if you don't see it counting down on your client try resetting the WICED board and connecting to it faster.

 

  IMG_0841.jpg

 

I hope this helped in getting you started with notifications!

 

Thanks,

Jaeyoung

** This is one of the ways to program an FTDI chip, this might be easier as it only involves one download and double-clicking a script. To use an FTDI config program instead, see following blog post for alternative method.

WICED FTDI chip programming

 

<FTDI Introduction>


WICED evaluation boards have a FTDI FT2232 chip which provides debug capability with USB to UART+JTAG.

To provide this functionality the FTDI chip must be configured with the correct settings, which is done by programming the EEPROM via USB with the correct settings for the WICED board.

The EEPROM can be programmed using the script in the attachment. The configuration file to be programmed via FT_PROG is also included: BCM9WCD1EVAL1_FTDI.xml

 

<FTDI Programming>


If you have installed WICED SDK then the drivers should already be installed. Go through the following steps to program the FTDI chip.


1. Download the attachment and extract the contents into a folder.

  ftprog.PNG


2.  Run the Prog_BCM9WCD1EVAL1.bat by double-clicking on it. Wait until you see "Re-enumerating Device 0" (You must do through step #1 and extract all the files, otherwise it will not be able to run)

ftprog.PNG

 

3. Once this has finished successfully, go to Windows Device Manager and you will see the following:


- WICED USB Serial Port (COMx) under Ports

- WICED USB Serial Port B under Universal Serial Bus Controllers

- WICED USB JTAG Port under WICED USB JTAG Devices

ftprog.PNG



4. If it does not program correctly, change the VID/PID in the BCM9WCD1EVAL1_FTDI.xml file.

 

    Note: it is possible that FT_PROG cannot detect your board.  This means that the USB VID/PID of the board do match the default      FTDI VID/PID.  If this is the case you will need to :

  • Open Windows Device Manager, and right click the device and select properties. Then select the Details tab and Hardware Ids property. Make a note of the VID/PID
  • Change the VID/PID in the BCM9WCD1EVAL1_FTDI.xml file.

 

You should be able to download desired image to the board now. Try it out with our basic snip.scan app!



Once you have the WICED IDE installed, you can import other WICED SDK .7z releases easily without reinstalling the IDE, or even changing the workspace. This method comes in handy when you have several releases you want to test and compare. You may keep several projects(SDKs) open in one workspace, but for simplicity we will start with closing the existing project.


**In the case you want to change the workspace in Eclipse and import the new SDK, please refer to the following blog post.

How to bring a WICED SDK into Eclipse



1. Right-click on your current project name in the IDE and select "Close Project". This will not modify or delete your files in anyway. It will, however, close the files you had open in the IDE, and you can choose to either save any changes that had been made. (This step is optional, you may have several projects open at once)

close_project.png



2. Extract the new WICED SDK .7z file to your chosen destination.



3. Click on the arrow next to the blue folder icon and select "Makefile Project with Existing Code"

Makefile_existing.png



4. Click on "Browse" and navigate to and then select the WICED SDK folder you created. The "Project Name" will be automatically filled in from the name in the "Existing Code Location" you choose. You may modify the name for clarity.


navigate.PNG



5. The new SDK will now be showing in the "Project Explorer" view.

new_project.PNG



6. You will have to create new target names when you import a new project. The make file will be linked to the previous project if you  copy and paste existing targets from other projects, so it's best to create new ones.


In the "Make Target" window on the right, the "Hide Empty Folder" will be selected by default. You need to unselect this.

  target.png


Right click on the project name and select "New".

  target.png


This will allow you to make new targets. To obtain a complete list of build commands and options, enter the following text in the base WICED SDK directory on a command line:

$> make

 

create_make_target.png

 

For WICED SDK 3.3.1, the usage is as following:

 

Usage: make <target> [download] [run | debug] [JTAG=xxx] [no_dct]

 

  <target>

    One each of the following mandatory [and optional] components separated by '-'

      * Application (apps in sub-directories are referenced by subdir.appname)

      * Hardware Platform ()

      * [RTOS] (ThreadX NoOS wiced_rtos_common.c FreeRTOS)

      * [Network Stack] (wiced_network_common.c LwIP wiced_tcpip_common.c NoNS NetX NetX_Duo)

      * [MCU-WLAN Interface Bus] (SDIO SPI)

 

  [download]

    Download firmware image to target platform

 

  [run]

    Reset and run an application on the target hardware (no download)

 

  [debug]

    Connect to the target platform and run the debugger

 

  [JTAG=xxx]

    JTAG interface configuration file from the tools/OpenOCD dirctory

    Default option is BCM9WCD1EVAL1, direct JTAG option is jlink

 

  [no_dct]

    DCT downloading is disabled and the DCT remains unmodified.

    Only valid when the 'download' option is present

 

  [factory_reset_dct]

    Generates a factory reset DCT

 

  [VERBOSE=1]

    Shows the commands as they are being executed

 

  [JOBS=x]

    Sets the maximum number of parallel build threads (default=4)

 

  Notes

    * Component names are case sensitive

    * 'WICED', 'SDIO', 'SPI' and 'debug' are reserved component names

    * Component names MUST NOT include space or '-' characters

    * Building for release is assumed unless '-debug' is appended to the target

    * Some platforms may only support a single interface bus option

 

  Example Usage

    Build for Release

       make snip.scan-BCM943362WCD4

       make snip.scan-BCM943362WCD4-ThreadX-NetX_Duo-SDIO

 

    Build, Download and Run using the default USB-JTAG programming interface

       make snip.scan-BCM943362WCD4 download run

 

    Build for Debug

       make snip.scan-BCM943362WCD4-debug

 

    Build, Download and Debug using command line GDB

       make snip.scan-BCM943362WCD4-debug download debug

 

    Reset and run an application on the target hardware

       make run

 

    Clean output directory

       make clean

 

    Build a Factory Reset image for the SPI serial flash

       make snip.ping-BCM943362WCD4  OTA=waf.ota_upgrade  SFLASH=app-dct-ota-download

          where: [OTA]=<OTA application build string>

                         Build string options are App name, RTOS and TCP stack ONLY

                     <SFLASH>=<app>-[dct]-[ota]-[download]

                        where:

                            app      : Add the application to the image

                            dct      : Add the DCT to the image

                            ota      : Add the OTA application to the image

                            download : Download the image after creation

 



That was it! Enjoy using your new SDK

<BIG RESTful Smart Server Demo>


The RESTful Smart server implements the Bluetooth Internet Gateway(BIG), and is the successor of SmartBridge. It allows you to connect to the WICED device through WiFi and then connect to peripherals through BLE. You can issue http get/put requests to scan/connect/read and write characteristic and descriptor values from ble peripherals through WICED devices.


Below is a guide on how to use the RESTful Smart Server with curl commands. You can also use RESTful clients for a gui environment. The http requests will be the same. Note that results with REST clients may vary, you will get the best results with using curl commands in Cygwin. When using REST clients, be sure to always include “user-Agent: curl/7.37.1”.


The ble peripherals used for testing are WICED Sense kits, hello_sensor app loaded on a BCM920737 (TAG 4), and iOS LightBlue peripherals. If you do not have any physical peripheral devices available for testing you can download the Light Blue app in iOS to generate virtual peripheral devices. Make sure that your iOS device screen does not time out as that may disconnect the bluetooth connections. In the case that data gets corrupted and you are not getting the right JSON response, try reconnecting or resetting the peripheral.


- For BCM943909WCD1 / BCM943341WCD1 / BCM943438 REFAD

- See attached files for GAP and GATT API spec sheets for the format of the RESTful API.


- REST Client For Mac

    https://luckymarmot.com/paw

- REST Client For Windows

    http://www.swensensoftware.com/im-only-resting

- Installing Curl on Cygwin

    http://stackoverflow.com/questions/3647569/how-do-i-install-curl-on-cygwin

 


<SETUP>


1. Change the network SSID and password to match your network in /apps/demo/bt_internet_gateway/restful_smart_server/wifi_config_dct.h

  ssid.PNG


2. Compile and download with target demo.bt_internet_gateway.restful_smart_server-<PLATFORM> download run

smart_server.PNG


3. Open a terminal (PuTTY/TeraTerm/CoolTerm) to check the serial output. Once the device has downloaded and reset, it will connect to the network and set up the smart server automatically. You can access the server using the address it was assigned.

  smart_screen.PNG


4. Turn on some ble peripherals and use the curl commands below on your PC or use REST clients to scan/connect/read/write data. If you set up a local network for testing be sure to connect to the same network from your PC.


**When accessing services or characteristics, be sure to use the full hex value in the last part of the "self" "href" field.


**You will need to use GAP API to scan and connect to the device, then GATT API to access the data


<GAP Commands>

  • Active Scan
    • curl -v -X GET "http://<IP>/gap/nodes?active=1"
  • Passive Scan:
    • curl -v -X GET "http://<IP>/gap/nodes?passive=1"
  • Connect
    • curl -v -X PUT "http://<IP>/gap/nodes/<NODE_HANDLE>?connect=1&enable=1"
  • List Available Connect Nodes
    • curl -v -X GET "http://<IP>/gap/nodes?enable=1"
  • Remove Node
    • curl -v -X PUT "http://<IP>/gap/nodes/<NODE_HANDLE>?enable=0"


<GATT Commands>

  • Discover Primary Services
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/services?primary=1"
  • Discover Services by UUID
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/services?primary=1&uuid=<UUID>"
  • Discover All Characteristics of a Service
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/services/<SERVICE_REF>/characteristics"
  • Discover Characteristic by UUID
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/characteristics?uuid=<UUID>"
  • Discover Descriptors
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/characteristics/<CHARACTERISTIC_REF>/descriptors"
  • Read Characteristic Value
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/characteristics/<CHARACTERISTIC_REF>/value"
  • Write Characteristic Value
    • curl -v -X PUT "http://<IP>/gatt/nodes/<NODE_HANDLE>/characteristics/<CHARACTERISTIC_REF>/value/<VALUE>"
  • Read Descriptor Value
    • curl -v -X GET "http://<IP>/gatt/nodes/<NODE_HANDLE>/descriptors/<DESCRIPTOR_HANDLE>/value"
  • Write Descriptor Value
    • curl -v -X PUT "http://<IP>/gatt/nodes/<NODE_HANDLE>/descriptors/<DESCRIPTOR_HANDLE>/value/<VALUE>"



restful1.png

restful2.png

restful3.png

restful4.png

restful5.png

With Google's reinforced security measures, there are a few settings you need to change in order to use the email app successfully with a gmail account.

 

In /apps/snip/email/email.c,

1. Change the RECIPIENT to your personal email account that you want to receive the message in. This does not have to be a gmail account.

email_recipient.PNG

 

2. In the send_email() function within the same file (line 121), you will have to change the following to your own gmail account. Other email providers can be used for this but may have additional security measures. We have verified the process for gmail accounts so we advise that you do the same.

 

     1) account.email_address

     2) account.user_name

     3) account.password

 

     **Previously we have provided an email account as default to use as the sender, but with the increased gmail security measures it will no longer be possible to use this account.

email_sender.PNG

 

3. If you try running the program after the first two modifications you will get a notification email from google that they blocked a sign-in attempt to your Google account. You will have to login to your account and change your settings at the following link to allow access for less secure apps.

https://www.google.com/settings/security/lesssecureapps

 

less_secure.PNG

 

4. You will also have to allow access to the new device from an already proven device(laptop, phone) on this link.

https://accounts.google.com/DisplayUnlockCaptcha

 

allow_access.PNG

 

Press Continue and it will show the following.

access_enabled.PNG

 

5. In most cases the above steps should be sufficient. In the case you have the 2-step verification enabled on your account, you will have to generate a separate password in the below link.

https://support.google.com/accounts/troubleshooter/3141849#ts=3202254

 

Two_step.PNG

 

6. Once you have gone through these settings you should be able to send an email to your account successfully.

 

wiced_email.PNG

Introduction

 

WICED supports OTA(Over-The-Air) updates for distribution of software updates. This allows firmware upgrades when needed without requiring physical access, saving time and resources.

 

The ota_fr application in the apps/snip directory demonstrates how to use WICED multi-application support to perform factory reset and OTA upgrade. The following steps assume you have a BCM943362WCD4 WICED evaluation board (a BCM943362WCD4 WICED module on a WICED evaluation board). If your board is different, substitute BCM943362WCD4 for your platform name.

 

*This process was also verified and tested on the Avnet BCM94343W_AVN BCM4343W based development kit.

 

Features demonstrated

  - WICED OTA Upgrade

  - Factory Reset process

 

Prepare the WICED evaluation board for OTA upgrade

 

     1. Build the snip.ota_fr application to function as your factory reset and OTA application

        

     2. Notice that the factory reset application (FR_APP) is set in <WICED-SDK>/apps/snip/ota_fr/ota_fr.mk to point to the snip.ota_fr application elf file.

          Screen Shot 2015-05-21 at 6.21.29 PM.png

 

     3. Run the following make target to download your production and factory reset applications to the board:

           make snip.ota_fr-BCM943362WCD4 download download_apps run

          Screen Shot 2015-05-21 at 6.20.00 PM.png

 

          On the terminal (putty / CoolTerm) it should show as following.

          Screen Shot 2015-05-21 at 6.25.01 PM.png

 

     **NOTE

        If you are using Linux or OSX you might get the following error.

          Downloading Bootloader ...

          make: *** [main_app] Segmentation fault: 11

          No changes detected

 

        In this case you should copy the make file over to the following location from your built-in make file. For the OSX, you might have to install Xcode and then copy the make file.

          - Linux 32bit: /tools/common/Linux32

          - Linux 64bit: /tools/common/Linux64

          - OSX: /tools/common/OSX

 

4. Build an application that will upgrade the current application.

        For this example we will build the snip.scan application:

            make snip.scan-BCM943362WCD4

 

 

Upgrade the application running on the WICED evaluation board

 

   After carefully completing the above steps, the WICED evaluation board is ready to for an OTA upgrade.

   'Loading OTA upgrade app' log message is displayed in the terminal when the OTA upgrade application is ready.

 

   Work through the following steps:

   1. Using the Wi-Fi connection manager on your computer, search for, and connect to the Wi-Fi AP called : Wiced Device

          Screen Shot 2015-05-21 at 6.42.53 PM.png

     The AP name and passphrase is defined in /include/default_wifi_config_dct.h  file. The default passphrase in SDK 3.1.2 is WICED_PASSPHRASE.

     /* This is the soft AP available for normal operation (if used)*/

     #define SOFT_AP_SSID         "WICED Device"

     #define SOFT_AP_CHANNEL      1

     #define SOFT_AP_SECURITY     WICED_SECURITY_WPA2_AES_PSK

     #define SOFT_AP_PASSPHRASE   "WICED_PASSPHRASE"

 

 

   2. Open a web browser and enter the IP address of the eval board: 192.168.10.1 (default)

        After a short period, the WICED Webserver OTA Upgrade webpage will appear.

         OTA_server.PNG

 

   3. Click 'Choose File' and navigate to the file

      <WICED-SDK>/build/snip_scan-BCM943362WCD4/Binary/snip_scan-BCM943362WCD4.stripped.elf

     (this is the snip.scan application binary file that was created in step 2 above)

     snip_scan.PNG

 

   4. Click 'Open' (the dialogue box disappears)

 

   5. Click 'Start upgrade' to begin the upgrade process

      - The progress bar within the webpage indicates the upgrade progress

      - The webpage displays 'Transfer completed, WICED device is rebooting now' when the process completes

     upgrade_complete.PNG

 

   6. With the upgrade complete, the snip.scan application runs and Wi-Fi scan results are regularly printed to the terminal

     scan_complete.PNG

 

 

Perform factory reset on the WICED evaluation board  

 

  1. Push and hold the SW1 button THEN momentarily press and release the Reset button.

     The D1 LED flashes quickly to indicate factory reset will occur *IF* SW1 is held for a further 5 seconds. Continue to hold SW1.

     43362.png

 

 

  2. After the copy process is complete, the WICED evaluation board reboots and runs the factory reset (OTA_FR) application.           Observe the log messages at the terminal to confirm the factory reset is completed successfully.

     factory_reseet.PNG

 

 

WICED Multi-Application Support

 

As of WICED-SDK 3.1.1, WICED Application Framework (WAF) supports loading and storing of multiple application binaries in the external serial flash. Up to 8 binaries are supported. The first five binaries are reserved for internal usage and the last three binaries are free for users to use. The binaries are organized as follows:

 

  - Factory reset application (FR_APP)

  - DCT backup image (DCT_IMAGE)

  - OTA upgrade application (OTA_APP)

  - Resources file system (FILESYSTEM_IMAGE)

  - WIFI firmware (WIFI_FIRMWARE)

  - Application 0 (APP0)

  - Application 1 (APP1)

  - Application 2 (APP2)

Filter Blog

By date:
By tag: