Traffic Violation Reporter Skill
This skill automates the process of reporting traffic violations through the Chengdu Police official WeChat account (成都交警) using Open-AutoGLM to control the phone via ADB.
Overview
The skill performs these steps in sequence:
- Start mitmproxy with GPS coordinate mocking script
- Launch Open-AutoGLM to control phone operations
- Navigate WeChat to Chengdu Police official account
- Access Rong-E-Xing (蓉e行) service
- Report traffic violation with pre-filled information
- Upload video evidence from gallery
- Submit the report
Prerequisites
Before using this skill, ensure you have:
- Android device with USB debugging enabled and ADB connection
- Open-AutoGLM submodule installed in the project
- mitmproxy installed (
pip install mitmproxy) - Video metadata JSON file with GPS coordinates (e.g.,
examples/video1.json) - WeChat installed on the Android device
- ADB Keyboard installed and enabled on the device
- Video file in device gallery for upload evidence
Skill Workflow
Step 1: Extract Report Data from JSON
Read the video metadata JSON file to extract:
- GPS coordinates (position field) for location mocking
- License plate number (license_plate_no)
- Violation type (against_type)
- Vehicle type (car_type)
- Timestamp (time field)
Example JSON structure:
{
"time": "2026/3/25 8:46:31",
"position": "104.065551,30.471042",
"license_plate_no": "川AA91637",
"against_type": "侵走非机动车道",
"car_type": "绿牌汽车(小型)"
}
Step 2: Start Mitmproxy with Location Mocking
Start mitmproxy with the GPS mocking script:
cd project/root
mitmweb -s skill/mock_http.py
The mock_http.py script intercepts location requests and returns the GPS coordinates from the JSON file.
Step 3: Generate AutoGLM Task Description
Create a detailed task description for Open-AutoGLM that includes:
- Exact navigation path through WeChat
- Specific UI elements to tap
- Text input for violation description
- Time selection steps
- Video upload steps
- Final submission
Step 4: Execute AutoGLM Task
Run Open-AutoGLM with the generated task description:
cd Open-AutoGLM
python main.py --base-url {MODEL_URL} --model "autoglm-phone-9b" "{TASK_DESCRIPTION}"
Step 5: Cleanup
After successful submission:
- Stop mitmproxy server
- Log the report completion with details
Using the Skill
Basic Usage
When the user asks to report a traffic violation:
- Verify JSON file path (default:
examples/video1.json) - Extract violation data from the JSON
- Update mitmproxy script with GPS coordinates
- Start mitmproxy in background
- Generate AutoGLM task with violation details
- Execute the task via Open-AutoGLM
- Monitor progress and handle any errors
- Stop mitmproxy after completion
AutoGLM Task Template
The AutoGLM task should follow this structure:
打开微信,找到成都交警公众号,进去之后点蓉e行,进入蓉e行中,点击交通违法举报,点击【侵走非机动车道】,选择【视频导入模式】。在弹出的地图界面中,随便点一个地点并点击【确定】按钮,再点击界面下方的【确定举报地点】按钮。之后在新界面中,违法时间进行点击,时间选择时间为【{VIOLATION_DATE}】,之后点击确定;在弹出的"请选择违法时分"界面中,将时间中的小时滚动到【{VIOLATION_HOUR}时】,分钟滚动到【{VIOLATION_MINUTE}分】,再点击【确认】按钮进行确认。之后,在行为描述界面中,输入:"{VIOLATION_DESCRIPTION}"。之后,点击界面中的上传证据,在弹框中选择【从相册选择】,再选择相册中的顶部最左侧的第一个视频,之后点击【完成】。返回到交通违法举报界面后,点击【提交举报信息】。
Replace the placeholders with actual data:
{VIOLATION_DATE}: Date from JSON (e.g., "2026年3月25日"){VIOLATION_HOUR}: Hour from JSON (e.g., "08"){VIOLATION_MINUTE}: Minute from JSON (e.g., "36"){VIOLATION_DESCRIPTION}: Formatted description with license plate, location, vehicle type, and violation type
Violation Description Format
Format the violation description as:
{YEAR}年{MONTH}月{DAY}日,{HOUR}点{MINUTE}分,在'{LOCATION}'路口,{CAR_TYPE},车牌号为:【{LICENSE_PLATE}】{VIOLATION_TYPE},此行为给行人和非机动车带来了严重的安全隐患,望审核后进行相应的处罚,谢谢。
Example:
2026年3月25日,8点36分,在'沈阳路西段和润郎路'路口,绿牌汽车(小型),车牌号为:【川AA91637】侵走非机动车道,此行为给行人和非机动车带来了严重的安全隐患,望审核后进行相应的处罚,谢谢。
Error Handling
Common Issues
ADB connection fails:
- Check
adb devicesoutput - Ensure USB debugging is enabled
- Verify data cable supports data transfer
- Check
Mitmproxy not intercepting:
- Check phone proxy settings (should point to mitmproxy)
- Verify CA certificate is installed on phone
- Check if script is loaded correctly
AutoGLM task fails:
- Verify model service is running
- Check task description format
- Ensure screen is bright and unlocked
- Verify WeChat is logged in
Video upload fails:
- Check if video exists in gallery
- Ensure video is in supported format
- Verify gallery permissions
Recovery Steps
If the task fails mid-way:
- Take screenshot of current screen state
- Analyze where the task stopped
- Generate continuation task from current state
- Resume AutoGLM with new task description
- Log the partial progress
Advanced Configuration
Custom JSON File Path
Users can specify a custom JSON file path:
json_path = "path/to/custom/video_data.json"
Model Service Configuration
AutoGLM can use different model services:
- Local deployment:
http://localhost:8000/v1 - BigModel:
https://open.bigmodel.cn/api/paas/v4 - ModelScope:
https://api-inference.modelscope.cn/v1
Batch Processing
For multiple violations, the skill can:
- Read multiple JSON files from a directory
- Process each file sequentially
- Generate individual reports
- Log completion status for each
Monitoring and Logging
The skill provides:
- Progress updates at each step
- Error messages with recovery suggestions
- Completion confirmation with report details
- Time tracking for performance monitoring
Safety Considerations
- Verify accuracy: Always double-check violation details before submission
- Legal compliance: Ensure all reports follow local traffic laws
- Privacy: Protect personal information when generating reports
- Test environment: Test in a non-production environment first
Troubleshooting
Check the bundled scripts for:
scripts/start_mitmproxy.py: Mitmproxy startup automationscripts/update_mock_coords.py: GPS coordinate updaterscripts/execute_autoglm_task.py: AutoGLM task executor
These scripts handle common issues and provide detailed logging for debugging.
Source: puhaiyang/OpenTrafficFlow — distributed by TomeVault.