10 Replies Latest reply on Feb 12, 2019 11:46 PM by PriyaM_16

    OTA2_example not working correctly

    cohuc_3807591

      Hey all, i'm having some really frustrating issues with OTA2. I want to integrate it into an existing project but i'm having trouble with just getting the stock example to work for me.

       

      I've done all the reading, namely the WICED OTA2 Update Support document and the forum post (Over The Air update in CYW43907 ), and for a guide i've been following this post: OTA2 Update for SDK-3.7.0. I am able to follow everything up to step 5 where I am issuing the get_update command through the command interface. here is the exact command I use: <get_update 192.168.223.1:8080/OTA2_image_file.bin>

       

      The resulting output is this:

      0000 00:18:25.142 PLAYER_EVENT_GET_UPDATE !

      0001 00:18:25.146 ota2_test_get_update() wiced_ota2_service_init() bg_service:0x52d090

      Download the OTA Image file - get it NOW!

      Joining : NETGEAR24

      Successfully joined : NETGEAR24

      0002 00:19:04.277 ota2_service_connect() wiced_tcp_connect() failed! 7014

      0003 00:19:04.283 wiced_ota2_service_get_the_update() ota2_service_connect() failed!

      0004 00:19:04.290 wiced_ota2_service_get_the_update() ota2_service_connect() failed (list)!

      0005 00:19:04.298 OTA2: wiced_ota2_service_get_the_update() FAILED check if timers started!

      0006 00:19:04.306 PLAYER_EVENT_STOP_TIMED_UPDATE called ota2_test_stop_timed_update()! 0

       

      So i'm not sure whats really happening here - but i should say ive tried using my own file server I wrote in python as well as the mongoose server used in the example, both to no avail. Any ideas?

       

      I also want to mention how I want to use this in case there someone can provide a stripped down version that might be easier understood/used by me. Basically I have a device that will ping a server every 10 minutes - the server will respond with some basic info, including a field that indicates whether an update is available. If one is, the device will connect to the update server and initiate a OTA2 update. I should also say that this process on the device will need to be completely autonomous, as once the device is deployed it cannot be accessed.

       

      Appreciate the help!

        • 1. Re: OTA2_example not working correctly
          PriyaM_16

          Hello,

          Does the red LED blink continuously before this error is thrown?

          • 2. Re: OTA2_example not working correctly
            cohuc_3807591

            Hi @riya:

             

            The red led (LED_1) on the 43907 eval kit doesn't blink at all for me, it is consistently on for the whole process of startup, network connection, and get_update. What behavior should I be expecting?

            • 3. Re: OTA2_example not working correctly
              PriyaM_16

              It is expected to blink continuously after the get_update command is issued. Can you please enable the logs before giving get_update and post the log? Command to enable the log:

              log 3

              (4 or 5 will give even more details)

              2 of 2 people found this helpful
              • 4. Re: OTA2_example not working correctly
                cohuc_3807591

                Hi PriyaM_16: thanks for the suggestion, I should've looked at the source a little closer and found the log. This helped me isolate and fix the problem, and I was able to get it to work a few times.

                 

                The issue was with the port - Even though I supplied the port (8080) in the get_update command, the code was still trying using port 80. Is there a proper way to specify the port that I missed in the example?

                 

                I am now also running into another problem with the fail safe. On my last attempt at updating, the extraction of the new app failed - ill supply the log:

                0714 00:04:51.467 Extract the OTA2 Image in the Staged Area NOW (will FAIL on Internal Flash systems)

                Copy Current DCT to Saved DCT.

                wiced_ota2_get_status(4) Download complete. Ready for extract.

                extracting: APPS.bin

                .

                extracting: DCT.bin

                .

                extracting: snip.ota2_extract-CYW943907AEVA

                ...................

                extracting: filesystem.bin

                ................................

                extracting: snip.scan-CYW943907AEVAL1F.stri

                ......

                0715 00:05:04.546 Reboot now to see change!

                 

                OTA2_Failsafe: Started ...

                OTA2_Failsafe: Extract Staged

                OTA2_Failsafe: Extract Factory Reset

                OTA2_Failsafe Extraction Failed !!!

                 

                The problem is that after I tried to reload the ota2_example it just prints the last 4 lines about the OTA2 failsafe. I even tried loading a new project onto the board (which worked, it can run the new app just fine) and then reloading the ota2_example, but it just goes back to the extraction fail, like something in memory inst getting overwritten. What should I do about this?

                 

                I also have one more question which is probably the most important of the three - is there a way to reset the system via a software solution? In my application I wont have physical access to the board to hit a reset button. Are there any other options that can be used autonomously?

                 

                Thanks for the help.

                • 5. Re: OTA2_example not working correctly
                  cohuc_3807591

                  Hi PriyaM_16, I was able to fix my second issue by uploading a new ota2_factory_download image, so my only 2 questions are about the software reboots and the port issue. Sorry about that!

                  • 6. Re: OTA2_example not working correctly
                    PriyaM_16

                    In ota2_example the WICED_OTA2_HTTP_PORT is defined as 80. Change this port to 8080 in file
                    libraries\daemons\ota2_service\wiced_ota2_service.h

                    2 of 2 people found this helpful
                    • 7. Re: OTA2_example not working correctly
                      cohuc_3807591

                      Awesome. So what about the reboot? I see there is a flag that can be set, how does the OTA2 system accomplish this?

                      • 8. Re: OTA2_example not working correctly
                        cohuc_3807591

                        Reviving this to ask a follow up - is there an example of OTA2 with no command interface? I'm trying to port OTA2 over to my app, all it does it get_update when the ota subsystem is called. However, without the command interface it wont actually do the download.

                        • 9. Re: OTA2_example not working correctly
                          PriyaM_16

                          If you dont have a provision to reboot your board manually, you can send it to hibernation after update and it should load the updated image on booting up

                          2 of 2 people found this helpful
                          • 10. Re: OTA2_example not working correctly
                            PriyaM_16

                            Summarizing the answer:

                            The issue was with the port - Even though I supplied the port (8080) in the get_update command, the code was still trying using port 80.

                            >> In ota2_example the WICED_OTA2_HTTP_PORT is defined as 80. Change this port to 8080 in file

                            libraries\daemons\ota2_service\wiced_ota2_service.h

                             

                            OTA2 image had some problems:

                            >> I was able to fix my second issue by uploading a new ota2_factory_download image