Can't compile samples from BitCloud (ZigBee) with WinAVR

Go To Last Post
986 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DiegoKer wrote:
When lqi value is updated?

It is updated on reception of any network layer (and higher) packet. Data requests are from MAC layer.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Alexru I read that you said that there is a documentation of over 600 pages on bitcloud. Where can I find it? I only have the bitcloud user guide, quick start and Stack documentation, however many times I find that there is information lacking on these 3 documents. If there is any other I am really needing it.

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rodrigod wrote:
Alexru I read that you said that there is a documentation of over 600 pages

I never said that. I said that ZigBee specification is over 600 pages.

BitCloud documentation is actually very poor.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

It is updated on reception of any network layer (and higher) packet. Data requests are from MAC layer.

And could you tell me how is it calculated?
Tanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DiegoKer wrote:
And could you tell me how is it calculated?

It is not calculated, it is taken directly from RF-chip.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi alex,

How can I bind to many devices at once ? If I bind them with APS_BindReq, on the same endpoint and cluster, will they be bound together and react at the same commands ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lucicop wrote:
How can I bind to many devices at once ? If I bind them with APS_BindReq, on the same endpoint and cluster, will they be bound together and react at the same commands ?

Basically, yes. Binding is useful when you have to work with devices from different vendors. From my point of view binding makes it different to manage network. It is necessary for complex things like Smart Energy, but if you are making application where all devices are managed by you then just assign known endpoints to applications.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you, alex !

Can timer 1 be used in user applications ? I intend to use GPIO0 in PWM mode. For the moment, I am having problems, it seems that the system timers no longer work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lucicop wrote:
Can timer 1 be used in user applications ? I intend to use GPIO0 in PWM mode. For the moment, I am having problems, it seems that the system timers no longer work.

It depends on platform used. See section "8.5 Reserved Hardware Resources" in AVR2052_BitCloud_Quick_Start_Guide.pdf. It says that Timer/Counter 1 is reserved and on Raven T/C 2 is also reserved.

For some reason there are no data for ZigBits, they are using Timer/Counter 2 and 4.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, I forgot to mention. I am using Zigbit modules, and I read about them in the Quickstart Guide, saying that Timer 2 and Timer 4 are used. I also saw with the debugger right when it enters APL_TaskHandler that Timer2 and Timer4 are initialized, and the others not. So I assumed that Timer1 is free. I will check further, to see what it could be...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Issue solved. It proved to be because an untreated interrupt that was on a PWM pin :) Many complex problems prove in the end to be a silly thing from the programmer, in embedded field :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Alex Help me!!!
I have another problem:
Joining and unjoining nodes and routers the coordinator at certain point doesn't accept any routers but only end devices... I close the network and reopen and reset the coordinator but I have the power failure active and so I think its not erase old nodes in his table....
What can I have to do?
When coordinator leave the network I want to reset all!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DiegoKer wrote:
What can I have to do?
When coordinator leave the network I want to reset all!

Entries in tables have expiration time. You have to wait this time.

What do you mean by "reset all" ?

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

What do you mean by "reset all" ?

I want to restart without any node in table and manually rejoin all nodes.
I'm trying with PDS_SetToDefault()... is it right?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DiegoKer wrote:
I'm trying with PDS_SetToDefault()... is it right?

Yes. But do you really need power failure in this case?

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes because if the coordinator have a power failure (is powered by net), he must reconnect all the nodes and all must work. Only if I destroy the network I want to restart in a blank state.

Other question:
I had a problem whit ram variables ... them seem to be overwriten by a precompiled library and this is happened when I cancelled the allocation of appMessage variable in the Wsndemoapp (I started from here for develop my app).
Now I reallocated it and all work (I hope...)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DiegoKer wrote:
I had a problem whit ram variables ... them seem to be overwriten by a precompiled library and this is happened when I cancelled the allocation of appMessage variable in the Wsndemoapp (I started from here for develop my app).

I don't quite understand what the problem is here. Can you describe it in more detailed way?

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,
what is the maximum value of CS_END_DEVICE_SLEEP_PERIOD? Is it counted in ms?

