WJ2 for blinking LED on a Webserver

Added by Renato Giugni RG 12 months ago


I'm using WJ2 commercial license.

My project is to turn and LED on and off based on a webserver, similar to the tutorial example from Aimagin Model-Based Design for IoT.

My problem is that when I access the webpage and click the 'ON' and 'OFF' button, the ESP32 webserver only updates the LED status a few times, like 3 or 4.

After that, it just stops working.

I'm using ESP32 SPIFFS memory.

Could anyone help me please?

img1.png View img1.png 104 KB top level model. ESP32 is working in STA mode
img2.png View img2.png 66.7 KB HTTP Subsystem. Basically, json post request is read and turns LED on or on
img3.png View img3.png 37.4 KB HTML text
img4.png View img4.png 68 KB javascript function wich is called when button On/Off is pressed on the web browser interface

Replies (1)

RE: WJ2 for blinking LED on a Webserver - Added by Parth Maheshwari (พาร์ท) 12 months ago

Hi Renato,

Thank you for reaching out and apologies for the delayed response.

It's hard to tell where the problem lies without seeing your Simulink model and HTML/JS code that you have written. Have you tried this example already? Is it working as expected for you?

If yes, have you tried to compare from our Simulink model and HTML/JS code to see what is different?

Sincere regards,