Files
geutebruck/geutebruck-api/docs/TROUBLESHOOTING_EMPTY_CAMERAS.md
Administrator 14893e62a5 feat: Geutebruck GeViScope/GeViSoft Action Mapping System - MVP
This MVP release provides a complete full-stack solution for managing action mappings
in Geutebruck's GeViScope and GeViSoft video surveillance systems.

## Features

### Flutter Web Application (Port 8081)
- Modern, responsive UI for managing action mappings
- Action picker dialog with full parameter configuration
- Support for both GSC (GeViScope) and G-Core server actions
- Consistent UI for input and output actions with edit/delete capabilities
- Real-time action mapping creation, editing, and deletion
- Server categorization (GSC: prefix for GeViScope, G-Core: prefix for G-Core servers)

### FastAPI REST Backend (Port 8000)
- RESTful API for action mapping CRUD operations
- Action template service with comprehensive action catalog (247 actions)
- Server management (G-Core and GeViScope servers)
- Configuration tree reading and writing
- JWT authentication with role-based access control
- PostgreSQL database integration

### C# SDK Bridge (gRPC, Port 50051)
- Native integration with GeViSoft SDK (GeViProcAPINET_4_0.dll)
- Action mapping creation with correct binary format
- Support for GSC and G-Core action types
- Proper Camera parameter inclusion in action strings (fixes CrossSwitch bug)
- Action ID lookup table with server-specific action IDs
- Configuration reading/writing via SetupClient

## Bug Fixes
- **CrossSwitch Bug**: GSC and G-Core actions now correctly display camera/PTZ head parameters in GeViSet
- Action strings now include Camera parameter: `@ PanLeft (Comment: "", Camera: 101028)`
- Proper filter flags and VideoInput=0 for action mappings
- Correct action ID assignment (4198 for GSC, 9294 for G-Core PanLeft)

## Technical Stack
- **Frontend**: Flutter Web, Dart, Dio HTTP client
- **Backend**: Python FastAPI, PostgreSQL, Redis
- **SDK Bridge**: C# .NET 8.0, gRPC, GeViSoft SDK
- **Authentication**: JWT tokens
- **Configuration**: GeViSoft .set files (binary format)

## Credentials
- GeViSoft/GeViScope: username=sysadmin, password=masterkey
- Default admin: username=admin, password=admin123

## Deployment
All services run on localhost:
- Flutter Web: http://localhost:8081
- FastAPI: http://localhost:8000
- SDK Bridge gRPC: localhost:50051
- GeViServer: localhost (default port)

Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 18:10:54 +01:00

320 lines
8.5 KiB
Markdown