thx.
sandmann

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sandmann wrote:
what is the maximum value of CS_END_DEVICE_SLEEP_PERIOD? Is it counted in ms?

Technically it is 32 bit number but values are limited due to the fact that this number is used in some calculations. I don't remember the exact number but it is around 2.9 days counted in ms.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, thanks. I thought, ZigBee had some restrictions for this. What is the maximum number that works? I mean, the crystals are inaccurate, so the clocks of the coordinator and end-device are drifting...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sandmann wrote:
Ok, thanks. I thought, ZigBee had some restrictions for this. What is the maximum number that works? I mean, the crystals are inaccurate, so the clocks of the coordinator and end-device are drifting...

Setting large times is impractical because this will also be a timeout for the record in the parent's table.
Clock drifting is negligible here because for the record timeouts on the parent this value at least doubled.

We have tried 24 hours maximum on a LowPower application, everything worked as expected.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

1. When BC 1.8 will be released?
2. If I need a network with about 10-40 devices, and don't need to change it in future (they will be all time at same place and same quantity), may be it is possible for coordinator at first time memorize all network topology in eeprom for next times don't check all devices and for read it from memory for speed up initializing process?
3. If data from C to ED transmit through R, it it possible in R to read this data and make IRQ when R retransmit smthg?
4. It is possible to turn off LQI and RSSI mechanism (that find better path) when sending data?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
1. When BC 1.8 will be released?

Release is ready, but it is not on the site yet.

code-by wrote:
2. If I need a network with about 10-40 devices, and don't need to change it in future (they will be all time at same place and same quantity), may be it is possible for coordinator at first time memorize all network topology in eeprom for next times don't check all devices and for read it from memory for speed up initializing process?

There is Power Failure feature, but it needs to be enabled on all devices, not only coordinator participates in network establishment.

code-by wrote:
3. If data from C to ED transmit through R, it it possible in R to read this data and make IRQ when R retransmit smthg?

No, it is impossible.

code-by wrote:
4. It is possible to turn off LQI and RSSI mechanism (that find better path) when sending data?

No, it is a part of standard. Why would you need this?

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lucicop wrote:
New question: function ZDO_GetNeibTable receives a pointer to a ZDO_Neib_t table. The number of entries is given by the function ZDO_GetNeibAmount ? Are they ordered ? The total of entries is routers + end devices ?

This means I have to create an array of neighbor tables for the function to fill out? All I want to do is find out the addresses of the nodes connected directly to the coordinator whether they are routers or end devices. If I use ZDO_GetChildrenAddr all I get are the end devices. How can I find out the addresses of the routers that are connected? Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

strawbot wrote:
This means I have to create an array of neighbor tables for the function to fill out?

Yes.

strawbot wrote:
If I use ZDO_GetChildrenAddr all I get are the end devices. How can I find out the addresses of the routers that are connected?

Look in 'relationship' field of a table. If it is RELATIONSHIP_NONE_OF_ABOVE then it is router. But technically routers are not 'connected' in mesh network. Neighbor table just contains all devices that node knows about.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Alex,
I still have some problems with my app:
1. When a ED make a rejoin from C to R and start to send message to C, this one don't ack at aps level. With BC 1.8.0 C start to responde with aps ack after about 1 minute and half. Is it normal? What I have to do for a quickly reaction?
2. With BC 1.8.0 I notice that ED prefers C beacons and rarely join under a R. In some cases R don't emits beacons.

Wich is the best compiler and release for BC?

thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DiegoKer wrote:
Is it normal? What I have to do for a quickly reaction?

It does not look normal. Can you describe test case in more details? What is the reason for rejoin?

DiegoKer wrote:
2. With BC 1.8.0 I notice that ED prefers C beacons and rarely join under a R. In some cases R don't emits beacons.

Any device while joining selects beacon with best LQI and RSSI. No other preferences. R (and C actually) sometimes may not hear beacon request, it should not be too often, but it happens.

