Files
quality_recticel/py_app/PRINT_SERVICE_SETUP.md

74 lines
1.9 KiB
Markdown

# Windows Print Service Network Configuration Guide
## Current Issue
Your Flask server (Linux) cannot connect to Windows Print Service because they're on different machines.
## Solution Options
### Option 1: Same Machine Setup
If both Flask and Windows service are on the same machine:
```python
WINDOWS_PRINT_SERVICE_URL = "http://localhost:8765"
```
### Option 2: Different Machines (Recommended)
If Flask server (Linux) and Windows service are on different machines:
1. **Find Windows Machine IP Address:**
```cmd
# On Windows machine, run:
ipconfig
# Look for IPv4 Address, e.g., 192.168.1.100
```
2. **Update Configuration:**
```python
# In /app/print_config.py, change:
WINDOWS_PRINT_SERVICE_URL = "http://192.168.1.100:8765"
```
3. **Test Connection:**
```bash
# From Linux machine, test:
curl http://192.168.1.100:8765/health
```
### Option 3: Windows Firewall Configuration
Ensure Windows allows incoming connections on port 8765:
1. **Windows Firewall Settings:**
- Control Panel → System and Security → Windows Defender Firewall
- Advanced Settings → Inbound Rules → New Rule
- Port → TCP → 8765 → Allow the connection
2. **Test from Linux:**
```bash
telnet [WINDOWS_IP] 8765
```
### Option 4: Port Forwarding/Tunneling
If direct connection isn't possible, set up SSH tunnel or port forwarding.
## Quick Fix for Testing
1. **Get Windows IP Address**
2. **Update print_config.py with the IP**
3. **Restart Flask server**
4. **Test printing**
## Current Status
- ✅ Windows Print Service: Running (localhost:8765/health works)
- ❌ Network Connection: Flask can't reach Windows service
- 🔧 Fix Needed: Update WINDOWS_PRINT_SERVICE_URL with correct IP
## Example Commands
```bash
# 1. Find Windows IP (run on Windows):
# ipconfig | findstr IPv4
# 2. Test connection (run on Linux):
# curl http://[WINDOWS_IP]:8765/health
# 3. Update config and restart Flask
```