Skip to main content
adogan
Visitor II
August 20, 2021
Question

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?

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 :)

This topic has been closed for replies.

3 replies

Pavel A.
August 21, 2021

>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...

Tesla DeLorean
Guru
August 21, 2021

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
Sebastiaan
Associate II
August 22, 2021

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