DiegoKer wrote:
Wich is the best compiler and release for BC?

Release - latest. Currently BitCloud is tested with WinAVR-20090313, I don't remember version of IAR compiler.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

It does not look normal. Can you describe test case in more details? What is the reason for rejoin?


ED join under C - R is on the office windows - ED move outdoor and try to send data - C is no reachable - ED rejoin under R - ED try to send data 13 times without any aps ack - after 14th attempt the aps ack is received (about 1 minute later)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DiegoKer wrote:
ED join under C - R is on the office windows - ED move outdoor and try to send data - C is no reachable - ED rejoin under R - ED try to send data 13 times without any aps ack - after 14th attempt the aps ack is received (about 1 minute later)

Coordinator holds record that for ED address it should use indirect buffer to send data, when ED changes parent coordinator does not know about this.
So this situation is predictable.

To workaround this you may try to send Leave Request after rejoin to old parent (coordinator in this case) with request to leave device with it's address. It still will take some time since leave request to non-existing child will also be sent via indirect transaction and stack will have to wait until this transaction expires.

I see correct way of handling this, but it needs to be implemented in BitCloud, I'll try to do so.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Alex!
I have some questions about association – disassociation procedure. First of all I programmatically assign parent address to each node.

The problem is that C can’t get a full report of the disassociation traffic because on parent's side, MgmtNwkUpdateNotf() won’t run for router child disassociation.
This problem is extended, because if child router rejoins network, it won't join former parent because no disassociation from this parent took place.
I read at user guide that this is normal, but

1) How will C know which R has left the network?

2) I don't want C to have more than 3-4 router childs that I will choose and not be chosen randomly by the stack.

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

alexis4 wrote:
Hi Alex!
I have some questions about association – disassociation procedure. First of all I programmatically assign parent address to each node.

You can't do anything like this. Most of your requirements violate specifications.
Some of them may be implemented (like setting address of a parent) but make no sense since device may choose to change parent right after join. And for routers there are no such term as 'parent', all routers are equal.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK thank you! :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I see correct way of handling this, but it needs to be implemented in BitCloud, I'll try to do so.

Thank you alex,
I'm in your hands...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Alex,
if you are working for next relase of BC notice that
there is a small problem in makefile (BC 1.8.0): my app projects are in subdirs respect to the sample apps and can't compile simply changing the paths in configuration file, I had to modify the follow line in makefile:
-------Application objects creation---------------
from
objs/%.o: src/%.c
to
$(APP_PATH)/objs/%.o: $(APP_PATH)/src/%.c

... if it can be a small contribution

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you. I'll correct this.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello alexru,

In my setup I've noticed a very strange behaviour. I used a sniffer and it seems like routers are forgetting their childs.
There are a lot of route discovery messages from every router. Even from the parent of the destination end device! It seems like the router isn't aware of his child. Same unicast communication works reliable with routers as destination.

I'm using Bitcloud 1.8.0 for ZigBit 900. WSNDemo is used as a skeleton for my own application. Stack parameters are close to originals, but predefined PANID. Security is used. UIDs are unique. 6 EDs, 4 Rs and 1 C.

For me it seems like the issue has been introduced with 1.8. - 1.7 worked somehow better (for me).

Do you have any hints?

Thanks,
Carsten

Edit: more details

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

CasaQu wrote:
In my setup I've noticed a very strange behaviour. I used a sniffer and it seems like routers are forgetting their childs.

That's weird. I'll try to check this. Meanwhile maybe you could send sniffer logs or even screenshots.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If I have a "network" of 1 end device and 1 coordinator, and I shut down the end device, what kind of indication should I get on the coordinator?

When I tried this out, I got ZDO_MgmtNwkUpdateNotf() with nwkParams->status=ZDO_NETWORK_LEFT_STATUS. Is it normal? It seems a bit weird to me, to get such an indication on the coordinator...

thx.
Sandmann

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sandmann wrote:
Is it normal? It seems a bit weird to me, to get such an indication on the coordinator...

