A complete ONT (Optical Network Terminal) registration system for Huawei MA5683T OLT devices with web-based interface and detailed logging.
- π ONT Discovery: Automatic discovery of ONTs using autofind
- π ONT Registration: Complete registration flow with validation
- β Verification: Post-registration verification and status checking
- π Real-time Monitoring: Board status and ONT information
- π Secure Authentication: Session-based OLT login
- π Detailed Logging: Step-by-step process logging
- π― User-friendly Interface: Modern React-based web interface
- Python 3.8+
- Node.js 14+
- Access to MA5683T OLT device
- Network connectivity to OLT
-
Clone the repository
git clone <repository-url> cd OLT-backend
-
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Python dependencies
pip install flask flask-cors flask-sqlalchemy paramiko
-
Configure OLT settings Edit
config.pywith your OLT details:OLT_CONFIG = { "host": "your_olt_ip", "port": 3212, "board": "0/0", "prompt": "MA5683T>", "timeout": 10 }
-
Start the backend server
python app.py
The API will be available at
http://localhost:5000
-
Navigate to frontend directory
cd frontend -
Install Node.js dependencies
npm install
-
Start the frontend development server
npm start
The web interface will be available at
http://localhost:3000
- Open the web interface
- Enter your OLT credentials
- Click "Login to OLT"
- Navigate to "ONT Registration" tab
- Click "Display ONT Autofind All"
- Review discovered ONTs
- Click "Use This ONT" to auto-fill registration form
- Fill in registration parameters:
- Board ID: e.g., "0/0"
- Port ID: 1-16
- ONT ID: 1-128
- Serial Number: ONT serial number
- Description: ONT description
- Click "Register ONT"
- Review registration log
- Use the verification form with same parameters
- Click "Verify ONT Registration"
- Review verification results
POST /olt-login- Login to OLTPOST /olt-logout- Logout from OLTPOST /olt-quit- Quit OLT session
GET /ont-autofind- Discover ONTsPOST /ont-register- Register ONTPOST /ont-verify- Verify ONT registrationGET /ont-info/{description}- Get ONT infoGET /ont-status/{board_id}/{ont_id}- Get ONT status
GET /all-boards- Get all boardsGET /board-detail/{board_id}- Get board detailsGET /board-status- Get board status
Edit config.py to match your OLT setup:
OLT_CONFIG = {
"host": "103.160.82.34", # Your OLT IP address
"port": 3212, # Telnet port
"board": "0/0", # Default board
"prompt": "MA5683T>", # OLT prompt
"timeout": 10 # Connection timeout
}- Board ID: Format
X/Y(e.g., 0/0, 0/1) - Port ID: 1-16
- ONT ID: 1-128
- Serial Number: Minimum 8 characters
- Description: Any text string
Run the test suite to verify system functionality:
python test_ont_registration.pyNote: Update the test credentials in the script before running.
-
"Not logged in to OLT"
- Ensure you're logged in to the OLT
- Check session status
-
"Connection timeout"
- Verify OLT network connectivity
- Check firewall settings
- Confirm OLT is operational
-
"Invalid board format"
- Use correct format: X/Y (e.g., 0/0)
- Check board ID validation
-
"ONT registration failed"
- Verify serial number format
- Check if ONT ID is already in use
- Review detailed error log
- All API calls are logged in backend console
- Frontend shows detailed error messages
- Registration logs provide step-by-step information
- Verification results show detailed status
- Session-based authentication
- Input validation on frontend and backend
- Secure error handling
- Connection pooling and cleanup
- Timeout mechanisms
- Connection pooling for OLT sessions
- Board status caching (30 seconds)
- Efficient output parsing
- Automatic resource cleanup
- Non-blocking API operations
OLT-backend/
βββ app.py # Flask API server
βββ olt_client.py # OLT telnet client
βββ config.py # Configuration settings
βββ test_ont_registration.py # Test suite
βββ ONT_REGISTRATION_GUIDE.md # Detailed guide
βββ frontend/ # React frontend
β βββ src/
β β βββ components/
β β β βββ Dashboard.js
β β β βββ OntRegister.js
β β β βββ BoardExplorer.js
β β β βββ BoardStatus.js
β β βββ App.js
β βββ package.json
βββ README.md
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Check the troubleshooting section
- Review the detailed guide in
ONT_REGISTRATION_GUIDE.md - Run the test suite to verify functionality
- Check backend console logs for detailed error information
- Initial release
- Complete ONT registration system
- Web-based interface
- Detailed logging and verification
- Board management features