mirror of
https://github.com/ipnet-mesh/meshcore-mqtt.git
synced 2026-08-07 09:22:49 +02:00
Merge pull request #14 from ipnet-mesh/claude/issue-13-20251116-2223
docs: update TCP port from 12345 to 5000
This commit is contained in:
@@ -65,7 +65,7 @@ The bridge supports multiple configuration methods with the following precedence
|
||||
#### MeshCore Settings
|
||||
- `meshcore_connection`: Connection type (serial, ble, tcp)
|
||||
- `meshcore_address`: Device address (required)
|
||||
- `meshcore_port`: Device port for TCP connections (default: 12345)
|
||||
- `meshcore_port`: Device port for TCP connections (default: 5000)
|
||||
- `meshcore_baudrate`: Baudrate for serial connections (default: 115200)
|
||||
- `meshcore_timeout`: Operation timeout in seconds (default: 5)
|
||||
- `meshcore_auto_fetch_restart_delay`: Delay in seconds before restarting auto-fetch after NO_MORE_MSGS (default: 5, range: 1-60)
|
||||
@@ -93,7 +93,7 @@ The bridge supports multiple configuration methods with the following precedence
|
||||
"meshcore": {
|
||||
"connection_type": "tcp",
|
||||
"address": "192.168.1.100",
|
||||
"port": 12345,
|
||||
"port": 5000,
|
||||
"baudrate": 115200,
|
||||
"timeout": 10,
|
||||
"auto_fetch_restart_delay": 10,
|
||||
@@ -126,7 +126,7 @@ mqtt:
|
||||
meshcore:
|
||||
connection_type: tcp
|
||||
address: "192.168.1.100"
|
||||
port: 12345
|
||||
port: 5000
|
||||
baudrate: 115200
|
||||
timeout: 10
|
||||
auto_fetch_restart_delay: 10
|
||||
@@ -151,7 +151,7 @@ export MQTT_USERNAME=myuser
|
||||
export MQTT_PASSWORD=mypass
|
||||
export MESHCORE_CONNECTION=tcp
|
||||
export MESHCORE_ADDRESS=192.168.1.100
|
||||
export MESHCORE_PORT=12345
|
||||
export MESHCORE_PORT=5000
|
||||
export MESHCORE_BAUDRATE=115200
|
||||
export MESHCORE_AUTO_FETCH_RESTART_DELAY=10
|
||||
export MESHCORE_MESSAGE_INITIAL_DELAY=15.0
|
||||
@@ -177,7 +177,7 @@ python -m meshcore_mqtt.main \
|
||||
--mqtt-password mypass \
|
||||
--meshcore-connection tcp \
|
||||
--meshcore-address 192.168.1.100 \
|
||||
--meshcore-port 12345 \
|
||||
--meshcore-port 5000 \
|
||||
--meshcore-auto-fetch-restart-delay 10 \
|
||||
--meshcore-events "CONNECTED,DISCONNECTED,BATTERY"
|
||||
```
|
||||
@@ -195,7 +195,7 @@ python -m meshcore_mqtt.main \
|
||||
--mqtt-broker localhost \
|
||||
--meshcore-connection tcp \
|
||||
--meshcore-address 192.168.1.100 \
|
||||
--meshcore-port 12345
|
||||
--meshcore-port 5000
|
||||
```
|
||||
|
||||
#### Serial Connection
|
||||
@@ -552,7 +552,7 @@ MQTT_TLS_INSECURE=false
|
||||
MESHCORE_CONNECTION=serial
|
||||
MESHCORE_ADDRESS=/dev/ttyUSB0 # Serial port, IP address, or BLE MAC address
|
||||
MESHCORE_BAUDRATE=115200 # For serial connections
|
||||
MESHCORE_PORT=4403 # Only for TCP connections
|
||||
MESHCORE_PORT=5000 # Only for TCP connections
|
||||
MESHCORE_TIMEOUT=30
|
||||
MESHCORE_AUTO_FETCH_RESTART_DELAY=10 # Restart delay after NO_MORE_MSGS (1-60 seconds)
|
||||
MESHCORE_MESSAGE_INITIAL_DELAY=15.0 # Initial delay before first message (0.0-60.0 seconds)
|
||||
@@ -576,7 +576,7 @@ MESHCORE_BAUDRATE=115200
|
||||
```bash
|
||||
MESHCORE_CONNECTION=tcp
|
||||
MESHCORE_ADDRESS=192.168.1.100
|
||||
MESHCORE_PORT=4403
|
||||
MESHCORE_PORT=5000
|
||||
```
|
||||
|
||||
**BLE Connection:**
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
"meshcore": {
|
||||
"connection_type": "tcp",
|
||||
"address": "192.168.1.100",
|
||||
"port": 12345,
|
||||
"port": 5000,
|
||||
"baudrate": 115200,
|
||||
"timeout": 5,
|
||||
"auto_fetch_restart_delay": 5,
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ mqtt:
|
||||
meshcore:
|
||||
connection_type: tcp
|
||||
address: "192.168.1.100"
|
||||
port: 12345
|
||||
port: 5000
|
||||
baudrate: 115200
|
||||
timeout: 5
|
||||
auto_fetch_restart_delay: 5
|
||||
|
||||
@@ -133,7 +133,7 @@ class MeshCoreConfig(BaseModel):
|
||||
|
||||
# Set default port for TCP if None provided
|
||||
if connection_type == ConnectionType.TCP and v is None:
|
||||
v = 12345
|
||||
v = 5000
|
||||
|
||||
if v is not None and not 1 <= v <= 65535:
|
||||
raise ValueError("Port must be between 1 and 65535")
|
||||
@@ -252,7 +252,7 @@ class Config(BaseModel):
|
||||
connection_type=ConnectionType(os.getenv("MESHCORE_CONNECTION", "tcp")),
|
||||
address=os.getenv("MESHCORE_ADDRESS", ""),
|
||||
port=(
|
||||
int(os.getenv("MESHCORE_PORT", "12345"))
|
||||
int(os.getenv("MESHCORE_PORT", "5000"))
|
||||
if os.getenv("MESHCORE_PORT")
|
||||
else None
|
||||
),
|
||||
|
||||
@@ -20,7 +20,7 @@ def test_config() -> Config:
|
||||
meshcore=MeshCoreConfig(
|
||||
connection_type=ConnectionType.TCP,
|
||||
address="127.0.0.1",
|
||||
port=12345,
|
||||
port=5000,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -60,7 +60,7 @@ class TestBridgeCoordinator:
|
||||
bridge = BridgeCoordinator(test_config)
|
||||
assert bridge.config.meshcore.connection_type == ConnectionType.TCP
|
||||
assert bridge.config.meshcore.address == "127.0.0.1"
|
||||
assert bridge.config.meshcore.port == 12345
|
||||
assert bridge.config.meshcore.port == 5000
|
||||
|
||||
def test_serial_connection_config(self) -> None:
|
||||
"""Test serial connection configuration."""
|
||||
|
||||
@@ -17,7 +17,7 @@ def test_config() -> Config:
|
||||
meshcore=MeshCoreConfig(
|
||||
connection_type=ConnectionType.TCP,
|
||||
address="127.0.0.1",
|
||||
port=12345,
|
||||
port=5000,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -110,11 +110,11 @@ class TestMeshCoreConfig:
|
||||
def test_valid_tcp_config(self) -> None:
|
||||
"""Test valid TCP configuration."""
|
||||
config = MeshCoreConfig(
|
||||
connection_type=ConnectionType.TCP, address="192.168.1.100", port=12345
|
||||
connection_type=ConnectionType.TCP, address="192.168.1.100", port=5000
|
||||
)
|
||||
assert config.connection_type == ConnectionType.TCP
|
||||
assert config.address == "192.168.1.100"
|
||||
assert config.port == 12345
|
||||
assert config.port == 5000
|
||||
assert config.timeout == 5
|
||||
|
||||
def test_valid_serial_config(self) -> None:
|
||||
@@ -142,7 +142,7 @@ class TestMeshCoreConfig:
|
||||
config = MeshCoreConfig(
|
||||
connection_type=ConnectionType.TCP, address="192.168.1.100", port=None
|
||||
)
|
||||
assert config.port == 12345
|
||||
assert config.port == 5000
|
||||
|
||||
def test_custom_baudrate(self) -> None:
|
||||
"""Test custom baudrate for serial connections."""
|
||||
|
||||
@@ -19,7 +19,7 @@ def test_config() -> Config:
|
||||
meshcore=MeshCoreConfig(
|
||||
connection_type=ConnectionType.TCP,
|
||||
address="127.0.0.1",
|
||||
port=12345,
|
||||
port=5000,
|
||||
message_initial_delay=0.1, # 100ms for faster tests
|
||||
message_send_delay=0.2, # 200ms for faster tests
|
||||
),
|
||||
@@ -34,7 +34,7 @@ def test_config_zero_delays() -> Config:
|
||||
meshcore=MeshCoreConfig(
|
||||
connection_type=ConnectionType.TCP,
|
||||
address="127.0.0.1",
|
||||
port=12345,
|
||||
port=5000,
|
||||
message_initial_delay=0.0,
|
||||
message_send_delay=0.0,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user