Page 1 of 1
regarding webserver
Posted: Sun Jan 12, 2020 1:00 pm
by kushishru
Hi Everyone,
I am able to control the Motor through the ESP32 wifi webserver and I am using PWM technique to control the Motor. Now I need this PWM values to be shown on the webserver instead of the serial monitor. Could anyone please let me know ,How do i do this ?
Thanks in Advance
Re: regarding webserver
Posted: Mon Jan 13, 2020 8:35 pm
by ESP_Sprite
What environment and webserver are you using? Can we see your code? What did you already try yourself and what did it do?
Re: regarding webserver
Posted: Fri Jan 17, 2020 12:13 am
by PeterR
Starting from basics:
Webpages are static. Your browser requests a page, you serve and that page gets rendered and displayed. End of transaction. Still screen.
So how do you get 'dynamic data' (time varying data) into your webpage?
EDIT: In order to update your browser rendering you need code (Javascript) running within your browser. You browser code may construct its own values (e.g. run an animation) or may fetch values from your server. Your choice. The following describes fetching approaches which is the substance of your question.
The clasic (fetch) approaches are AJAX/AJAJ. Research on w3schools. These days you also have mqtt and websockets to play with.
IMHO AJAX/AJAJ properly done is better documented and gives you easier interoperability. I can drive my products in a few VBA (Excel, Word etc) lines and so pass test automation to a reasonable hardware engineer.
MQTT/Websockets are a little more esoteric. I can also test an AJAX request on a browser, MQTT tests require a plug in and generally more hastle. Don't get me wrong MQTT has its place but (without knowing your exact requirements) AJAX/AJAJ seems at an easier starter.
Anyway, thats the crux. You need browser side code to update the (browser side) HTML/CSS DOM using javascript be that AJAX, MQTT or other protocol.