Compare commits
1 Commits
d6e169ce12
...
85e7f66b19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85e7f66b19 |
@@ -8,6 +8,10 @@ UDP_MSG_PORT = int(os.getenv("EDC_UDP_MSG_PORT", "5505"))
|
||||
TCP_PORT = int(os.getenv("EDC_TCP_PORT", "5550"))
|
||||
BIND_HOST = os.getenv("EDC_BIND_HOST", "0.0.0.0")
|
||||
|
||||
# 设备端接收端口
|
||||
DEVICE_UDP_PORT = int(os.getenv("EDC_DEVICE_UDP_PORT", "4900"))
|
||||
DEVICE_TCP_PORT = int(os.getenv("EDC_DEVICE_TCP_PORT", "5550"))
|
||||
|
||||
# MySQL
|
||||
MYSQL_HOST = os.getenv("EDC_MYSQL_HOST", "127.0.0.1")
|
||||
MYSQL_PORT = int(os.getenv("EDC_MYSQL_PORT", "3306"))
|
||||
|
||||
@@ -376,12 +376,13 @@ async def _send_serialnet_cmd(device_id: str, dnt_id: int, record: dict):
|
||||
|
||||
# 获取设备 IP 和 msgport
|
||||
dnt = await get_dnt_by_serial(device_id)
|
||||
if not dnt or not dnt.get("ip") or not dnt.get("msgport"):
|
||||
logger.warning(f"设备 {device_id} 无 IP/msgport 信息,跳过")
|
||||
if not dnt or not dnt.get("ip"):
|
||||
logger.warning(f"设备 {device_id} 无 IP 信息,跳过")
|
||||
return
|
||||
|
||||
from src.config import DEVICE_UDP_PORT
|
||||
send_pkg = record["send_pkg"]
|
||||
addr = (dnt["ip"], dnt["msgport"])
|
||||
addr = (dnt["ip"], DEVICE_UDP_PORT)
|
||||
|
||||
# 构造 SerialNet JSON
|
||||
msg = {
|
||||
|
||||
Reference in New Issue
Block a user