Home/Support/Support Forum/Micropython mode - Node announce

Micropython mode - Node announce

0 votes
Hi,

I'm trying to use micropython to program an xbee3, my goal being to join an existing network (the coordinator is a cc2531 / zigbee2mqtt) and publish a weight sensor reading periodically.

I am able to join the network just fine, but at that point zigbee-herdsman (which is the library used by zigbee2mqtt on the controller) starts the interview process, to try and discover the endpoints on the device.

And to my surprise, it looks like the xbee is answering those requests on it's own, at least partly :

```
Mar 01 12:45:28 ha npm[23269]: 2020-03-01T12:45:28.309Z zigbee-herdsman:adapter:zStack:znp:AREQ <-- ZDO - endDeviceAnnceInd - {"srcaddr":53423,"nwkaddr":53423,"ieeeaddr":"0x0013a20041b47f93","capabilities":128}
Mar 01 12:45:28 ha npm[23269]: 2020-03-01T12:45:28.309Z zigbee-herdsman:controller:log Device announce '0x0013a20041b47f93'

...

Mar 01 12:45:28 ha npm[23269]: 2020-03-01T12:45:28.700Z zigbee-herdsman:adapter:zStack:znp:AREQ <-- ZDO - nodeDescRsp - {"srcaddr":53423,"status":0,"nwkaddr":53423,"logicaltype_cmplxdescavai_userdescavai":2,"apsflags_freqband":64,"maccapflags":128,"manufacturercode":4126,"maxbuffersize":82,"maxintransfersize":255,"servermask":11264,"maxouttransfersize":255,"descriptorcap":0}
Mar 01 12:45:28 ha npm[23269]: 2020-03-01T12:45:28.701Z zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext []
Mar 01 12:45:28 ha npm[23269]: 2020-03-01T12:45:28.709Z zigbee-herdsman:controller:device Interview - got node descriptor for device '0x0013a20041b47f93'
```

The xbee board is announcing itself with a capability of 128.
Sometimes it's even announcing an endpoint :

```
Mar 01 12:41:59 ha npm[23269]: 2020-03-01T12:41:59.355Z zigbee-herdsman:adapter:zStack:znp:AREQ <-- ZDO - simpleDescRsp - {"srcaddr":56375,"status":0,"nwkaddr":56375,"len":8,"endpoint":230,"profileid":49413,"deviceid":1,"deviceversion":0,"numinclusters":0,"inclusterlist":[],"numoutclusters":0,"outclusterlist":[]}
Mar 01 12:41:59 ha npm[23269]: 2020-03-01T12:41:59.356Z zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext []
Mar 01 12:41:59 ha npm[23269]: 2020-03-01T12:41:59.357Z zigbee-herdsman:controller:device Interview - got simple descriptor for endpoint '230' device '0x0013a20041b47f93'
Mar 01 12:41:59 ha npm[23269]: 2020-03-01T12:41:59.366Z zigbee-herdsman:adapter:zStack:znp:SREQ --> ZDO - simpleDescReq - {"dstaddr":56375,"nwkaddrofinterest":56375,"endpoint":232}
```

Here it's saying it got an endpoint descriptor for 230, somehow.

Is there any documentation about why this is happening, and how to control what is being announced ?

I'm trying to figure out how to get it to be a simple end device, used only to publish one number to the coordinator from time to time, and that without an external CPU, my goal is to have all the logic directly in /flash/main.py so it's running in micropython mode only.

Thanks !
asked Mar 2 in XBee3 ZigBee by Ulrar New to the Community (1 point)
Hi Ulrar,

Have you managed to make any progress on this?  I am struggling with the same thing and would appreciate any additional info you have managed to uncover.
Hi, unfortunately I did not. AO 3 doesn't seem to change much, and I'm not sure on what I'm supposed to do. I wish I could find an example but it doesn't look like anyone published any code for xbee ..
At this rate this will end up running on an esp8266, at least that's very easy to pick up with all the code on GitHub :(
Ah sorry.  I will keep trying to find a solution and will let you know if I come up with anything useful

Please log in or register to answer this question.

2 Answers

0 votes
Ulrar,

Have you looked at the product manual for the XBee yet? I would suggest starting there.

Yes, some of the active end point requests the radio will respond to directly as they are part of its responsibility. For your application, you will want to use API mode with Explicit frames and ZDO pass thru mode.

Digi Support
answered Mar 2 by mvut Veteran of the Digi Community (11,963 points)
Hi,

Do you mean setting AO to 3 ?
If yes, I did try that.

The only difference seems to be an extra xbee.receive(), one on profile 0 and one on profile 260, but on the controller's side I'm still seeing an automatic node announce and simple endpoint descriptor sent from xbee.

Or do you mean I should just ignore those automated responses and send packets announcing my own endpoint anyway ?
This seems to be the doc for the python module, which uses serial to communicate with xbee. I don't have anything connected to the serial pins, I'm trying to run the whole thing directly using micropython on the xbee board itself.

I tried setting AO to 3 and 4 already without success (or at least it's still responding automatically to the controller's discovery requests), which setting do you mean by "Explicit frames and ZDO pass thru mode" ? Do you mean 4 & 1 ?
In other words from micropython what should I pass as an argument to `xbee.atcmd("AO", ????)` ?

Thanks !
That's the doc for the receive command, which I did read. As mentioned in the original post I do receive one or two messages, depending on the setting of AO, but in all cases xbee responds to the discovery requests on it's own, regardless of what's in the receive queue.
Are we meant to ignore that and just transmit our own endpoint announcement anyway, on top of what xbee is automatically responding ?
0 votes
Hi,

Do you mean setting AO to 3 ?
If yes, I did try that.

The only difference seems to be an extra xbee.receive(), one on profile 0 and one on profile 260, but on the controller's side I'm still seeing an automatic node announce and simple endpoint descriptor sent from xbee.

Or do you mean I should just ignore those automated responses and send packets announcing my own endpoint anyway ?
answered Mar 5 by Ulrar New to the Community (1 point)
...