cancel
Showing results for 
Search instead for 
Did you mean: 

I am working on lwip, tcp/ip, RTOS application with stm32f746 discovery board . By clicking a button on the server with html page, i can toggle a LED . The problem is that, how do i get the text i wrote in an html page into the mcu?

adogan
Associate

I am working on lwip, tcp/ip, RTOS application with stm32f746 discovery board . By clicking a button on the server with html page, i can toggle a LED on the board with the help of the code below:

if (recv_err == ERR_OK)
 
  {
 
    if (netconn_err(conn) == ERR_OK) 
 
    {
 
      netbuf_data(inbuf, (void**)&buf, &buflen);
 
    
 
      if ((buflen >=5) && (strncmp(buf, "GET /", 5) == 0))
 
      {
 
        if (strncmp((char const *)buf,"GET /setled", 11) == 0) //setled is the name of the class
 
        {
 
            HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_1); // led on the board
 
        }
 
   }

The problem is that, how do i get the text i wrote in an html page into the mcu?

For example i have an input box, i write in :50, how can i get that if the number is 50 do this if 150 do another etc.

Thank you 🙂

3 REPLIES 3
Pavel A.
Evangelist III

>how do i get the text i wrote in an html page into the mcu?

There should be some button on the page. User clicks it and it sends a POST request to the server.

Or something more modern, like a websocket...

LwIP has typically used FSDATA to represent the files served up, basically taking files and creating C arrays and related structures which can subsequently be compiled and linked.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Sebastiaan
Senior

See also this and other videos (https://www.youtube.com/watch?v=yqTMGnk1nDU&t=1s) which is exactly what you're doing.