This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

mcb1700 easyweb

Hi all,
I am trying to learn tcp/ip communication on arm cortex-m3 mcu. i have a mcb1700 board. I have tried the easyweb demo code of keil mcb1700. it works clearly,but i want to learn more. I want to realize led toggle on the board by using tcpip. So, how can i edit the easyweb demo code for this aim. Or do you know any demo code like this application?

Parents
  • > I want to realize led toggle on the board by using tcpip. So, how can i edit the easyweb demo code for this aim.

    For this purpose, CGI (Common Gateway Interface) is used on the web server.
    CGI consists of two components,
    1) HTML web page code to interact with browser user
    2) Parser of incoming HTTP packets on the web server

    To interact with browser user, the web page code has
    a) FORM tag with POST or GET method, with INPUT or BUTTON tag
    b) FORM tag with action, to invoke JavaScript code which calls XMLHttpRequest()
    etc.

    In either ways, the browser sends back URL string with query to the server, when user pushes a button on the browser.

    On the web server side, a parser identifies the URL on incoming HTML packets. And the server lights a LED as the response.

    The easyweb implementation ignores all packets from browser.

    C:\Keil\ARM\Boards\Keil\MCB1700\EasyWEB\easyweb.c
    
    void HTTPServer(void)
    {
      if (SocketStatus & SOCK_CONNECTED)             // check if somebody has connected to our TCP
      {
        if (SocketStatus & SOCK_DATA_AVAILABLE)      // check if remote TCP sent data
          TCPReleaseRxBuffer();                      // and throw it away
    

    Here is the point you should implement a parser to identify the URL.

    Before starting modification of easyweb, you may be better to know
    a) HTML FORM code
    b) What kind of string the browser sends back as the URL.

    I recommend you to try Http_demo and Http_upload examples under C:\Keil\ARM\Boards\Keil\MCB1700\RL\TCPnet\
    You'll see HTML FORM code in these examples.
    - \Http_upload\Web\upload.cgi

    Also, while the browser accesses to the embedded server, peek the packets using a packet monitor, WireShark.

    WireShark
    http://www.wireshark.org

    Tsuneo

Reply
  • > I want to realize led toggle on the board by using tcpip. So, how can i edit the easyweb demo code for this aim.

    For this purpose, CGI (Common Gateway Interface) is used on the web server.
    CGI consists of two components,
    1) HTML web page code to interact with browser user
    2) Parser of incoming HTTP packets on the web server

    To interact with browser user, the web page code has
    a) FORM tag with POST or GET method, with INPUT or BUTTON tag
    b) FORM tag with action, to invoke JavaScript code which calls XMLHttpRequest()
    etc.

    In either ways, the browser sends back URL string with query to the server, when user pushes a button on the browser.

    On the web server side, a parser identifies the URL on incoming HTML packets. And the server lights a LED as the response.

    The easyweb implementation ignores all packets from browser.

    C:\Keil\ARM\Boards\Keil\MCB1700\EasyWEB\easyweb.c
    
    void HTTPServer(void)
    {
      if (SocketStatus & SOCK_CONNECTED)             // check if somebody has connected to our TCP
      {
        if (SocketStatus & SOCK_DATA_AVAILABLE)      // check if remote TCP sent data
          TCPReleaseRxBuffer();                      // and throw it away
    

    Here is the point you should implement a parser to identify the URL.

    Before starting modification of easyweb, you may be better to know
    a) HTML FORM code
    b) What kind of string the browser sends back as the URL.

    I recommend you to try Http_demo and Http_upload examples under C:\Keil\ARM\Boards\Keil\MCB1700\RL\TCPnet\
    You'll see HTML FORM code in these examples.
    - \Http_upload\Web\upload.cgi

    Also, while the browser accesses to the embedded server, peek the packets using a packet monitor, WireShark.

    WireShark
    http://www.wireshark.org

    Tsuneo

Children
No data