Ensure that the Raspberry Pi OS is installed and configured on Raspberry Pi 4. The latest version of the Raspberry Pi OS from the official Raspberry Pi website and follow the installation instructions provided.
Verify that the Debian-based system on your Raspberry Pi has the following dependencies installed:
- make: A build automation tool used to compile and build software projects.
- cmake: A cross-platform build system generator used to control the software compilation process.
- gcc: The GNU Compiler Collection, which includes compilers for C, C++, and other programming languages.
- lighttpd: The Lightweight HTTP Server, which will be used to serve the frontend interface and facilitate communication with the backend.
Clone the project repository containing the source code and necessary files to your Raspberry Pi:
git clone <project_repository_url>
Navigate to the project directory:
cd <project_directory>
Configure the lighttpd web server to serve the frontend interface. Ensure that the lighttpd.conf settings and flags are correctly configured to allow access to the frontend files.
Copy the frontend files (HTML, CSS, JavaScript) to the appropriate directory in the lighttpd web server root directory. This project is set up to be located at /var/www/dsaproject/html.
sudo cp -r DataStructure_and_Algorithm_Project/Frontend/* /var/www/dsaproject/html/
Compile the main.cpp file, which contains the backend functionalities responsible for processing measurement data:
cmake CMakeLists.txt
make
Copy the compiled executable file (DataStructAlg) to the CGI directory (cgi-bin) of the lighttpd web server:
sudo cp DataStructAlg /var/www/dsaproject/html/cgi-bin/
Verify that the lighttpd.conf settings and flags are correctly configured to enable CGI execution and access to the backend executable. Ensure that the necessary permissions are set to allow execution of the CGI scripts.
sudo nano /etc/lighttpd/lighttpd.conf
Restart the lighttpd web server to apply the configuration changes:
sudo service lighttpd force-reload
Deploy project in web browser by typing in http://127.0.0.1:8008 to the address bar.