Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

SOTAFU for Android and iOS

lock attach
Attachments are accessible only for community members.

SOTAFU for Android and iOS

Anonymous
Not applicable
RevisionChange DescriptionDate
1.0Initial Draft - VR09/30/14 - 8:45PM
2.0Android and iOS Implementation05/27/15 - 5:00PM

The SDK 2.1.1 provides a Secure OTA Firmware update.RSA.JPG

Wiced smart memory partition

Address.JPG

Verification.JPG

Flowchart of the SOTAFU

Flowchart.JPG

FOR ANDROID

Download Sample App )for Side-loading onto Android Device)

Version 1.00  for Android 4.3 MR2  Jellybean or higher (Android API level 18 or higher)

Installation instructions: (apk file and source code included in post)

     1.  If you previously installed WicedSmartOta.apk, please make sure to remove it

          adb uninstall com.broadcom.app.wicedsmart.ota

     2.   Download the .apk file to a computer with adb installed

     3.   Connect your android device to your computer

     4.   From command line, type "adb install -r WicedSmartOta.apk"

How to Use the OTA Sample Application

     1.  Prerequisites for OTA Upgrade

         To perform OTA update the following conditions must be met

          a. The update firmware must be signed with the same private/public key that the firmware

               running in the target WICED SMART tag

          b. The update firmware must have the same ApplicationId as the firmware running in the

               target WICED SMART tag

          c. The update firmware's MajorVersionNumber must be equal or greater than the

              MajorVersionNumber of the firmware running in the target WICED SMART tag

           If any of these preconditions are not satisfied, OTA upgrade will fail.

     2.  Updating the WICED SMART tag firmware via OTA

          The WICED SMART OTA App provides an OTA service to allow one to upgrade the

          firmware of a connected WICED SMART tag.  To use the OTA firmware update service:

          a.  Make a local directory on the phone/tablet: /sdcard/broadcom/wicedsmart

               adb shell mkdir -p /sdcard/broadcom/wicedmart

          b.  Copy the wiced sense signed binary file to the /sdcard/broadcom/wicedsmart folder,

               making sure the firmware has the extension ota.bin.signed

               adb push XXXXXXXXX.ota.bin.signed /sdcard/broadcom/wicedsmart/

          c.  Turn on the WICED SMART tag

          d.  Using the WICED SMART OTA application, Search for the WICED SMART tag and

               select that device

          e.  Connect to the tag by clicking on the connect button in the action bar.

          f.   Verify the tag's running firmware version info by connecting to the tag and viewing the

               firmware's version info from the "Get sensor Info": menu option. This should upgrade

               the background of the application with the firmware info

1.png5.png

          g.  Go to the Upper right corner of the menu bar, and select "Check for software updates"

          h.  If you have more than one version of the firmware software in the

               /sdcard/broadcom/wicedsense directory, you will be prompted to select the file to

               upload to the WICED SMART tag. Otherwise, the OTA update service will automatically

               begin uploading the single firmware file embedded in the sample WICED SMART OTA

               App. (Bottom Left Image)

3.png4.png

          i.   Wait for the OTA Service to finish uplaoding and verify the firmware.

               (Top Right Image)

          j.   Close and reopen the WICED SMART OTA app

          k.  Reconnect to the WICED SMART tag and get the running firmware's version info to

               verify the firmware has been updated

 

OTA Implementation Instructions

     1. The OTA code is an included set of Objective C APIs and optional UI components that can

          be included into an app.

     2. The OTA code resides in the folder WicedSmartOtaHelper

          •    OtaManager manages the OTA upgrade process

          •    OtaCallback is a delegate object you will implement and register with OtaManager to

               receive "callback  events" that give the state/status of the OTA upgrade.

     3. Typical use case for implementing OTA Update using the OtaManager class

               •    Create an instance of OtaManager.

               •    Create an instance of your class that implements the delegate OtaCallback.

               •    Call OtaManager's addCallback method to register your callback.

               •    Read the OTA binary and obtain a NSData byte array for your binary.

               •    Call the OtaManager startUpdate method, passing it the byte array - Implement the

                    OtaCallback methods to receive callback events on the OTA transfer state.

               •    Call the OtaManager about method to abort the upgrade if needed.

The above basic API code will allow a user to design and implement an app with custom UI components to manage OTA upgrades.  However, a default UI implementation is provided.

OtaUIHelper provides a default UI wrapper around OtaManager.

The basic use case for OtaUIHelper is:

     •    Add the OTA binary that is signed with your private key into the folder fwupdate with

          the name ****.ota.bin.signed

     •    Modify the OtaFirmwareUpdateInfo.m configuration class that is in the fwupdate folder,

          specifying the name of your binary.

     •    Create an instance of OtaUiHelper

     •    Implement an instance of OtaHelperDelegate to receive callback events about when the

          OTA process starts, stops, or terminates unexpectedly.

     •    Register the OtaHelperDelegate instance with OtaUiHelper by setting its delegate

          property.

     •    Call startUpdate API method.

FOR iOS (iOS 7 or higher)

OTA Implementation Instructions

(Source code is attached in post)

     1. The OTA code is an included set of Objective C APIs and optional UI components that

          can be included into an app.

     2. The OTA code resides in the folder WicedSmartOtaHelper

          •    OtaManager manages the OTA upgrade process

          •    OtaCallback is a delegate object you will implement and register with OtaManager to

               receive "callback events" that give the state/status of the OTA upgrade.

     3. Typical use case for implementing OTA Update using the OtaManager class

          •    Create an instance of OtaManager.

          •    Create an instance of your class that implements the delegate OtaCallback.

          •    Call OtaManager's addCallback method to register your callback.

          •    Read the OTA binary and obtain a NSData byte array for your binary.

          •    Call the OtaManager startUpdate method, passing it the byte array - Implement the

               OtaCallback methods to receive callback events on the OTA transfer state.

          •    Call the OtaManager about method to abort the upgrade if needed.

The above basic API code will allow a user to design and implement an app with custom UI components to manage OTA upgrades.  However, a default UI implementation is provided.

OtaUIHelper provides a default UI wrapper around OtaManager.

The basic use case for OtaUIHelper is:

     •    Add the OTA binary that is signed with your private key into the folder fwupdate with the

          name ****.ota.bin.signed

     •    Modify the OtaFirmwareUpdateInfo.m configuration class that is in the fwupdate folder,

          specifying the name of your binary.

     •    Create an instance of OtaUiHelper

     •    Implement an instance of OtaHelperDelegate to receive callback events about when the

          OTA process starts, stops, or terminates unexpectedly.

     •    Register the OtaHelperDelegate instance with OtaUiHelper by setting its delegate

          property.

     •    Call startUpdate API method.

Thanks,

JT

Attachments
0 Likes
1600 Views
Comments
Anonymous
Not applicable

Is there an Xcode project file available that I can open, build, and run on an iOS device?  I only see the leddevicepicker Xcode project, which doesn't seem like it includes the OTA upgrade.  I'm a bit of a iOS newb.

Thanks,

ED

MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog
Contributors