add an error when serial connexion is not made to suggest trying -r

This commit is contained in:
Florent 2026-02-16 14:12:37 -04:00
parent 5bc8379b52
commit 69ad8250fe

View file

@ -4436,6 +4436,8 @@ async def main(argv):
mc = await MeshCore.create_tcp(host=hostname, port=port, debug=debug, only_error=json_output)
elif not serial_port is None : # connect via serial port
mc = await MeshCore.create_serial(port=serial_port, baudrate=baudrate, debug=debug, only_error=json_output)
if mc is None: # did not connect
logger.error("To connect to a repeater, use -r option.")
elif BLEAK_AVAILABLE : # connect via ble
client = None
if device or address and len(address.split(":")) == 6 :