Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ Auth-token mode is easy install by default:
- Signing key is pulled from the connected node via `export_private_key()`.
- If private key export is disabled/blocked on firmware, auth-token upload cannot start.

Support for MQTT brokers that serve MQTT over a different path than /

- Example: EMQX requires the path to be /mqtt

## Map Auto Uploader (map.meshcore.io)

When enabled (off by default), the integration automatically uploads repeater and room server adverts to [map.meshcore.io](https://map.meshcore.io) when your Companion hears them. A standalone alternative is [map.meshcore.io-uploader](https://github.com/recrof/map.meshcore.io-uploader). Enable in Global Settings if you want Map Auto Uploader.
Expand Down
2 changes: 2 additions & 0 deletions custom_components/meshcore/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,7 @@ async def async_step_mqtt_broker(self, user_input=None):
"owner_email": user_input.get("owner_email", ""),
"topic_status": user_input.get("topic_status", DEFAULT_MQTT_TOPIC_STATUS),
"topic_events": user_input.get("topic_events", DEFAULT_MQTT_TOPIC_EVENTS),
"ws_path": user_input.get("ws_path", "/"),
"iata": user_input.get("iata", legacy_global_iata),
"token_ttl_seconds": user_input.get("token_ttl_seconds", legacy_global_ttl),
"payload_mode": user_input.get("payload_mode", "packet"),
Expand Down Expand Up @@ -1134,6 +1135,7 @@ async def async_step_mqtt_broker(self, user_input=None):
): vol.All(cv.positive_int, vol.Range(min=60, max=86400)),
vol.Optional("topic_status", default=broker.get("topic_status", DEFAULT_MQTT_TOPIC_STATUS)): str,
vol.Optional("topic_events", default=broker.get("topic_events", DEFAULT_MQTT_TOPIC_EVENTS)): str,
vol.Optional("ws_path", default=broker.get("ws_path", "/")): str,
vol.Optional("iata", default=broker.get("iata", legacy_global_iata)): str,
})

Expand Down
6 changes: 5 additions & 1 deletion custom_components/meshcore/mqtt_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class BrokerConfig:
client_id_prefix: str
topic_status: str
topic_packets: str
ws_path: str = "/"

@property
def name(self) -> str:
Expand Down Expand Up @@ -304,6 +305,9 @@ def _load_brokers(self) -> list[BrokerConfig]:
),
iata,
),
ws_path=str(
broker_settings.get("ws_path", "/") or "/"
).strip(),
)

if broker.is_letsmesh and iata in placeholder_iata_values:
Expand Down Expand Up @@ -426,7 +430,7 @@ async def _async_create_client(self, broker: BrokerConfig):
)

if broker.transport == "websockets":
client.ws_set_options(path="/", headers=None)
client.ws_set_options(path=broker.ws_path, headers=None)

self.logger.info(
"[%s] Ready (status_topic=%s packets_topic=%s auth_token=%s)",
Expand Down
Loading