Hi Ben
I get your webserver from this topic.
viewtopic.php?f=9&t=739
I changed it a little and took the date and time as simulated AD values. I wrote these values in an HTML table. I can look at this table in Explorer and also automatically insert and refresh this table in Excel. I just have to enter the IP address. I would now like to read and process this table with the app developper. How can I do that?
regards
Stefan
how to choose the webserver for Excel and insert the tabel
App Developper: From Webserver to App Developper
-
- Valued Contributor
- Posts: 997
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: App Developper: From Webserver to App Developper
Hello Stefan,
That looks great.
Ok let me try and understand what exactly you're trying to do.
Are you A) trying to read the HTML table in a second instance of app developer say running on a different machine on the network, or B) trying to read back the processed data from Excel.
For A) have a look here.
https://www.flowcode.co.uk/wiki/images/ ... lient.fcfx
Your GET command might look like this.
For B) can you save the Excel file in CSV format, if you can then the CSV read/write component will help.
That looks great.
Ok let me try and understand what exactly you're trying to do.
Are you A) trying to read the HTML table in a second instance of app developer say running on a different machine on the network, or B) trying to read back the processed data from Excel.
For A) have a look here.
https://www.flowcode.co.uk/wiki/images/ ... lient.fcfx
Your GET command might look like this.
Code: Select all
"GET /index.htm HTTP/1.1\nHost: 192.168.1.10\n\n"
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 997
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
Re: App Developper: From Webserver to App Developper
Hi Ben
I only need version A.
I have different ESP32 web servers here in the building and for testing purposes I also have an AppDevelopper web server on a computer. The web server on the Appdevelopper works and is very convenient to not always program the ESP32. The HTML code remains the same, regardless of whether it is ESP32 or AppDevelopper Program
Yes, I will try the GET command. Thank you very much
The goal is that I can read the table from every room with a web browser (cell phone, tablet or notebook) and from my office I can then read out all clients via the Appdevelopper program and save the values.
The ESP32 web server and the Appdevelopper web server are already working.
With the AppDevelopper I just want to read a table in the received HTML code and recognize the words and values correctly regardless of the format
For that I'm trying to convert the HTML string from <table> to </table> into words and values.
regards
Stefan
I only need version A.
I have different ESP32 web servers here in the building and for testing purposes I also have an AppDevelopper web server on a computer. The web server on the Appdevelopper works and is very convenient to not always program the ESP32. The HTML code remains the same, regardless of whether it is ESP32 or AppDevelopper Program
Yes, I will try the GET command. Thank you very much
The goal is that I can read the table from every room with a web browser (cell phone, tablet or notebook) and from my office I can then read out all clients via the Appdevelopper program and save the values.
The ESP32 web server and the Appdevelopper web server are already working.
With the AppDevelopper I just want to read a table in the received HTML code and recognize the words and values correctly regardless of the format
For that I'm trying to convert the HTML string from <table> to </table> into words and values.
regards
Stefan
Code: Select all
<html>
<body>
<h1>Flowcode App Developer Webserver</h1>
<table>
<tr>
<th>Signal</th>
<th>Pin</th>
<th>Value</th>
</tr>
<tr>
<td>ADC1</td>
<td>A1</td>
<td>%11.</td>
</tr>
<tr>
<td>ADC2</td>
<td>A2</td>
<td>%12.</td>
</tr>
<tr>
<td>ADC3</td>
<td>A3</td>
<td>%13.</td>
</tr>
<tr>
<td>ADC4</td>
<td>A4</td>
<td>%14.</td>
</tr>
<tr>
<td>ADC4</td>
<td>A5</td>
<td>%15.</td>
</tr>
<tr>
<td>ADC4</td>
<td>A6</td>
<td>%16.</td>
</tr>
</table>
</body>
</html>
-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: App Developper: From Webserver to App Developper
This might work with the XML parser.
Let me have a play as that would potentially save you writing a finite state machine to parse through the raw text.
You could always format as XML on the server end and this might make things easier but then it probably wouldn't be as nice to look at if you need it to be presented in a table.
Let me have a play as that would potentially save you writing a finite state machine to parse through the raw text.
You could always format as XML on the server end and this might make things easier but then it probably wouldn't be as nice to look at if you need it to be presented in a table.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: App Developper: From Webserver to App Developper
Yes it does work as is with the XML parser. HTML and XML are very similar.
Here's a simple example to parse the data string and print data to the console.
You would just need to combine this with the example with the GET request and then you will be able to collect the data string from the server and parse through the data table.
Here's a simple example to parse the data string and print data to the console.
You would just need to combine this with the example with the GET request and then you will be able to collect the data string from the server and parse through the data table.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 997
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
Re: App Developper: From Webserver to App Developper
Hi Ben
Thanks a lot for the example. I put both together and it looks like it works,
but not enough characters are received. One times it will be 179 or then 19 or 79 or 139. I tried to make all the arrays bigger but without success.
regards
Stefan
Thanks a lot for the example. I put both together and it looks like it works,
but not enough characters are received. One times it will be 179 or then 19 or 79 or 139. I tried to make all the arrays bigger but without success.
regards
Stefan
- Attachments
-
- WEB_2021-11-10_11-24-58.jpg (18.74 KiB) Viewed 7425 times
-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: App Developper: From Webserver to App Developper
Hi Stefan,
So it's the Network Comms that is receiving not all the data. Maybe try adding a small delay in between issuing the GET command and receiving the data, this will allow the data to be collected and ready when you call the receive function. Maybe try a delay of 1s and see how you get on. If this works well then you can try reducing to see what you can get away with.
Another way might be to receive data and store into a circular buffer char by char, then try and receive more data and repeat until you get a timeout or instead search the CB for the "</html>" tag to indicate the end of the data.
I could maybe add routines to the CB component to allow you to easily store and retrive a string. I'll look into this now for you.
So it's the Network Comms that is receiving not all the data. Maybe try adding a small delay in between issuing the GET command and receiving the data, this will allow the data to be collected and ready when you call the receive function. Maybe try a delay of 1s and see how you get on. If this works well then you can try reducing to see what you can get away with.
Another way might be to receive data and store into a circular buffer char by char, then try and receive more data and repeat until you get a timeout or instead search the CB for the "</html>" tag to indicate the end of the data.
I could maybe add routines to the CB component to allow you to easily store and retrive a string. I'll look into this now for you.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 997
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
Re: App Developper: From Webserver to App Developper
Hi Ben
Perfect!
It's working with a delay 500ms (100ms is to short)
One more question
When I put the table (webserver) on my page on the Internet
How does the GET command look like?
regards
Stefan
Perfect!
It's working with a delay 500ms (100ms is to short)
One more question
When I put the table (webserver) on my page on the Internet
How does the GET command look like?
Code: Select all
"GET /index.htm HTTP / 1.1 \ nHost: https://www.tennwil.ch/\n\n"
regards
Stefan
- Attachments
-
- Web_Get_From_Server.fcsx
- (21.52 KiB) Downloaded 608 times
-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: App Developper: From Webserver to App Developper
Hi Stefan,
At the moment talking with a https server will be problematic. Can you connect using http instead?
We have started with https support for app developer but it's not really been well tested yet. It's on my list to do but at the moment it's low priority. I could try and bump it up if that would help.
At the moment talking with a https server will be problematic. Can you connect using http instead?
Code: Select all
"GET /index.htm HTTP / 1.1 \ nHost: http://www.tennwil.ch/\n\n"
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 997
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
Re: App Developper: From Webserver to App Developper
Hi Ben
I add the CSV writer and It is very convenient to save an Excel file on the PC with the data from a Flowcode web server
regards
Stefan
that's always okay with mebut it's not really been well tested yet
I add the CSV writer and It is very convenient to save an Excel file on the PC with the data from a Flowcode web server
regards
Stefan