# Troubleshooting: Empty Camera List
## Problem
```bash
curl http://localhost:8000/api/v1/cameras
# Returns: {"cameras": [], "total": 0}
```
## Understanding the Architecture
```
REST API
SDK Bridge (gRPC)
GeViSoft (GeViServer.exe) - Central video matrix
↓ MUST be connected to...
GeViScope (GSCServer.exe) - Storage server
↓ Which has...
IP Cameras (actual hardware)
```
**Key Point**: Cameras are connected to **GeViScope** (GSCServer.exe), not to GeViSoft (GeViServer.exe)!
## Root Cause
GeViSoft (GeViServer.exe) is **NOT connected** to your local GeViScope (GSCServer.exe), so it has no cameras to return.
## Diagnostic Steps
### Step 1: Verify Both Services Are Running
```powershell
Get-Process GeViServer,GSCServer
```
**Expected Output**:
```
ProcessName Id
----------- --
GeViServer 45612 ← GeViSoft (central matrix)
GSCServer 19220 ← GeViScope (storage server with cameras)
```
✅ Both should be running.
### Step 2: Check G-Core Server Configuration
G-Core servers are connection definitions in TestMKS.set that tell GeViSoft which GeViScope servers to connect to.
**Check current configuration**:
1. Stop SDK Bridge temporarily: `.\stop-services.ps1`
2. Open GeViSet (GeViSoft configuration tool)
3. Navigate to: **G-Core** or **GeViScope Servers** section
4. Look for entries pointing to GeViScope servers
**What you're looking for**:
- Entry with Host = `localhost` or `127.0.0.1`
- Entry must be **Enabled**
- Credentials must match GeViScope configuration
### Step 3: Is Local GeViScope in the Configuration?
**Option A: Via GeViSet (Recommended)**
1. Open GeViSet
2. Check G-Core server list
3. Look for server with:
- Host: `localhost` or `127.0.0.1`
- Enabled: ✅ Yes
**Option B: Via TestMKS.set (Advanced)**
```
C:\GEVISOFT\TestMKS.set
GeViGCoreServer/
Server_?/
Host: "localhost" ← Must exist and point to localhost
Enabled: true ← Must be enabled
User: "gevisoft" ← Credentials for GSCServer
Password: "..."
```
### Step 4: Add Localhost G-Core Server (If Missing)
If no G-Core server points to localhost, GeViSoft can't see your local GeViScope cameras.
**Fix via REST API**:
```bash
curl -X POST http://localhost:8000/api/v1/configuration/servers \
-H "Content-Type: application/json" \
-d '{
"alias": "Local GeViScope Storage",
"host": "localhost",
"user": "gevisoft",
"password": "your_password",
"enabled": true,
"deactivate_echo": false,
"deactivate_live_check": false
}'
```
**Fix via GeViSet**:
1. Open GeViSet
2. Go to G-Core Servers
3. Add New Server:
- Alias: "Local GeViScope"
- Host: localhost
- User: gevisoft (or appropriate user)
- Password: (GeViScope password)
- Enabled: ✅
4. Save configuration
5. Restart GeViServer: `.\restart-services.ps1`
### Step 5: Verify GeViScope Has Cameras
Even if GeViSoft connects to GeViScope, cameras won't appear unless GeViScope has cameras configured.
**Check GeViScope cameras**:
1. This depends on how your GeViScope is configured
2. Cameras are added to GeViScope via its own configuration
3. Check GeViScope documentation for camera management
**Typical GeViScope camera sources**:
- Direct IP cameras on local network
- Camera configuration files
- Auto-discovered cameras
### Step 6: Check Connection Status
After adding localhost G-Core server, verify connection:
**In GeViSet**:
- G-Core server entry should show **Connected** status
- If disconnected, check:
- GSCServer.exe is running
- Credentials are correct
- Port is not blocked
**In GeViServer logs**:
- Look for connection messages to localhost
- Check for authentication errors
## Common Scenarios
### Scenario 1: No G-Core Servers at All
```json
{
"servers": [],
"total": 0
}
```
**Solution**: Your TestMKS.set has NO G-Core servers. You need to add at least one pointing to your GeViScope.
### Scenario 2: G-Core Servers Exist But None Point to Localhost
```json
{
"servers": [
{"id": "1", "host": "192.168.1.100", ...},
{"id": "2", "host": "192.168.1.200", ...}
]
}
```
**Solution**: Add a server with `"host": "localhost"` to connect to your local GSCServer.exe.
### Scenario 3: Localhost G-Core Server Exists But Is Disabled
```json
{
"servers": [
{"id": "3", "host": "localhost", "enabled": false}
]
}
```
**Solution**: Enable the server:
```bash
curl -X PUT http://localhost:8000/api/v1/configuration/servers/3 \
-H "Content-Type: application/json" \
-d '{"enabled": true, ...}'
```
Or use GeViSet to enable it.
### Scenario 4: Connection Fails (Wrong Credentials)
**Symptoms**:
- G-Core server configured
- GeViScope running
- Still no cameras
- GeViServer logs show authentication errors
**Solution**:
- Verify username/password in G-Core server config matches GeViScope
- Common usernames: `gevisoft`, `admin`, `gscadmin`
- Check GeViScope user configuration
## Quick Fix Commands
### 1. Check what G-Core servers exist:
```bash
# Note: Requires authentication bypass or valid token
curl http://localhost:8000/api/v1/configuration/servers
```
### 2. Add localhost G-Core server:
```bash
curl -X POST http://localhost:8000/api/v1/configuration/servers \
-H "Content-Type: application/json" \
-d '{
"alias": "Local Storage",
"host": "localhost",
"user": "gevisoft",
"password": "change_me",
"enabled": true
}'
```
### 3. Restart services to apply changes:
```powershell
.\restart-services.ps1
```
### 4. Wait 30 seconds for connection, then check cameras:
```bash
curl http://localhost:8000/api/v1/cameras
```
## Expected Result After Fix
```json
{
"cameras": [
{
"channel": 1,
"name": "Camera 1",
"description": "Front entrance",
"has_ptz": false,
"has_video_sensor": true,
"status": "online"
},
{
"channel": 2,
"name": "Camera 2",
...
}
],
"total": 2
}
```
## Still Not Working?
### Check GeViServer Logs
Look in: `C:\GEVISOFT\Logs\` or wherever GeViServer logs are stored
**Look for**:
- G-Core connection attempts
- Authentication failures
- Network errors
### Verify Ports
- GeViScope (GSCServer) listens on ports (check GeViScope config)
- GeViSoft must be able to connect to these ports
- Firewall might be blocking
### Test Connection Manually
From GeViSet:
1. Try to connect to localhost GeViScope
2. If it fails, the issue is not with the API
3. Fix GeViScope connectivity first
## Architecture Diagram
```
┌─────────────────────────────────────────────────┐
│ Your Machine (localhost) │
├─────────────────────────────────────────────────┤
│ │
│ GeViSoft (GeViServer.exe) │
│ ├─ Manages video routing │
│ └─ Needs to connect to GeViScope via G-Core │
│ │
│ ↓ G-Core connection (configured in │
│ ↓ TestMKS.set GeViGCoreServer folder) │
│ ↓ │
│ GeViScope (GSCServer.exe) │
│ ├─ Storage/recording server │
│ ├─ HAS THE CAMERAS! ← This is where they are │
│ └─ Must be reachable from GeViSoft │
│ │
│ ↓ │
│ ↓ Connected to │
│ ↓ │
│ IP Cameras (hardware) │
│ └─ Actual camera devices │
│ │
└─────────────────────────────────────────────────┘
```
## Summary Checklist
- [ ] GeViServer.exe is running
- [ ] GSCServer.exe is running
- [ ] TestMKS.set has G-Core server entry for localhost
- [ ] G-Core server entry is enabled
- [ ] Credentials in G-Core config match GSCServer
- [ ] GeViSoft successfully connected to GSCServer (check GeViSet)
- [ ] GSCServer has cameras configured
- [ ] Services restarted after configuration changes
- [ ] Waited 30+ seconds for connection to establish
If all checked, cameras should appear in API!
---
**Last Updated**: 2025-12-17