Skip to content

ojilon/WayerPC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ป Wayer - PC Server

NOTE, PROJECT ACTIVELY BEING DEVELOPED, CHANGES MAY NOT BE REFLECTED IMMEDIATELY IN THE README.md 
BUT THE BASIC USAGE MOSTLY REMAINS THE SAME

Python-based server for transferring files between your PC and Android phone through hotspot connection.

Wayer is a two-component project:

  • ๐Ÿ’ป PC Server - File server for handling requests (This Repository)
  • ๐Ÿ“ฑ Android Client - Connect and transfer files from your phone

๐Ÿš€ Quick Start

# Install dependencies
pip install -r requirements.txt

# Navigate to python folder
cd python

# Start the server
python server/app3.py

You should see:

Listening on <HOST>:<PORT>

๐Ÿ“‹ System Requirements

  • Python 3.x
  • MinGW64 or GCC (for C DLL compilation)
  • CMake 3.10+ (for building C DLL)

๐Ÿ”— Related Component

๐Ÿ“ฑ Android Client (Separate Repository)

Install and run the Android app on your phone to connect and transfer files.

๐Ÿ“– โ†’ Full Android Setup Guide
๐Ÿ”— โ†’ Go to Wayer Repository


๐Ÿ“‚ Project Structure

WayerPC/
โ”œโ”€โ”€ python/
โ”‚   โ”œโ”€โ”€ server/              # Main server code
โ”‚   โ”‚   โ”œโ”€โ”€ app3.py          # Entry point
โ”‚   โ”‚   โ”œโ”€โ”€ socket_server3.py
โ”‚   โ”‚   โ”œโ”€โ”€ Locate.py
โ”‚   โ”‚   โ”œโ”€โ”€ transfer.py
โ”‚   โ”‚   โ””โ”€โ”€ config.py
|   |   |__ ItemImporter.py
|   |  
โ”‚   โ””โ”€โ”€ Filesmanager/        # File utilities
โ”‚       โ””โ”€โ”€ FindRoot.py
โ”œโ”€โ”€ c/                       # C DLL source for file search
โ”œโ”€โ”€ build/                   # Build output directory
โ”œโ”€โ”€ CMakeLists.txt
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ README.md                # Quick overview
โ””โ”€โ”€ README_PC_END.md         # Detailed guide

๐ŸŽฏ Server Operations

/ask - File Download

Phone requests a file from the PC

/ask <filename>

/upload - File Upload

Phone sends a file to the PC

/upload <filesize> <filename>

Files automatically upload to the received/ folder.


๐Ÿ“š Full Documentation

For complete setup, configuration, compilation, and troubleshooting:

๐Ÿ‘‰ README_PC_END.md


๐Ÿ—๏ธ Project Architecture

Wayer (Complete File Transfer System)
โ”œโ”€โ”€ ojilon/WayerPC (This Repo)
โ”‚   โ”œโ”€โ”€ ๐Ÿ’ป Python Server + C DLL
โ”‚   โ”œโ”€โ”€ Languages: Python, C, C++, CMake
โ”‚   โ”œโ”€โ”€ Purpose: File server for handling requests
โ”‚   โ””โ”€โ”€ Role: Backend processing & file search
โ”‚
โ””โ”€โ”€ ojilon/Wayer (Separate Repo)
    โ”œโ”€โ”€ ๐Ÿ“ฑ Android Application
    โ”œโ”€โ”€ Language: Javas
    โ”œโ”€โ”€ Build: Gradle
    โ””โ”€โ”€ Purpose: Client app for file browsing & transfer

๐Ÿ”„ How It Works

System Flow

  1. Start this server on your PC

    python server/app3.py
  2. Install Wayer app on your Android phone

    • Use the Android repository to build the APK
  3. Connect phone to PC hotspot

    • Both devices need to be on the same network
  4. Use the app to transfer files

    • List files: ls
    • Navigate: cd <path>
    • Download: /ask <filename>
    • Upload: /upload <filepath>

๐Ÿ“ Folders

  • shared/ - Contains files available for download by the phone (auto-created if missing)
  • received/ - Stores files uploaded from the phone (auto-created if missing)
  • python/ - Main server code and utilities
  • c/ - C files
  • build/ - CMake build output directory + DLL file

๐ŸŽฎ Server Features

โœ… Handles /ask file download requests
โœ… Handles /upload file upload requests
โœ… Fast file searching with C DLL
โœ… Automatic folder creation
โœ… Connection logging and status reporting
โœ… Optimized for hotspot connections


๐Ÿ› ๏ธ Building the C DLL

The server uses a C DLL (libfilesearch.dll) for efficient file system searching.

To compile:

# Install dependencies
# - CMake 3.10+
# - MinGW64 or GCC

# Create and enter build directory
mkdir build
cd build

# Generate build files
cmake ..

# Build
cmake --build .

The compiled DLL will be in build/c/.


๐Ÿ“Š Key Components

File Purpose
app3.py Entry point - starts the server
socket_server3.py Core server logic handling /ask and /upload commands
Locate.py Utilities for finding files and folders, locating DLL
transfer.py File streaming and transfer functions
config.py Server configuration (HOST, PORT, etc.)

๐Ÿ”ง Configuration

Edit config.py to customize server settings:

  • HOST: Server listening address
  • PORT: Server listening port
  • Other connection parameters

๐Ÿšจ Troubleshooting

Issue Solution
DLL not found error Make sure libfilesearch.dll is in the c/ folder after compilation
Socket address in use Port may be occupied; change PORT in config.py
Folder creation failed Ensure the application has write permissions in the project directory
Connection issues Verify the PC and phone are connected to the same hotspot
File not found Check if the file exists in the project or shared folder

๐Ÿ“ Notes

  • The server creates necessary folders (shared/, received/) automatically if they don't exist
  • All file operations are logged to console
  • The C DLL handles efficient file system searching
  • Both devices must be on the same network (hotspot or WiFi)
  • Larger files may take longer depending on connection quality

๐Ÿ”— Links


๐Ÿ“ License

MIT License - See LICENSE file


Get started: Full PC Server Guide โ†’ | Android App Guide โ†’

About

project to connect pc to phone

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors