7 Replies Latest reply on Jun 15, 2015 1:42 PM by hmoore

    Webserver Crashes

    gre7g

      I'm experiencing stability problems with my first webserver application. I'm running on a Murata SN8200EVK+ from Wiced on Windows 7 (64-bit). To track down the problem, I've stripped my system down to what I think is the smallest possible example and have attached the source files to this post.

       

      The enclosed project serves only a single web page: an HTML index file that uses some jQuery Javascript. The jQuery library is pulled from Google's website. The C code is very basic.

       

      The Javascript code loads the HTML file over and over, once per second, and puts some simple information on the screen.

       

      I can compile, download, and connect to the device with my PC. I can pull up the web page with the latest version of Chrome -- sometimes. Sometimes the device will crash immediately. By crash, I mean that I have to power cycle the device or re-download to it to make it do anything. I can't pull up a web page. If I disconnect my PC from the WIFI connection, I will not be able to re-establish. I suspect the C code has fallen into an infinite loop or HALTed.

       

      Sometimes the browser will pull the code up correctly and will load the page over and over. Usually, hitting F5 (refresh) on the browser will kill it immediately. Sometimes I have to hit it a bunch of times. Very rarely will refreshing not be able to kill it, but I've seen that happen too.

       

      Regardless, such a simple program should be rock-solid stable and it's most definitely not. I need to know what I've done wrong before we can design this device into our product.

       

      Thank you for looking into this!

        • 1. Re: Webserver Crashes
          gre7g

          Other notes:

           

          * Running API 2.4.1.

           

          * I loaded the HTML file onto the hardware with Murata's "wizzard" (ugh, I hate misspelling that!) and it was reliable. I was unable to crash their webserver. So the hardware is fine, but they didn't use Wiced's webserver.

          • 2. Re: Webserver Crashes
            vikr

            I'm presently trying to reproduce your issue, will let you know soon..

            • 3. Re: Webserver Crashes
              vikr

              I saw your html code in the resources and saw some issues with your html. I went ahead and corrected the same and ported it with the appliance app that comes default with WICED SDK and verified it .

              Just to understand better your stripped down version of html code is just doing a counter logic. I did not notice any hanging issues or getting stuck with this new html. I did not debug your c code. Let me know if you have any doubts there.

               

              gre7g:The Javascript code loads the HTML file over and over, once per second, and puts some simple information on the screen.

              As Mentioned earlier, its just a counter display on the web.

               

              gre7g:I can compile, download, and connect to the device with my PC. I can pull up the web page with the latest version of Chrome -- sometimes. Sometimes the device will crash immediately. By crash, I mean that I have to power cycle the device or re-download to it to make it do anything. I can't pull up a web page. If I disconnect my PC from the WIFI connection, I will not be able to re-establish. I suspect the C code has fallen into an infinite loop or HALTed.

              if you are seeing the crash, I would suspect your c code as mentioned by you . I would also try running using  the existing app and later make changes the same accordingly.

               

              gre7g:Sometimes the browser will pull the code up correctly and will load the page over and over. Usually, hitting F5 (refresh) on the browser will kill it immediately. Sometimes I have to hit it a bunch of times. Very rarely will refreshing not be able to kill it, but I've seen that happen too.

              I suspect this happens if the board has not booted up completely or if the dhcp has not assigned a valid ip address, sometimes might be even browser cache

               

              gre7g:Regardless, such a simple program should be rock-solid stable and it's most definitely not. I need to know what I've done wrong before we can design this device into our product

              All the best and let me know if you still seeing issues with this.

               

              Thnx

              vik86

              • 4. Re: Webserver Crashes
                gre7g

                I tried your new HTML and the code still crashes when I hit refresh.


                Yes, the problem is in the C code since that's what's actually crashing. That's what I wanted you to look at. I have no idea why you would even focus on the HTML.

                • 5. Re: Webserver Crashes
                  rakjak2

                  What device running WICED stack do you use? I had similar problem with a app with javascript library using WebGL. I used STM32F407 microcontroller and it hanged because of lack of free space in RAM.

                  • 6. Re: Webserver Crashes
                    gre7g

                    As I mentioned, I'm running on a Murata SN8200EVK+.

                     

                    Overflowing the stack could certainly be an issue. I'll research linking flags and see if I can find an option to allocate additional space. I'll post my findings here.

                    • 7. Re: Webserver Crashes
                      hmoore

                      Discussion is being locked. If you have any follow-up, please start a new discussion.