zigpy-cc icon indicating copy to clipboard operation
zigpy-cc copied to clipboard

"No route found" with C26X2R1 on Z-Stack 3.x.0

Open puddly opened this issue 5 years ago • 3 comments

With no clear cause, all dataRequest commands were immediately rejected with a 205 status code, a "no route found" error. Rebooting individual devices or even restarting the network had no effect.

The only solution I could find was to send out a route discovery broadcast message:

if obj.command == "dataRequest":
    # XXX: dataConfirm can arrive before dataRequest response

    payload = {
        "endpoint": obj.payload["destendpoint"],
        "transid": obj.payload['transid'],
    }
    waiter = self.wait_for(CommandType.AREQ, Subsystem.AF, "dataConfirm", payload)
    result = await waiter.wait()
    LOGGER.debug('Got a dataRequest response: %s', result)

    status = result.payload['status']

    if status != 0:
        # No route found
        if status == 205:
            BEACON_MAX_DEPTH = 0x0F
            DEF_NWK_RADIUS = (2 * BEACON_MAX_DEPTH)

            LOGGER.warning('Received a routing failure! Attempting to discover a new route before failing...')

            await self.request(Subsystem.ZDO, 'extRouteDisc', {
                'dstAddr': obj.payload['dstaddr'],
                'options': 0x01,
                'radius': DEF_NWK_RADIUS
            })

            await asyncio.sleep(5)

        raise CommandError(result.payload['status'], f'Received a bad dataRequest status: {result.payload["status"]}')

Only one request like this is necessary because the dstAddr is really replaced with 0xFFFC, though I'm not sure what the consequences are of enqueuing a bunch of these messages are (especially since all of the useful parts of the Z-Stack firmware are not open source).

puddly avatar Feb 11 '20 22:02 puddly

Can't reproduce. @puddly do you still have this problem?

sanyatuning avatar May 03 '20 21:05 sanyatuning

Occasionally. You have to enable route discovery or manually send a route discovery request.

puddly avatar May 03 '20 21:05 puddly

How many devices do you have in your network?

puddly avatar May 03 '20 22:05 puddly