{"record":{"id":"2a9cecf5da2c56a6","repo":"home-assistant/core","slug":"cannot-connect-2a9cec","errorCode":"cannot_connect","errorMessage":"An error occurred while connecting to the {device} printer: {error}","messagePattern":"An error occurred while connecting to the (.+?) printer: (.+?)","errorType":"exception","errorClass":"ConfigEntryNotReady","httpStatus":null,"severity":"error","filePath":"homeassistant/components/brother/__init__.py","lineNumber":39,"sourceCode":"_LOGGER = logging.getLogger(__name__)\n\nPLATFORMS = [Platform.SENSOR]\n\n\nasync def async_setup_entry(hass: HomeAssistant, entry: BrotherConfigEntry) -> bool:\n    \"\"\"Set up Brother from a config entry.\"\"\"\n    host = entry.data[CONF_HOST]\n    port = entry.data[SECTION_ADVANCED_SETTINGS][CONF_PORT]\n    community = entry.data[SECTION_ADVANCED_SETTINGS][CONF_COMMUNITY]\n    printer_type = entry.data[CONF_TYPE]\n\n    snmp_engine = await async_get_snmp_engine(hass)\n    try:\n        brother = await Brother.create(\n            host, port, community, printer_type=printer_type, snmp_engine=snmp_engine\n        )\n    except (ConnectionError, SnmpError, TimeoutError) as error:\n        raise ConfigEntryNotReady(\n            translation_domain=DOMAIN,\n            translation_key=\"cannot_connect\",\n            translation_placeholders={\n                \"device\": entry.title,\n                \"error\": repr(error),\n            },\n        ) from error\n\n    coordinator = BrotherDataUpdateCoordinator(hass, entry, brother)\n    await coordinator.async_config_entry_first_refresh()\n\n    if brother.serial.lower() != entry.unique_id:\n        raise ConfigEntryError(\n            translation_domain=DOMAIN,\n            translation_key=\"serial_mismatch\",\n            translation_placeholders={\n                \"device\": entry.title,\n            },","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/brother/__init__.py#L21-L57","documentation":"ConfigEntryNotReady with translation_key 'cannot_connect', raised during integration setup when Brother.create() fails with ConnectionError, SnmpError, or TimeoutError. SNMP is used to query the printer, so these mean the printer did not answer SNMP GET requests on the configured host/port/community. HA will retry setup in the background.","triggerScenarios":"Wrong host or port in the config entry; wrong SNMP community string (printer drops requests); SNMP disabled on the printer; printer asleep or off; UDP port 161 blocked between HA and the printer.","commonSituations":"Default community 'public' changed by printer admin; printer energy-saving mode not responding to SNMP; firewall/NAT rules or VLANs blocking UDP 161; printer IP changed after router renewal.","solutions":["Verify the printer is awake and reachable: ping the host, then test SNMP with snmpwalk -v2c -c <community> <host>","Confirm host, port, and SNMP community in the integration's advanced options match the printer's SNMP settings","Open UDP port 161 between Home Assistant and the printer on any firewall","Enable SNMP (v1/v2c) in the printer's web admin if it is disabled","Give HA time — ConfigEntryNotReady retries automatically once connectivity returns"],"exampleFix":"# diagnose from the HA host\n# before: entry keeps retrying with cannot_connect\nsnmpwalk -v2c -c public 192.168.1.50 1.3.6.1.2.1.25.1.1.0\n# if timeout: fix community/port, then reload the integration\n# after: entry sets up and coordinator first refresh succeeds","handlingStrategy":"retry","validationCode":"# From the HA host, confirm SNMP answers before (re)loading the entry:\n#   snmpwalk -v2c -c <community> <host> 1.3.6.1.2.1.25.1.1.0\n# A response means setup will succeed.","typeGuard":null,"tryCatchPattern":"# setup is framework-driven; the entry lands in 'setup_retry' on ConfigEntryNotReady\n# Monitor state:\nstate = hass.config_entries.async_get_entry(entry_id).state\nif state == ConfigEntryState.SETUP_RETRY:\n    # printer not answering SNMP yet; wait or fix network","preventionTips":["Pre-validate host/community with snmpwalk before adding the integration","Keep the printer awake or accept automatic retry until it wakes","Reserve the printer's IP with DHCP"],"tags":["brother","snmp","config-entry-not-ready","printer","home-assistant"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}