Forums - GT202 http server

7 posts / 0 new
Last post
GT202 http server
Fred
Join Date: 26 Mar 15
Posts: 5
Posted: Thu, 2015-04-30 18:37

Freescale offers a demo http server called softap. It uses the MQX network stack on the Freescale K22. Is it possible to create a similar http server using the GT202 network stack (i.e. stack offload mode)? If so are there any examples available?

Using the throughput demo provided in the PDK i tried to enable the http server as follows, --ip_http_server start 80 but the return code was a -1. With only two return codes 0 for success and -1 for failure how can i determine the reason for failure? Is there an api to get the last error? It appears the port (80) is not processed and transmitted to the GT202, could this be the problem?

Thanks in advance!

 

  • Up0
  • Down0
ttsai
Join Date: 1 May 14
Posts: 3
Posted: Thu, 2015-04-30 22:53

please use

wmiconfig --ip_http_server start 1

  • Up0
  • Down0
Fred
Join Date: 26 Mar 15
Posts: 5
Posted: Fri, 2015-05-01 17:03

Had to set the mode to ap and connect before calling ip_http_server start.

Next, how to host a simple web page? If it's possible would think there is a hello example available? Maye use ip_http_post?

Thanks in advance!

 

  • Up0
  • Down0
Fred
Join Date: 26 Mar 15
Posts: 5
Posted: Tue, 2015-05-05 18:00

Found the documentation in the QCA4002 user guide availabe for download. It's not in the GT202 user guide. Uh oh.

For anyone interested it looks like a no go. I followed the instructions and added a hello web page to the firmware using version 3.3.2 download. I'm able to flash the original firmware that came with my kit (v3.0.2). Albeit a pain as host exe hangs several times in a row right in the middle of programming, having to start over again. With the firmware i compiled if it doesn't hang during programming i get the message, "Timer expired: Flash failed". I noticed my new firmware is over 50k smaller than the original. I tried with 1 bit dset and 4 bit dset, it made no difference.

  • Up0
  • Down0
Fred
Join Date: 26 Mar 15
Posts: 5
Posted: Tue, 2015-05-12 19:53

Decided to take another shot. It stil doesn't work but it appears possible.

First i'll start with a work around to keep Host exe from hanging. The bug is in the flash agent. It can be seen if you hook up a serial analyzer. During the response to Host the message is only partially transmitted. Host just sits there waiting for the rest of the message. You can instantly recreate the problem by putting a _time_delay(1) on the line after write(stdout, (char*)&response, sizeof(response)). This kills the transmission and no bytes are sent. Apparently the IO write routine is non blocking and something is randomly killing the transmit. This is the first time i've used MQX. I wasn't able to find a quick way to make the write routine blocking. Not wanting to set up the serial IO from scratch to understand the issue better i implemented the hack below. I'll leave it to Qualcomm or Freescale to properly fix this. To implement the work around open the flash_agent.c file. Inside the handle_request() function scroll down to the PROGRAM case statement. Replace the write function in here with the code below. Great, cut and paste is not working. lol.

char msgBuffer[sizeof(response)];

memcpy(&msgBuffer[0], (char*)&response, sizeof(response));

int i;

// Send one byte at a time

for (i = 0; i < sizeof(response); i++) {

   _time_delay(5); // This does the trick

   putchar(msgBuffer[i]);

  ioctrl(stdout, IO_IOCTL_SERIAL_WAIT_FOR_TC, NULL); // Wait for transmit complete

}

 

Now that i'm able to flash firmware without hanging 40 times in a row i experimented a bit more. As noted in the previous post with kit version 3.3.2 the response is "Flash failed: Timeout expired". On the last block there is no response from the GT and flash agent hangs.

I then tried running the shell script with the firmware that came with my kit. Flashing works but when i run the throughput demo the WMI_READY event never fires.

Lastly, i tried the same as above but this time i cleared out all the data in the tunable dsets. Flashing works and throughput works. The problem is my hello page doesn't come up in my browser when i test. I can see it was appended to the binary though.

The only thing i can think of trying is using the tunable dsets for my kit, version 3.0.2. However this version does not contain the shell scripts and dsets. Apparentyly they're distributed with the SP141 kit but not the GT202 kit?

If someone could email me the shell scripts and tunable dsets for SP141 version 3.0.2 i would appreciate it. I set up an email account for this purpose fred.gt202@gmailcom . If i receive them i'll post the results back here. Thanks in advance!

 

  • Up0
  • Down0
ttsai
Join Date: 1 May 14
Posts: 3
Posted: Wed, 2015-05-13 14:29

Hi Fred,

To host the webpage, you would need to use the htmltoflash utility to bind the html webpage to the flash (by following the user guide)

There was some issue with the 3.0.2 htmltoflash utility.  The 3.3.2 package had this fixed. 

Please try the htmltoflash utility from the 3.3.2 package against the 3.0.2 firmware

Thanks,

-Tony

  • Up0
  • Down0
Fred
Join Date: 26 Mar 15
Posts: 5
Posted: Wed, 2015-05-13 18:07

Hello Tony:

The results from two variations of your suggestion were posted in my previous post. If you would be so kind as to email me the 3.0.2 scripts and tunable dsets i could take it from there. Something else that would be helpful is a working 3.0.2 firmware with the name of the html file you appended. That would allow me to determine if i've got something else going on. Not really sure what it could be since i'm able to connect to the GT ap.

Thanks in advance,

[email protected] 

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.