Skip to main content
Associate
June 13, 2024
Question

faced problem while useing stm32f411re and nodemcu to handle a webpage

  • June 13, 2024
  • 2 replies
  • 1106 views

Hi im trying to make up a iot curtain right now and using stm32f411re with nodemcu to connect them to my wifi.i am testing all the sensors and wifi sector separated so non of the sensors are connected to stm32 right now just nodemcu and stm32. so i have tested to make a webpage to have a button to light up ld2 led and when i modified the code like below, the mcu still connected to wifi, gave the IP address to connect, but webpage gives me ERR_CONNECTION_REFUSED how do i solve this problem?

    2 replies

    Senior III
    June 25, 2024

    You can try to ping to some address outside from stm32  so that we are sure the path is correctly established.  Then enable some debug messages in the server code to print via uart when some incoming connection happening to server and server return message. 

    JisungAuthor
    Associate
    June 25, 2024

    i have tried to ping the stm32 from my laptop and i could get the reply. all the AT command seems to work fine as it is printing out all the command are successfully done. the problem here is, when i try to access to the ip address of stm32 and get into the html code of it, i get err_connection_refused

    February 25, 2026

    Hi!

    If you're getting ERR_CONNECTION_REFUSED but the NodeMCU is connected to WiFi and showing an IP, it usually means the web server isn’t actually running or not listening properly.

    Please check:

    Make sure server.begin(); is called after WiFi connects

    Confirm you're using the correct IP and port (usually port 80)

    If using ESP8266WebServer, ensure server.handleClient(); is inside the loop

    Check Serial Monitor to confirm the server started successfully

    Try a very basic webserver example first to isolate the issue

    Since you're building a smart curtain system, it's important that the web server layer is stable before integrating STM32 communication or motor control logic.

    Fix the server reliability first, it will make your smart curtain project much easier to scale and debug later.