Hi,
I need a little (read lot) of help here, I have a Raspberry Pi running with the embedded web pages, this has proved good for debugging etc but now I need to move on a bit and create my own which should be fun.
I have only found examples for ESP32 / 8266 but I think this is not for applicable for the Pi. It mentions the index.html file should be in the source directory or a specific one but that appears to be just for SD card.
From what I understand the Pi needs the Index.html file to be in directory ///var/www/html/
If this is the case do I just need to make the directory $(///var/www/html/) in the webserver source files property.
Regards,
Bob
Raspberry Pi web pages (non embedded) location
-
- Posts: 283
- http://meble-kuchenne.info.pl
- Joined: Sat Mar 19, 2022 4:53 pm
- Has thanked: 25 times
- Been thanked: 32 times
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: Raspberry Pi web pages (non embedded) location
Hi Bob,
Currently the Webserver component in external file mode only works with the File SD component to take the files from an external SD card and this won't work on the RPI unless you have a second SD card connected to the IO pins.
However I've been developing a new component that will allow for direct file access on the RPI and I'm discussing it here.
viewtopic.php?p=8775#p8775
Hopefully it's something we can get working for you very soon. It is currently close, I need to get the directory navigation working and then we should be there.
Currently the Webserver component in external file mode only works with the File SD component to take the files from an external SD card and this won't work on the RPI unless you have a second SD card connected to the IO pins.
However I've been developing a new component that will allow for direct file access on the RPI and I'm discussing it here.
viewtopic.php?p=8775#p8775
Hopefully it's something we can get working for you very soon. It is currently close, I need to get the directory navigation working and then we should be there.
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: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: Raspberry Pi web pages (non embedded) location
Hi Bob,
All working now for me, I've placed the website files in the same folder as the Flowcode project but you could try placing the files elsewhere. e.g. using a folder named web simply set the root directory to "web/" without the quotes. Files in sub directories etc should also be fine as long as the HTML contains the correct relative or absolute URL.
You could also try a root directory of "///var/www/html/" without the quotes for a more standard location for the html files to live.
You will need to goto Help -> Library Updates and change Files in use to Full database to get the latest component and CAL file.
Here's an example that's working well for me.
I've also added float and long functions for the In and Out substitutions so hopefully should make things easier for you.
Let me know how you get on.
All working now for me, I've placed the website files in the same folder as the Flowcode project but you could try placing the files elsewhere. e.g. using a folder named web simply set the root directory to "web/" without the quotes. Files in sub directories etc should also be fine as long as the HTML contains the correct relative or absolute URL.
You could also try a root directory of "///var/www/html/" without the quotes for a more standard location for the html files to live.
You will need to goto Help -> Library Updates and change Files in use to Full database to get the latest component and CAL file.
Here's an example that's working well for me.
I've also added float and long functions for the In and Out substitutions so hopefully should make things easier for you.
Let me know how you get on.
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
Re: Raspberry Pi web pages (non embedded) location
Hi Ben,
Thanks for doing this, from what I have seen I assume that all I need to do is add "SetOutValueXX" and then add the corresponding %xx to my web page.
Regards,
Bob
Thanks for doing this, from what I have seen I assume that all I need to do is add "SetOutValueXX" and then add the corresponding %xx to my web page.
Regards,
Bob
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: Raspberry Pi web pages (non embedded) location
That's right Bob, any problems then let us know.
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
Re: Raspberry Pi web pages (non embedded) location
Hi Ben,
I have finally got round to trying this out with a simple counter, so far no good.
This is the index.html file
And this is the test file
I have tried with the index.html file in /var/www/html/ and no data, I tried it in the project folder but could not get it to run. I may be doing it wrong but tried 192.168.1.220/home/pi/index.html and just got Not found error.
I would rather have the web pages in /var/www/html/ as that appears to be where they normally are but open to suggestions.
Bob
I have finally got round to trying this out with a simple counter, so far no good.
This is the index.html file
Code: Select all
<html>
<title>Raspberry Pi Test Page</title>
<body>
<h1>Raspberry Pi Test Page.</h1>
TestData = %0 <br></h1>
TestString = %1 </h1>
</body>
</html>
I would rather have the web pages in /var/www/html/ as that appears to be where they normally are but open to suggestions.
Bob
Re: Raspberry Pi web pages (non embedded) location
I just wondered if there is any information as to how the transfer of data happens between the flowcode app and the web server. Is there any diagnostic software to see where the problem lies.
Bob
Bob
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: Raspberry Pi web pages (non embedded) location
Hi Bob,
First you need to remove the 1 second delay from your program as that will only add delay to the server being able to jump on page requests as they happen.
Also you don't currently need the SetFileIndex macro as you're not dealing with multiple files. I see you have the CSV component there too so I've left these in.
The File_RPI component has it's root folder set to nothing, this should be the same as the project folder, I've changed this to /var/www/html/ for you so hopefully the Pi will look in the html folder for the served files. Please note I haven't personally tried this but it should work ok.
Your web browser path should be 192.168.1.220/index.htm or for the index page you can get away with just 192.168.1.220
You had .html but the standard is usually .htm so this might be worth double checking.
First you need to remove the 1 second delay from your program as that will only add delay to the server being able to jump on page requests as they happen.
Also you don't currently need the SetFileIndex macro as you're not dealing with multiple files. I see you have the CSV component there too so I've left these in.
The File_RPI component has it's root folder set to nothing, this should be the same as the project folder, I've changed this to /var/www/html/ for you so hopefully the Pi will look in the html folder for the served files. Please note I haven't personally tried this but it should work ok.
Your web browser path should be 192.168.1.220/index.htm or for the index page you can get away with just 192.168.1.220
You had .html but the standard is usually .htm so this might be worth double checking.
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
Re: Raspberry Pi web pages (non embedded) location
Hi Ben,
The one second delay was so the number was incrementing fast but that does not matter for this test.
The file was modified from one where I had both CSV & webserver and I did not remove the setfile index (I think).
The index.html file was created when I followed a tutorial for setting up the webserver, at the moment I do not seem to be able to rename it, probably due to permissions.
I am wondering if the actual issue is the file locations. The web files are in /var/www/html which is where the tutorial says they should be and the flowcode project is in /home/pi/ which is where it is downloaded to and i do not think there is an option to redirect.
I did try to move the index.html to the same directory as the flowcode project but then I cold not see anything even if I tried to access the file directly.
Just out of curiosity, on another device where I use the embebded web page, where is it located as i do not have a /www/html/ folder and it is not in the flowcode project folder either?
Bob
The one second delay was so the number was incrementing fast but that does not matter for this test.
The file was modified from one where I had both CSV & webserver and I did not remove the setfile index (I think).
The index.html file was created when I followed a tutorial for setting up the webserver, at the moment I do not seem to be able to rename it, probably due to permissions.
I am wondering if the actual issue is the file locations. The web files are in /var/www/html which is where the tutorial says they should be and the flowcode project is in /home/pi/ which is where it is downloaded to and i do not think there is an option to redirect.
I did try to move the index.html to the same directory as the flowcode project but then I cold not see anything even if I tried to access the file directly.
Just out of curiosity, on another device where I use the embebded web page, where is it located as i do not have a /www/html/ folder and it is not in the flowcode project folder either?
Bob