That is strange. Network left is indicated to device that gracefully left the network (and was not just powered off). In your case you should not get any notifications.

You still may get it on coordinator though, since 'leave network' command may be sent to any device in network including coordinator. Furthermore coordinator is not required for network to function properly, it is only required for network establishment.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In BC v.1.8 broadcast bug in lowpower app wath fixed?
When BC will support C from one network send data to C of other netw?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
In BC v.1.8 broadcast bug in lowpower app wath fixed?

Should be.

code-by wrote:
When BC will support C from one network send data to C of other netw?

Right when it will be in ZigBee spec :)

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I test broadcast in LP v. 1.8 (change only ack=0 and dest. addr to 0xffff) and this work. But I can't compile in BC 1.8 my modified LP from BC v. 1.6 :(
may be I need use config and makefile from v. 1.8 (and make other changes in my 1.6)?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
may be I need use config and makefile from v. 1.8 (and make other changes in my 1.6)?

Do you really have any other options?

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

alexru wrote:
code-by wrote:
may be I need use config and makefile from v. 1.8 (and make other changes in my 1.6)?

Do you really have any other options?

not options, but code in C and H-files.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I meant options other than getting Configuration and Makefile from new release. Their structiore has been changed slightly.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have two ED with 0x0001 short address working at the same time - it is a bug? (BC v1.8, LP app, broadcast, ack=0) :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
I have two ED with 0x0001 short address working at the same time - it is a bug? (BC v1.8, LP app, broadcast, ack=0) :)

No, it is not. They only look like they are working, what happens in reality is hard to predict. Static addressing is not in ZigBee spec. Coorrect configuration should be ensured by the user.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But both boards send data to C and C display them in Hyperterminal.
I copy configuartion and makefile from LP 1.8 to my modified 1.6, and now compiler show next errors:

-----------------Linking---------------------------
avr-gcc -L../../BitCloud/Components/../lib -L../../BitCloud/Components/./BSP/lib -L../../BitCloud/Components/./ConfigServer/lib -L../../BitCloud/Components/./PersistDataServer/lib -Xlinker -Map=./list/lowpower.map -Wl,--gc-sections -mmcu=atmega1281 -Wl,--s
cript=./linkerScr/atmega1281.ld -g ./objs/boardabstraction.o ./objs/coordinator.o ./objs/enddevice.o ./objs/lowpower.o ../../BitCloud/Components/../lib/WdtInitatmega1281Gcc.o -lBc_All_Atmega1281_Rf230_Gcc  -lConfigServer  -lPersistDataServer  -lBSPMeshBean
  -lHAL_ZigBit_Atmega1281_8Mhz_Gcc -lBc_All_Atmega1281_Rf230_Gcc -o lowpower.elf

./objs/boardabstraction.o: In function `ShowMessage2':
D:\ZigBit\BitCloud_ZIGBIT_1_8_0\Sample Applications\Lowpower2/src/boardabstraction.c:210: undefined reference to `USART_Write'
./objs/boardabstraction.o: In function `boardAbstractionOpen':
D:\ZigBit\BitCloud_ZIGBIT_1_8_0\Sample Applications\Lowpower2/src/boardabstraction.c:185: undefined reference to `USART_Open'
../../BitCloud/Components/../lib\libBc_All_Atmega1281_Rf230_Gcc.a(zdoBindingManager.o): In function `zdoBindManagerInd':
zdoBindingManager.c:(.text.zdoBindManagerInd+0x272): undefined reference to `ZDO_BindIndication'
make: *** [lowpower.elf] Error 1
//boardabstraction.c

#include   
...
void boardAbstractionOpen(void)
{
  USART_Open(&usartDescriptor); // Open USART
  appOpenLeds();
  appOpenButtons(NULL, keyReleased);
}
...
{
void ShowMessage2(uint8_t *buffer, uint16_t length)
{
  USART_Write(&usartDescriptor, (uint8_t*)buffer, length);
}
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Problem is solved.
1. copy boardstubs.h from new to old,
2. add ZDO_BindIndication from lowpower.c from new to old.

Pages