User mini profile

you don't want the JS to be executed on the esp32instead you want it transferred by esp32 http to your browser and there it will run

try this way:

on the esp32 add some code and a route to the http server that will provide the analog value inside a json objI don't know the arduino method for this but there should be onelet's say, as an example, that on a "GET /api/analog/g1" you will receive something like { "gauge": "g1", "value": 1234 }

now change your JS file to add a function that will requests the esp32 for new values and update the gaugethe request will have to be AJAX looking something like this: