click the 'update settings' button after changing the settings, and you
should see the url change (it uses a GET request).
On Sunday, October 27, 2013 1:37:08 PM UTC-7, melmg wrote:
>
> Hello,
> I am trying to understand how to set up communication between a
> microcontroller (Stellaris LM3S8962 Evaluation board) and a Web2py
> application hosted in Google App Engine. The Stellaris can host a web
> server and I have a webserver demo that uses CGI on the Stellaris. The demo
> allows you to change the LED state (on/off) on the board and also to
> display text via a form on the Stellaris web browser. What I am trying to
> do is to be able to do the same but from the web2py application. From what
> I've gathered, I'd have to send the request via an http header (right?)....
> I'm just unsure as to how to write the code in web2py to do that. Also, I
> have the board directly connected to my laptop and it defaults to a
> specific IP address. Can someone help me? Every little bit helps, I'm
> really confused.
>
> This is the Stellaris file with the form for further clarification. It is
> called *io_cgi.ssi*
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <!-- Copyright (c) 2009-2013 Texas Instruments Incorporated. All rights
> reserved. --><!--#FormVars-->
> <html><head>
> <meta content="text/html;charset=ISO-8869-1" http-equiv="content-type"
> ><title>I/O Control Demo 2</title>
>
>
> <script type="text/javascript">
> <!--
> function SetFormDefaults()
> {
> document.iocontrol.LEDOn.checked = ls;
> document.iocontrol.PWMOn.checked = ps;
> document.iocontrol.PWMFrequency.value = pf;
> document.iocontrol.PWMDutyCycle.value = pd;
> }
> //-->
> </script>
> <style type="text/css">
> body
> {
> font-family: Arial;
> background-color: white;
> margin: 10px;
> padding: 0px
> }
> h1
> {
> color: #7C7369;
> font-family: Arial;
> font-size: 24pt;
> font-style: italic;
> }
> h2
> {
> color: #000000;
> font-family: Arial;
> font-size: 18pt;
> font-style: bold;
> }
> h3
> {
> color: #7C7369;
> font-family: Arial;
> font-size: 12pt;
> font-style: bold;
> }
> </style>
> </head>
> <body onload="SetFormDefaults()">
> <table width="100%" border="0" cellspacing="0" cellpadding="0">
> <tr>
> <td align="left" valign="center">
> <img src="./images/ti_logo.gif">
> </td>
> <td align="center" valign="center">
> <h1>Stellaris<small><sup>®</sup></small> LM3S8962 Evaluation Kit</h1>
> </td>
> </tr>
> </table>
> <table width="100%">
> <tbody>
> <tr>
> <td align="left" valign="top" width="25%">
> <br>
> <ul>
> <li> <a href="index.htm">About TI</a>
> <br>
> <br>
> </li>
> <li> <a href="family.htm">About the Stellaris Family</a>
> <br>
> <br>
> </li>
> <li> <a href="block.htm">Block Diagram</a>
> <br>
> <br>
> </li>
> <li> <a href="io_http.htm">I/O Control Demo 1<br>
> (HTTP Requests)</a>
> <br>
> <br>
> </li>
> <li><a href="io_cgi.ssi">I/O Control Demo 2<br>
> (SSI/CGI)<br>
> <br>
> </a></li>
> </ul>
> </td>
> <td align="left" valign="top" width="75%">
> <center>
> <h2 align="center">I/O Control Demo 2</h2>
> </center>
> <hr size="2" width="100%">
> <ul>
> </ul>
> This demonstration shows another method of performing control
> and status reporting. This time, we use Server Side Include tags to
> replace text in the page as it is being server from the Stellaris board
> and standard HTML forms to send data to a CGI handler running on the
> board. This example does cause the page to be reloaded
> whenever
> form data is submitted but it involves less complex HTML to
> perform the task.<br>
> <br>
> <table align="center" border="1" width="80%">
> <tbody>
> <tr>
> <td>
> <form method="get" action="iocontrol.cgi" name="iocontrol">
> <table align="center" border="0" cellpadding="2" cellspacing="2" width=
> "100%">
> <tbody>
> <tr>
> <td align="left" valign="top"><b>Control</b></td>
> <td align="center" valign="top"><b>Current</b></td>
> <td align="center" valign="top"><b>New</b></td>
> </tr>
> <tr>
> <td align="left" valign="top">LED
> State</td>
> <td align="center" valign="top"><!--#LEDtxt--></td>
> <td align="center" valign="top"><input name="LEDOn" value="1" type=
> "checkbox"></td>
> </tr>
> <tr>
> <td align="left" valign="top">PWM
> State</td>
> <td align="center" valign="top"><!--#PWMtxt--></td>
> <td align="center" valign="top"><input name="PWMOn" value="1" type=
> "checkbox"></td>
> </tr>
> <tr>
> <td align="left" valign="top">PWM
> Frequency (Hz)</td>
> <td align="center" valign="top"><!--#PWMfreq--></td>
> <td align="center" valign="top"><input maxlength="4" size="4" name=
> "PWMFrequency" value=""></td>
> </tr>
> <tr>
> <td align="left" valign="top">PWM
> Duty Cycle (%)</td>
> <td align="center" valign="top"><!--#PWMduty--></td>
> <td align="center" valign="top"><input maxlength="3" size="3" name=
> "PWMDutyCycle" value=""></td>
> </tr>
> <tr>
> <td colspan="3" rowspan="1" align="center" valign="middle">
> <input name="Update" value="Update Settings" type="submit"></td>
> </tr>
> </tbody>
> </table>
> </form>
> </td>
> </tr>
> </tbody>
> </table>
> <ul>
> </ul>
> <br>
> <table align="center" border="1" cellpadding="2" cellspacing="2" width=
> "80%">
> <tbody>
> <tr>
> <td align="left" valign="top">
> <form method="get" action="settxt.cgi" name="settxt">
> <table border="0" cellpadding="2" cellspacing="2" width="100%">
> <tbody>
> <tr align="center">
> <td valign="top"><b>Display this
> text on the screen:<br>
> </b><input maxlength="20" size="20" name="DispText"> <input name="Display"
> value="Send Text" type="submit"></td>
> </tr>
> </tbody>
> </table>
> </form>
> </td>
> </tr>
> </tbody>
> </table>
> <br>
> </td>
> </tr>
> </tbody>
> </table>
> <table border="0" cellpadding="0" cellspacing="0" width="100%">
> <tbody>
> <tr>
> <td align="right" valign="center">
> <h1><br>
> </h1>
> </td>
> <td align="right" valign="center">
> <h3>Copyright © 2009-2013 Texas Instruments Incorporated. All
> rights reserved.</h3>
> </td>
> </tr>
> </tbody>
> </table>
> </body></html>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.