This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HTTP server application

Other Parts Discussed in Thread: MSP430F5529, MSP430F2618

Hi,

I have ported HTTP SERVER APPLICATION of MSP430F5529 to my MCU.

I have loaded HTML pages of the application successfully. 

But instead of WHEEL POSTION and WHEEL VOLTAGE of the demo i want to display internal temperature of my MCU.

I have replaced wheel.c and Wheel.h files content for reading internal temperature but when i load the binary generated to FlashDBcontent.c and run, only LEDs are operating dynamically but not displaying internal temperature value dynamically.

Any help is appreciated...

Regards.

  • Hi Uma,

    I believe that this depends on how the MCU is sending the temperature data and also depends on your implementation of the HTML page is using it.

    Can you please give more details on how you are using the data?

    Thanks & Regards,
    Raghavendra

  • Hi Raghavendra,

    I have replaced wheel.c file content with "MSP430x261x_adc12_10.c" example of MSP430F2618 MCU 

    and the return value of temperature is used to display on the web page.

    .

    <!DOCTYPE html>
    <html>
      <head>
        <title>CDAC</title>
    
        <style type="text/css">
          body {
    	
            background-color: #FFFFCC;  
    	margin-left: 20%;
            margin-right: 20%;
            border: 1px dotted gray;
            padding: 10px 10px 10px 10px;   
    	font-family: sans-serif;
          }
        </style>
    </head>
    
     <body>
    
       <h1 align=center><font color="#264984"><img src= "logo.gif" align="middle"/><br>HTTP WEB SERVER</font></h1>
    <table border="0" align=center width=2000px height=590px>
    <tr>
    <td align=center width=20></td>
    <td width=450px align=left valign="top">
    <h2> <font color="#264984"> Dynamic LEDs Action: </font></h2>
    
    <form>
    <input id="LEDno4" type="checkbox" name="LED_4" value="LED_4" onclick="ToggleLED('4')">LED 1 
    <input id="LEDno5" type="checkbox" name="LED_5" value="LED_5" onclick="ToggleLED('5')">LED 2
    <input id="LEDno6" type="checkbox" name="LED_6" value="LED_6" onclick="ToggleLED('6')">LED 3
    <input id="LEDno7" type="checkbox" name="LED_7" value="LED_7" onclick="ToggleLED('7')">LED 4
    <input id="LEDno8" type="checkbox" name="LED_8" value="LED_8" onclick="ToggleLED('8')">LED 5
    </form>
    <p id = Temperature_Value"> </p>
    <h3> <font color="#264984">MSP430F2618 Temperature Sensor Value = <id="Temperature_Value"></h3>
    
    
    <h2><font color="#264984"> Accelerometer Data: </font> </h2>
    <h3><font color="#264984"> X-axis data :</font></h3>
    <table border="1" width=316px height=35px >
    <tr><td><table border="0" width=316px height=35px><tr><td id="slider1"></td><td></td></tr></table></td></tr>
    </table>
    <h3><font color="#264984"> Y-axis data :</font></h3>
    <table border="1" width=316px height=35px >
    <tr><td><table border="0" width=316px height=35px><tr><td id="slider1"></td><td></td></tr></table></td></tr>
    </table>
    <h3><font color="#264984"> Z-axis data :</font></h3>
    <table border="1" width=316px height=35px >
    <tr><td><table border="0" width=316px height=35px><tr><td id="slider1"></td><td></td></tr></table></td></tr>
    </table>
    <td align=cneter width=300></td>
    </tr>
    </table></font>
    
    <script>  
    
    var HTTPrequest = new XMLHttpRequest();
    var count = 0;
    var receivedResponse = 1;
    var sendNo=0;
    
    function ToggleLED(LEDnum)
    {
    	HTTPrequest.open("POST","/led-status?num="+LEDnum+"&action=toggle", true);
    	HTTPrequest.send();
     }
    
    function periodicUpdate(){
    	if(receivedResponse == 1 || count >= 4)
    	{
    		if(sendNo<3)
    		{
    			HTTPrequest.open("POST","/wheel-status?&action=getstatus", true);
    			HTTPrequest.send();
    			receivedResponse = 0;
    			count = 0;
    			sendNo++;
    			HTTPrequest.onreadystatechange = function()
    			{
    				if (HTTPrequest.readyState==4 && HTTPrequest.status==200)
    				{
    					receivedResponse = 1;
    					sendNo=0;
    					document.getElementById("Temperature_Value").innerHTML = HTTPrequest.responseText;
    					
    					
    				}
    			}
    		}
    		
    	}
    	count = count + 1;
    	setTimeout(function () {periodicUpdate(); }, 1000);
    }
    
    
    </script>
    
      </body>
    </html>

    Above is the web page i modified.

    Please help.

    Regards.