esp32 display analog input in webpage

For general Flowcode discussion that does not belong in the other sections.
Post Reply
jancuaucamp
Posts: 5
http://meble-kuchenne.info.pl
Joined: Tue Aug 31, 2021 9:22 am
Has thanked: 1 time

esp32 display analog input in webpage

Post by jancuaucamp »

Good day.
Im trying to get an analog input on wroom 32 esp and sent to html webpage.
All the examples I found sent is to app developer and not a webpage.
In the video the person say there is some examples in the wiki,I cant find it .
Does anyone have a example to display a variable to an html webpage

Thanks

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: esp32 display analog input in webpage

Post by BenR »

Hello,

Here's a quick example that hopefully should help to show you the way.
ESP_Webpage.fcfx
(15.17 KiB) Downloaded 133 times

The outgoing substitution is referenced in the HTML code using the %0 text.

jancuaucamp
Posts: 5
Joined: Tue Aug 31, 2021 9:22 am
Has thanked: 1 time

Re: esp32 display analog input in webpage

Post by jancuaucamp »

Thanks ,That helped me alot.
Any change of an example how to recieve from webpage ?

medelec35
Matrix Staff
Posts: 1432
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 506 times
Been thanked: 469 times

Re: esp32 display analog input in webpage

Post by medelec35 »

Thanks, Ben.
It works great.
The only downside is the webpage will require refreshing if the ADC changes value.
There is a simple way around this.
To get the webpage to update every 5 seconds for example.
Within HTML Page 1 of Web Server properties add

Code: Select all

<meta http-equiv="refresh" content="5" >
So you will have:

Code: Select all

<html>
<body>
<h1>Flowcode Webserver</h1>
Webpage Created by Flowcode Webserver.<br />
ADC Value = %0.<br />
<a href="page2.htm">Click here for page2.</a>
<meta http-equiv="refresh" content="5" >
</body>
</html>
Martin

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: esp32 display analog input in webpage

Post by BenR »

Hello,

The example here shows how to pass data back in using a standard HTML form.

https://www.flowcode.co.uk/forums/viewt ... f=10&t=634

Or you can do it in a more static way just using say link URLs.

for example this would pass the following in values 0="100", 1="abcd"

<a href="index.htm?0=100&1=abcd" >Test Link</a>

stefan.erni
Valued Contributor
Posts: 738
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 170 times

Re: esp32 display analog input in webpage

Post by stefan.erni »

Hi to All

Webserver from Flowcode are working fine.
It's possible to read the page (values) on Windows, Android or iOS via Explorer.

What about an additional comand for the App Developper like "GET Value from Flowcode Web-Server"

Then you can also access the web server with the App Developper. Just read the page and extract the analog value.
That would be a nice addition command.
So it would be easy to query values with a time control in the Appdevelopper and to save them very easily in a log file.

And the convenience of the Flowcode web server remains

regards

Stefan

Post Reply