Difference between revisions of "ECE 434 BeagleCom"

From eLinux.org
Jump to: navigation, search
(Added the Work Breakdown and Future Work section of the Wiki)
m
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:ECE497 |PT]]
 
 
[[Category:ECE434Fall2022 |PT]]
 
[[Category:ECE434Fall2022 |PT]]
 
{{YoderHead}}
 
{{YoderHead}}
  
Team members: [[user:Amadeus|Glody Mutebwa]] [[user:Riveraar|Angel Rivera]]
+
Team members: [[user:Amadeus|Glody Mutebwa]] and [[user:Riveraar|Angel Rivera]]
  
  
 
== Executive Summary ==
 
== Executive Summary ==
  
Peer-to-Peer Network System aka '''BeagleCom'''
+
Communication Network System aka '''BeagleCom'''
  
The operation is based around the concept of a centralized tracker and an associated swarm of peers. A user (peer) joins a P2P system by contacting the tracker. Any peer in the network that is registered, can upload files in the network and download files from the network. Peers which are online communicate with each other with the help of tracker. When multiple peers requesting for the same file, the publisher splits the file into chunks and different chunks are sent to each peer, and the peers download the missing chunks from each other, thus both download time and load on the server is reduced. The peers select the chunk to be downloaded using piece selection algorithm. Peers can upload file to another peer as well as download from another peer simultaneously.
+
The objective of the project is to equips the BeagleBone with native communication tools. Included are an irc client which connect to the [https://webchat.freenode.net/ Freenode] server and can communicate with anyone available online via a specific channel. We also have a file sharing system that allows the BeagleBone to share and receive files from continually.
  
== Prerequisites ==
+
== Packaging ==
==== Software Requirement ====
+
Our project consists the LCD display, 2 LEDs (red and green) and the BeagleBone Black.
 +
 
 +
The two LEDs are connected through P9_11 and P9_12.
 +
The LCD display is connected for a setup of SPI1.
 +
== Installation Instructions ==
 +
If you want to install the project onto your own BeagleBone, be sure to go to the [https://github.com/Amadeus-source/BeagleCom/tree/final Github page] and clone the project. The README.md file lists the proper commands in order to run certain parts of the project.
 +
 
 +
Be sure to also have Python installed on the BeagleBone in order to run certain pieces of code.
 +
 
 +
== User Instructions ==
 +
; After you cloned the project into your BeagleBone Black, move to the source folder :
 +
    bone$ cd BeagleCom/src
 +
 
 +
; If you want to start the IRC client and start chatting, follow the command line down below.  :
 +
    bone$ ./irc_client.py <username> <channelname>
  
; Install G++ compiler :
+
The <username> is what your name you want it to be when others see you at the IRC channel, and the <channelname> is the name of the IRC channel. We set up a channel specifically called #BeagleCom at [https://webchat.freenode.net Freenode.] You can test this out by joining the IRC channel through a host computer and see if your BeagleBone joins the IRC channel. You do not need the # when entering the channel name on the command line. Note that this will not work if an IRC channel has a password to enter.
    > sudo apt-get install g++
 
; Install OpenSSL Library :
 
    > sudo apt-get install openssl
 
  
;Platform : Linux
+
When you receive a message from the IRC channel, the LED linked to the client will flash to signify that you have received it.
;Compilation
 
:tracker :
 
> g++ tracker.cpp -o tracker -pthread
 
:client :
 
> g++ peer.cpp -o peer -lssl -lcrypto -pthread
 
  
;Run code
 
:Tracker :
 
> `./tracker​ <TRACKER INFO FILE> <TRACKER NUMBER>`
 
>
 
> ex: ./tracker tracker_info.txt
 
:Client :
 
* Run code
 
    > `./peer​ <IP> <PORT> <TRACKER INFO FILE>
 
    >
 
    > ex: ./peer 127.0.0.1 5000 tracker_info.txt
 
* Create user account:
 
    > create_user​ <user_id> <password>
 
* Login:
 
    > login​ <user_id> <password>
 
* Create Group:
 
    > create_group​ <group_id>
 
* Join Group::
 
    > join_group​ <group_id>
 
* Leave Group:
 
    > leave_group <group_id>:
 
* List pending requests:
 
    > list_requests ​<group_id>
 
* Accept Group Joining Request:
 
    > accept_request​ <group_id> <user_id>
 
* List All Group In Network:
 
    > list_groups
 
* List All sharable Files In Group:
 
    > list_files​ <group_id>
 
* Upload File:
 
    > upload_file​ <file_path> <group_id​>
 
* Download File:​
 
    > download_file​ <group_id> <file_name> <destination_path>
 
* Logout:​
 
    > logout
 
* Show_downloads: ​
 
    > show_downloads
 
* Stop sharing: ​
 
    > stop_share ​<group_id> <file_name>
 
  
== Working ==
+
; If you want to start receiving files from another BeagleBone or host computer, run this command line :
* Peers are different instances of the same code client.cpp.
+
     bone$ ./receiver.py
* Each peer/user should create an account and register with tracker.
 
* Login using the user credentials.
 
* Tracker maintains information of clients with their files(shared by client) to assist the clients for the communication between peers.
 
* User can create Group and the one who created the group would become admin of that group.
 
* User can fetch list of all Groups in server.
 
* User can join/leave group. Peer should send request in order to join any group. 
 
* Only group admin can accept group join requests.
 
* Upload file across group: Shares the filename and SHA1 hash of the complete file as well as piecewise SHA1 with the tracker.
 
* Fetch list of all sharable files in a Group.
 
* Download 
 
    ** Retrieve the list of peers sharing that file, from tracker.
 
     ** download file from multiple peers (different pieces of file from different peers - piece selection algorithm ) simultaneously and all the files which client downloads will be shareable to other users in the same group. File integrity is ensured using SHA1 comparison.
 
* Piece selection algorithm used: 
 
* Show downloads.
 
* Stop sharing file.  
 
* Logout - stops sharing all files.
 
* Whenever client logins, all previously shared files before logout would automatically be on sharing mode.
 
== Assumptions ==
 
* Only one tracker is implemented and that tracker should always be online.
 
* The peer cannot login from different IP addresses.
 
* files of size more than 500kb cannot be downloaded properly.
 
* File paths can be absolute/relative.
 
  
== Packaging ==
+
; When you run this code, it'll ask for a port and a local host IP :
 +
    Enter port : {insert port # here}
 +
    Enter host (ex:localhost): {insert host # here}
 +
    Listening on port {port#}
  
== Installation Instructions ==
+
; On the other side (whether through BeagleBone or host PC), run this command to send the file to the receiving BeagleBone :
 +
    bone$ ./sendfile.py -i <localhost> -p <port> -f <file>
  
== User Instructions ==
+
The <localhost> should be whatever the IP address of the Linux system that you're using, the <port> was of your choosing (we usually use port 8888), and the <file> is the file that you send to the receiver (we tested using .txt files to speed testing).
  
 
== Highlights ==
 
== Highlights ==
 +
Our video demo: [https://youtu.be/C6mogTZ1gCY Youtube]
  
 
== Theory of Operation ==
 
== Theory of Operation ==
 +
 +
[[File:BeagleComTheoryBig.png|thumb|right|x400px|A high level look at the project on the interact between components]]
 +
 +
The IRC client: Make use of socket to open a connection and connect to an external IRC server. Process received information and format data before displaying it either on the Terminal or on the LCD display.
 +
 +
The receiver: Simply open a connection on a port and continually listen for incoming data on specified port.
 +
 +
The sender: Open a connection and send a specified file to a specific IP address and its specified port.
 +
 +
Our receiver would ideally run in the background before trying to send a file. To make a receiver available globally install NGROK and run ./ngriok tcp <port>.
  
 
== Work Breakdown ==
 
== Work Breakdown ==
Line 120: Line 80:
 
|}
 
|}
  
== Future Work ==
+
== Future Work/Conclusions ==
 
The overall idea was to create our own IRC webpage hosted by a BeagleBone and have the interface of having text and files be sent through that medium, such as a textbox that can be typed up and sent through using the IRC client that we implemented previously. There would be another button that would allow us to pick a file in the Linux system to be sent through, which would be then use the File Transmission Python code to send the file from one BeagleBone to another. This would all be done using Flask as an interface and HTML setup for proper use.
 
The overall idea was to create our own IRC webpage hosted by a BeagleBone and have the interface of having text and files be sent through that medium, such as a textbox that can be typed up and sent through using the IRC client that we implemented previously. There would be another button that would allow us to pick a file in the Linux system to be sent through, which would be then use the File Transmission Python code to send the file from one BeagleBone to another. This would all be done using Flask as an interface and HTML setup for proper use.
  
== Conclusions ==
+
In the end, we were able to have the project fully working, but we'd hope for more that can be more tangible as a product using all of its utilities. Due to problems that crop up at the last minute and not enough time to implement more of our ideas, we ended up with this current project. It's satisfactory but it could've been done better if more time was allotted.
  
 
{{YoderFoot}}
 
{{YoderFoot}}

Latest revision as of 14:20, 27 November 2023

thumb‎ Embedded Linux Class by Mark A. Yoder


Team members: Glody Mutebwa and Angel Rivera


Executive Summary

Communication Network System aka BeagleCom

The objective of the project is to equips the BeagleBone with native communication tools. Included are an irc client which connect to the Freenode server and can communicate with anyone available online via a specific channel. We also have a file sharing system that allows the BeagleBone to share and receive files from continually.

Packaging

Our project consists the LCD display, 2 LEDs (red and green) and the BeagleBone Black.

The two LEDs are connected through P9_11 and P9_12. The LCD display is connected for a setup of SPI1.

Installation Instructions

If you want to install the project onto your own BeagleBone, be sure to go to the Github page and clone the project. The README.md file lists the proper commands in order to run certain parts of the project.

Be sure to also have Python installed on the BeagleBone in order to run certain pieces of code.

User Instructions

After you cloned the project into your BeagleBone Black, move to the source folder 
   bone$ cd BeagleCom/src
If you want to start the IRC client and start chatting, follow the command line down below.  
   bone$ ./irc_client.py <username> <channelname>

The <username> is what your name you want it to be when others see you at the IRC channel, and the <channelname> is the name of the IRC channel. We set up a channel specifically called #BeagleCom at Freenode. You can test this out by joining the IRC channel through a host computer and see if your BeagleBone joins the IRC channel. You do not need the # when entering the channel name on the command line. Note that this will not work if an IRC channel has a password to enter.

When you receive a message from the IRC channel, the LED linked to the client will flash to signify that you have received it.


If you want to start receiving files from another BeagleBone or host computer, run this command line 
   bone$ ./receiver.py
When you run this code, it'll ask for a port and a local host IP 
   Enter port : {insert port # here}
   Enter host (ex:localhost): {insert host # here}
   Listening on port {port#}
On the other side (whether through BeagleBone or host PC), run this command to send the file to the receiving BeagleBone 
   bone$ ./sendfile.py -i <localhost> -p <port> -f <file>

The <localhost> should be whatever the IP address of the Linux system that you're using, the <port> was of your choosing (we usually use port 8888), and the <file> is the file that you send to the receiver (we tested using .txt files to speed testing).

Highlights

Our video demo: Youtube

Theory of Operation

A high level look at the project on the interact between components

The IRC client: Make use of socket to open a connection and connect to an external IRC server. Process received information and format data before displaying it either on the Terminal or on the LCD display.

The receiver: Simply open a connection on a port and continually listen for incoming data on specified port.

The sender: Open a connection and send a specified file to a specific IP address and its specified port.

Our receiver would ideally run in the background before trying to send a file. To make a receiver available globally install NGROK and run ./ngriok tcp <port>.

Work Breakdown

Work Contributor
IRC Communication Client Glody
File Transmission Code Glody
LCD Display Implementation Angel
Wiki and Hackster.io Angel

Future Work/Conclusions

The overall idea was to create our own IRC webpage hosted by a BeagleBone and have the interface of having text and files be sent through that medium, such as a textbox that can be typed up and sent through using the IRC client that we implemented previously. There would be another button that would allow us to pick a file in the Linux system to be sent through, which would be then use the File Transmission Python code to send the file from one BeagleBone to another. This would all be done using Flask as an interface and HTML setup for proper use.

In the end, we were able to have the project fully working, but we'd hope for more that can be more tangible as a product using all of its utilities. Due to problems that crop up at the last minute and not enough time to implement more of our ideas, we ended up with this current project. It's satisfactory but it could've been done better if more time was allotted.




thumb‎ Embedded Linux Class by Mark A. Yoder