regarding webserver

Posts: 1
Joined: Sun Jan 12, 2020 12:38 pm

regarding webserver

Postby kushishru » Sun Jan 12, 2020 1:00 pm

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

Posts: 3746
Joined: Thu Nov 26, 2015 4:08 am

Re: regarding webserver

Postby ESP_Sprite » Mon Jan 13, 2020 8:35 pm

What environment and webserver are you using? Can we see your code? What did you already try yourself and what did it do?

Posts: 445
Joined: Mon Jun 04, 2018 2:47 pm

Re: regarding webserver

Postby PeterR » Fri Jan 17, 2020 12:13 am

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.
& I also believe that IDF CAN should be fixed.

Who is online

Users browsing this forum: No registered users and 29 guests