Author Topic: Bitcloud - ZigBee End Device lost after parent power cycle  (Read 6812 times)

0 Members and 1 Guest are viewing this topic.

Offline rflemingTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: au
Re: Bitcloud - ZigBee End Device lost after parent power cycle
« Reply #25 on: July 04, 2016, 07:49:04 am »
Ok, but the first entry in the first file must have been invalid as well then? Because it had wrong channel and ExtPanId.
Of the old file based on my own implemented ZigBee app?

The first entry in the table was the only correct one. I changed the channel to 13 since it is quite a clear network according to my sniffer. I also assigned the EPID to be the same as a coordinator MAC.

To have a place for guaranteed endpoint I use 'asm("nop");'.

I'd have to move my little finger too much on the shift key to use that line. But certainly something better to break on!

No worries, eagerly waiting your reply :)
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: Bitcloud - ZigBee End Device lost after parent power cycle
« Reply #26 on: July 05, 2016, 11:38:29 pm »
Here is an update. I did not have a lot of time to work on this. My build for ATmega256RFR2 seem to be broken (I think it is AS7 issue), so I used SAM R21, but logically they should be the same.

I also could not get HADemo to run (or react to serial input, anyway) for some unknown reason.

I used WSNDemo and it works properly by default. I suggest you try that on your hardware first.

On closer examination it looks like there is a parameter clearNeighborTable in the joinControl structure. It should be set properly by the default HADemo application as well, but it may be worth checking that it is actually set correctly.

I'll try to make HADemo work on R21, but I won't mess with my AS7 versions.

If nothing else helps, create myAtmel ticket, they may actually know about some issues and have a fix already.
Alex
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: Bitcloud - ZigBee End Device lost after parent power cycle
« Reply #27 on: July 06, 2016, 12:01:07 am »
I can reproduce this on SAM R21 and HADemo.  I'll looks into this further, but you can basically assume that it is some high-level logic problem, not PDS.

We just need to figure out what is the difference between WSNDemo and HADemo, since the first one works for me.
Alex
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: Bitcloud - ZigBee End Device lost after parent power cycle
« Reply #28 on: July 06, 2016, 12:15:30 am »
Well, that was easy.

In the file zclDevice.c in function setDeviceJoinParameters() replace this line
Code: [Select]
  else if (DEVICE_TYPE_ROUTER == deviceType)with
Code: [Select]
  else if (DEVICE_TYPE_ROUTER == deviceType || DEVICE_TYPE_COORDINATOR == deviceType)and  things will work as expected.

You can enable WL back, it does not make any difference.
Alex
 
The following users thanked this post: rfleming

Offline rflemingTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: au
Re: Bitcloud - ZigBee End Device lost after parent power cycle
« Reply #29 on: July 06, 2016, 04:30:23 am »
That was the issue! I removed this code in the past because it was only implemented on a router not my coordinator :)

Lex, da man!

While i've got you on the topic of End Devices, I have one other small issue :)

When I do a request for my end device to leave when it is attached to a router, it sends a NWK "Leave" message rather than a ZDO Leave response, this is fine. Though because I receive an Extended address through the Leave event, I need a short address to remove it from my locally held network list. I can't query for the Short address anymore because it has already been removed. Do you know any better way to handle this to get the short address through the above procedure?
« Last Edit: July 06, 2016, 04:38:01 am by rfleming »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf