top of page

Creating a file-sharing web server in Python, running on a Raspberry Pi

Our final ALL project for our first year required us to create a file-sharing web server in Python that ran on a Raspberry Pi. We had to create a client in Python that would allow us to remotely access the Raspberry Pi and download and use a range of files. This project was to be completed in pairs. 

 

Week 1

For our first session, our task was to set up our Raspberry Pi's on the computer, after conducting a little research initially to understand what the Raspberry Pi could do. Before we could set up our server, we conducted a little research on setting up a Simple Python HTTP Server.

We also set up a burndown chart in preparation for the coming weeks of the project. This was important as it allowed us to properly plan how much time would be spent on each task, and it would enable us to compare our planned time spent working on the project against the actual amount of time we spent working each week. 

 

 

 

 

 

 

 

 

 

 

 

Week 2

Our tasks this week were to create a way for the user to download a text file or an image file. Before we could do so, we first had to create a GUI, for the user to be able to interact with the server. We created this interface using the 'Tkinter' library in Python, which came up with a python window when the code was run. Initially in this window we placed a header image we created in photoshop and the buttons that we would be using for the weeks task. 

 

In order to complete our first task, we had to initially create a text file that contained some text, on the Raspberry Pi. This was done in the command line using the command 'nano filename'. Then in Python, we created a function that would allow the user to click a button and the text would appear in the python window. We did this for two text files.

 

Our next task was a little more challenging. Firstly, we created two sets of buttons- one for downloading the image, and one for opening the image. When the user clicked on the open button, the image would open in photoshop, which was the default program for opening image files on the computer. Then we decided to condense this down to just one button; the user would click one button that would download then open the image file in photoshop. We did this for two image files.

 

Week 3

The tasks for this week was to allow the user to download an audio file and play it and download a video file

and play it. In order to download the audio file, we decided to use the pygame library, which, when the file

had been downloaded, opened the audio file in a separate python window and played it. For the video file,

we used the same method as with the image files. When the button was pressed, the video would open in

the default program, which for us was QuickTime Player.

 

To open each type of file on the client interface, we decided to get rid of the sets of buttons in place of four

text entry boxes, using the Tkinter library. The user then be able to search for the file they want by simply

typing it in and clicking the 'open' button, which would then download and open the selected file. We also

added a list box, containing all of the files on the Raspberry Pi, within the 'webserver' directory we had

created. This was so that the user could see the file names that they are able to search for and download.

This was also created using Tkinter. 

 

On reflection, there are a few areas where we could have improved. One improvements we would make,

had we had the time, would be to have only one text entry box, that would be used for all files. For us to be

able to do this, we would need to create a master function for downloading and opening each of the

different types of files. This would declutter our user interface and make it simpler to use. Another thing we

would have liked to improve was our use of pygame for opening the audio files. When the audio file was

downloaded and opened, a separate blank Python window appeared, and the audio played automatically.

To make this better, we could have provided the user with buttons allowing them to do such things as

play, pause, stop, or replay the audio clip. This would allow for more control when the file was opened. 

 

Overall, I felt that we spread out our workload sufficiently enough so that the workload didn’t build up and so that none of the work was left until the last minute. Although we didn’t not initially meet the expectations that we had set ourselves in our burn down chart, I still feel that we timed our work appropriately throughout the project, particularly towards the end. Also, our communication throughout the entirety of the project was good. We updated each other frequently about any progress we had made, and we had set up a Google Drive to keep track of the documents we were using. I feel that there are very few improvements that could be made to the way that the group went about completing the project. Our team work and communication were both effective and all work was completed within the allotted time frame.

  • facebook-square
  • Flickr Black Square
  • Twitter Square
  • Pinterest Black Square

© 2023 by Odam Lviran. Proudly created with Wix.com.

bottom of page