Rishikesh38 / Wireless-Image-Transfer-Custom-OS

This repo is to hold the "Projects" portion of my final project.
0 stars 0 forks source link

Create server socket and implement frame transfer #4

Closed Rishikesh38 closed 11 months ago

Rishikesh38 commented 1 year ago

Implement Socket programming to transfer images from server Raspi

DoD : 1) A server socket should be successfully created on the Raspberry Pi to listen for/send to incoming connections. 2) Code should be implemented to capture frames/images from a camera connected to the Raspberry Pi. 3) The captured frames/images should be successfully transmitted over the established socket connection to the connected client.

Blockers :

1) If issues faced during #3 then this transfer have issues too.

2) I encountered an obstacle when attempting to execute the server_sock program. The open_device function did not function as expected and generated the following error :

Image

The "bad address" issue was likely caused by an invalid or inaccessible value assigned to the dev_name variable. In the original code, dev_name was assigned the value from the command line argument (argv[1]), but this might not have been a valid device path or could have been an uninitialized or incorrect value.

By changing the assignment to dev_name = "/dev/video0", a specific and commonly used video device path (/dev/video0) was provided. This change ensures that the program explicitly uses the video device at /dev/video0, which is a typical device path for video capturing on Linux systems.

In essence, specifying dev_name = "/dev/video0" eliminates the ambiguity or potential error associated with relying on a command line argument that might not have been provided or might have contained an invalid value. It's a way of hardcoding a known, working value for the video device, thus resolving the "bad address" issue.

Rishikesh38 commented 11 months ago

The Implementation of Server side of socket is done and can be found at Here. I encountered a significant challenge when running the server_sock program, as detailed in the "Blockers" section above. After solving the blocker, the server successfully accepted a connection and transmitted data, as evidenced by the screenshot provided. For a visual representation of the actual image received by the client, please refer to the associated issue linked here

Image