This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

10个协调器,2个路由的应用

Other Parts Discussed in Thread: Z-STACK

我现在的想法:

场景1:

1、1个路由设备,通过无线的方式分别配置10个协调器的参数。

我目前的做法是:每个探空仪均使用EPANID=1;路由设备每次进入一个局域网配置完成后,让这个网络不允许入网。

 然后打开第二个协调器,进行形同的步骤。可以实现。

2、如果我想用2个路由设备,通过无线的方式分别配置10个协调器的参数。这样速度会快一倍。

有一个问题:如果两个路由设备同时上电,两个协调器也同时上电。就会造成两个设备同时进入了一个网络中。

请问有没有好的办法可以解决这个问题?

  • 基本上Zigbee spec/Z-Stack沒有辦法讓你這樣隨意切換

  • 你路由很难控制, 在入网选择只会选择rssi 更好的设备,以及你这样搞很繁琐,如果你想自己配置协调器,建议你使用ZNP 配置协调器。
  • 我的初衷是通过路由设备无线配置协调器的参数,如果用ZNP的方式,是不是相当于MCU(通过串口、spi等方式)配置协调器?
  • 没有能力自己写协议栈,但还是想问一下,自己的协议是否可以实现我要的功能?
  • ZNP 模式是UART或者SPI 设置参数。你很难操作路由对于入网的选择。
  • 有个问题想问一下:我的协调器A 用扩展PANID作为网络标号。我的其他路由设备将扩展PANID设置为保留值。这样路由设备会加入到协调器A建立的网络中么?
  • 我10个协调器的扩展PANID 不一样,路由设备通过串口更改其扩展PANID的值,达到进入指定网络的目的。这样可以实现么?
  • 你可以用一个上位机类似Btool 设置各种参数,何必纠结这个路由设备,通常情况下coordinator是gateway 那边用znp 做的,可以通过上层的linux 或者其他设备设置启动ZNP。你的路由写入操作不推荐很难实现。
  • 路由设备要加入別的協調器必須走重新入網流程
  • 如果只是路由器做为配置工具进入网络配置协调器或的话,可以尝试:
    1. 路由设备扫描,通过beacon拿到附近所有网络的网络参数 panid epid channel assocPermit (区分哪些是自己的协调器,自己协调器的关联表中预先写入 0x0003, 勿使用0x0001, 协议栈中有些命令会触发一些动作,可能在绕过性的修复一些问题);
    2.路由设备将这些网络参数 、nwkKey及网络地址0x0003写入NIB属性, 然后以resume方式启动;
    3.对协调器配置完毕后, resume方式进入下一个网络进行配置。

    关于多个路由同时进行配置操作的话,可以每次进入网络前通过beacon中的assocPermit标记来选择是否要进入该网络,避免经常性的出现2路由设备进入同一网络进行配置。
    另外,即使有小概率的2路由进入同一网络,短时间内也不会有太大弊端(如网络地址冲突)。
  • 现在有一个问题,我怎么将这些参数写入NIB属性中,关于网络参数的NIB属性对应那些NIB参数,哪个文档有相关的讲解?
  • yikai chen 有个恢复协调器的说明,可以论坛里找下,我所说的操作过程本质上也是 对设备 网络信息进行克隆后resume启动,操作基本是一样的。
  • 当你咋不知道一个函数或者变量是什么意思的时候, 右键 go declaration

    typedef struct
    {
      byte  SequenceNum;
      byte  PassiveAckTimeout;
      byte  MaxBroadcastRetries;
      byte  MaxChildren;
      byte  MaxDepth;
      byte  MaxRouters;
    
      byte  dummyNeighborTable;     // to make everything a byte!!
    
      byte  BroadcastDeliveryTime;
      byte  ReportConstantCost;
      byte  RouteDiscRetries;
    
      byte  dummyRoutingTable;      // to make everything a byte!!
    
      byte  SecureAllFrames;
      byte  SecurityLevel;
    #if defined ( COMPATIBILITY_221 )   // Obsolete - do not use
      byte  nwkAllFresh;
    #endif
      byte  SymLink;
      byte  CapabilityFlags;
    
      uint16 TransactionPersistenceTime;
    
      byte   nwkProtocolVersion;
    
      // non-standard attributes
      byte  RouteDiscoveryTime;
      byte  RouteExpiryTime;        // set to 0 to turn off expiration of routes
    
      // non-settable
      uint16  nwkDevAddress;
      byte    nwkLogicalChannel;
      uint16  nwkCoordAddress;
      byte    nwkCoordExtAddress[Z_EXTADDR_LEN];
      uint16  nwkPanId;
    
      // Other global items - non-settable
      nwk_states_t  nwkState;
      uint32        channelList;
      byte          beaconOrder;
      byte          superFrameOrder;
      byte          scanDuration;
      byte          battLifeExt;
      uint32        allocatedRouterAddresses;
      uint32        allocatedEndDeviceAddresses;
      byte          nodeDepth;
    
      // Version 1.1 - extended PAN ID
      uint8         extendedPANID[Z_EXTADDR_LEN];
    
      // Network key flag
      uint8      nwkKeyLoaded;
      // Key information - Moved out of the NIB structure after ZStack 2.3.0
      // If these elements are going to be reused make sure to consider the size
      // of the structures and padding specific to the target where the stack is
      // going to be running.
      nwkKeyDesc spare1;    // Not used
      nwkKeyDesc spare2;    // Not used
    
      // Zigbee Pro extensions
      uint8      spare3;                // nwkAddrAlloc deprecated - not used anymore
      uint8      spare4;                // nwkUniqueAddr deprecated - not used anymore
      uint8      nwkLinkStatusPeriod;   // The time in seconds betwee link status
                                        // command frames
      uint8      nwkRouterAgeLimit;     // The number of missed link status
                                        // command frames before resetting the
                                        // link cost to zero
      uint8      nwkUseMultiCast;
      // ZigBee Pro extentions: MTO routing
      uint8      nwkIsConcentrator;             // If set, then the device is concentrator
      uint8      nwkConcentratorDiscoveryTime;  // Time period between two consecutive MTO route discovery
      uint8      nwkConcentratorRadius;         // Broadcast radius of the MTO route discovery
    
    #if defined ( COMPATIBILITY_221 )   // Obsolete - do not use
      uint8      nwkMaxSourceRoute;
      uint8      nwkSrcRtgExpiryTime;
    #else
      uint8      nwkAllFresh;
    #endif
    
      uint16     nwkManagerAddr;        // Network Manager Address
      uint16     nwkTotalTransmissions;
      uint8      nwkUpdateId;
    } nwkIB_t;