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

What difference is between VCP and USART? When I need use VCP and when USART?

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

code-by wrote:
What difference is between VCP and USART? When I need use VCP and when USART?

USART is a physical port.
VCP (virtual COM port) is emulation of COM port via USB.

VCP is available only on platforms with USB support.

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

May be in meshbean board with USB (virtual com port) better to use VCP (now APP_USE_NONE) or this don't matter?

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

code-by wrote:
May be in meshbean board with USB (virtual com port) better to use VCP (now APP_USE_NONE) or this don't matter?

On MeshBean VCP is implemented in cp2102 chip. From application point of view it looks like USART1.

VCP option in configuration is for platforms where USB is built into processor (USB Stick).

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 we have 60 ED, each of it in chaotically order every 10 seconds will simultaneously send data to coordinator (may be all ED practically will send in the period of 1 second), is there possibility to receive all this data in coordinator OR in this case I must make request to every ED before it can send data to coordinator for exclude data lost?

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

code-by wrote:
if we have 60 ED, each of it in chaotically order every 10 seconds will simultaneously send data to coordinator (may be all ED practically will send in the period of 1 second), is there possibility to receive all this data in coordinator OR in this case I must make request to every ED before it can send data to coordinator for exclude data lost?

For 60 ED comfortable sending rate for every device is about 30 seconds. There is no way you'll get 60 devices sending every second.

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

How much application timers I can use (run) at the same time?

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

code-by wrote:
How much application timers I can use (run) at the same time?

As much as memory allows you.

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 Alexru,
Is it very cold in Moscow? Here Montreal is -13C.
I bought some ATZB-24-A2 zigbee modules for my prototype without buying ATZB-DK-24 the development kit.
I soldered the ATZB-24-A2 in my PCB, and I have the jtag port to the zigbee module. Now the uart doesn't work.
Can I work with ATZB-24-A2 zigbee module through Uart by AT-commands without buying ATZB-DK-24.
From Atmel web I can't find the hex file sn_stdAll.hex. The only one I found is serialnet.hex, the size is 326kb. Looks too big for ATmega1281 inside the ATZB-24-A2 module.
If I need to buy ATZB-DK-24 the zigbee development kit, where I can get it in time.

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

bigben91630 wrote:
Is it very cold in Moscow?

It is -22 here :)

bigben91630 wrote:
Can I work with ATZB-24-A2 zigbee module through Uart by AT-commands without buying ATZB-DK-24.

Yes, you can.

bigben91630 wrote:
The only one I found is serialnet.hex, the size is 326kb. Looks too big for ATmega1281 inside the ATZB-24-A2 module.

This is correct file. HEX file contain binary data in ASCII format plus some other extra information, so it is about 2.5 times larger than raw binary.

Use AVRStudio to flash this image to the module.

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 Alexru!

Got OK feedback from ATZB-24-A2 module after flashing serialnet.hex image to it.

Happy holiday!

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

Hello and Merry Christmas to all!
I read carefully this post from the beggining to the end. In December 7:

alexru wrote:
For 60 ED comfortable sending rate for every device is about 30 seconds. There is no way you'll get 60 devices sending every second.
I would like to develop an application capable of 1000 nodes (ED mostly and some routers), plus retransmition routers where necessary.
The devices will send to coordinator every 1 minute to declare they are present and then go to sleep again.
If a device gets an alarm, it gets an external irq and sends the alarm to coordinator. This alarm should get to coordinator within 7 seconds (maximum). In an alarm case, the coordinator must broadcast data to all routers of the network, within a few seconds.
The frame will be as big as in WSNDemo project and the network will operate at 868MHz.

Can this scenario be implemented? If not, what is the maximum number of devices I could have for reliable communication?

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

alexis4 wrote:
the network will operate at 868MHz.

So you'll have 1000 packets / 60 secs = 17 packets in second in ideal case (without routing and retries). In real life there is routing, data loss and devices do not send in evenly distributed manner.

At 868 MHz data rate is limited compared to 2.4 GHz.

Based on this I would say that this is impossible.

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 Alexru,

I am able to change MAC by Atcommands, but after reboot it changes back to factory setting. So how can I save it to EEPROM by Atcommands?

Sorry, after read new menu, I can save it by ATZ without wait for 5 mins.

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

For BitCloud 1.6 when the device:
1. was in network state and
2. the ZDO_StartNetworkReq() was called
it did not return status = ZDO_SUCCESS_STATUS nor any error code.

This could have lead to a deadlock.

For BitClould 1.7 I read only:
"*[ZIGBEE-229] Sometimes ZDO functions do not return confirm"

Does this mean tgat the ZDO_StartNetworkReq() issue was fixed?

Thanks

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

From the release note:
"*[ZIGBEE-310] Migrate to new version of GCC."

Which version? What version of WinAvr was used?

Thanks

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

What does OTAU stand for:
"*[ZIGBEE-136] Implement OTAU prototype"
(Over The AirUpgrade maybe? :o)

Thanks

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

EGTOGAMAT wrote:
Does this mean tgat the ZDO_StartNetworkReq() issue was fixed?

Yes.

EGTOGAMAT wrote:
Which version? What version of WinAvr was used?

Latest one, 20090513.

EGTOGAMAT wrote:
Over The AirUpgrade maybe?

Yes, this is correct.

Fixed issues text is header from our bug tracking system.

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

Where can I find some docs/gui on how to use the Over the Air Upgrade feature?

Thanks

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

EGTOGAMAT wrote:
Where can I find some docs/gui on how to use the Over the Air Upgrade feature?

For now the only way is to ask avr@atmel.com. Technology is not public available.

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:
Based on this I would say that this is impossible.
You fed me with a lot of thinking on how should I move on alexru. But there are a couple of things before I decide what to do:
1. Even for very small CS_INDIRECT_POLL_RATE values (below 10), sleep time is almost 100ms. Is this the best I can get?
2. If I wake up with external irq, this time rises to 1sec. This makes it even harder to achieve lots of nodes. Can I do something to reduce this time? Below is the irq code I use inside WSNEndDevice.c:

void irq6_handling (void)
{
    HAL_Disable Irq (IRQ_6);  //I re-enable irq6   
               //before ZDO_SleepReq(&sleepReq)	
    ZDO_WakeUpInd(); 
}

If I can achieve let's say 360 nodes (6 devices wake up per second), it won't be a disaster. Else I must reconsider using ZigBee.

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

alexis4 wrote:
1. Even for very small CS_INDIRECT_POLL_RATE values (below 10), sleep time is almost 100ms. Is this the best I can get?

CS_INDIRECT_POLL_RATE is how often end device sends poll packet to it's parent. 10 ms is minimum value because of application timer resolution. But are you sure you want device to send packet every 10ms? It's huge load on air.

It is not directly connected to sleep time, but even with 10 ms poll rate device still needs to wait for response from parent, this may take a while.

alexis4 wrote:

ZDO_WakeUpInd();

This is totally wrong. In interrupt you should call ZDO_WakeUpReq() and wait for confirm. I can't imagine how it even works with code like this.

UPD: Much better approach is to do PostTask() in interrupt and handle it in task handler state machine.

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

alexis4 wrote:
If I can achieve let's say 360 nodes (6 devices wake up per second), it won't be a disaster. Else I must reconsider using ZigBee.

This will be hard. Almost impossible if you don't allow packet loss.

Not only with ZigBee but virtually with any technology, air is bottleneck here. Beacon mode of operation might help in this case, it is defined in IEEE 802.15.4 but is not used by ZigBee. It is much harder to implement.

ZigBee supports large networks, but distributed ones with small local groups of devices with rare communication between groups, not when 100 devices send data to coordinator every second.

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:
alexru wrote:
If you don't need to sense presence of fob from master then do as I described, for every command do join-send-leave procedure.

Yes, I will try that, to see how fast it is done, thank you !

Happy holidays to all of you !

Alex, I am now trying to do what you suggested (join-send-leave),but I'm not sure how to do each op. Join - is it ZDO_StartNetworkReq ? Leave - is it ZDO_ZdpReq (ZDO_MgmtLeaveReq_t) with IEEE address set to NULL ?

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

lucicop wrote:
Join - is it ZDO_StartNetworkReq ?

Correct.
lucicop wrote:
Leave - is it ZDO_ZdpReq (ZDO_MgmtLeaveReq_t) with IEEE address set to NULL ?

Not NULL, just 0. NULL is a pointer, 0 is a self address.

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

Wow, this is fast :) Thank you. I tried that, and it is pretty fast. But it seems the binding tables are affected - is it so ? Do I have to bind again after this ?

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

I have modified the demo Pingpong for what I'm trying to demonstrate. The variable appState seems to be corrupted between APS_DataReq() and APS_DataConf confirmation. Do you have any idea why ? I have called bind request after joining, and it seems to work, but now I have this problem with appState corruption.

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

lucicop wrote:
I have modified the demo Pingpong for what I'm trying to demonstrate. The variable appState seems to be corrupted between APS_DataReq() and APS_DataConf confirmation. Do you have any idea why ?

Show modifications you have made.

lucicop wrote:

I have called bind request after joining, and it seems to work, but now I have this problem with appState corruption.

Do you really need binding for such a simple operation?

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

Well, I don't need binding for this. It was a combination of concepts I was trying to demonstrate. I will figure out myself the cause of the corruption, since the modifications are pretty large.

How will work the join/leave procedure when security is activated ?

[LE] I have found the cause of the corruption: I had a buffer of 89 chars declared as static - is this a problem with the stack ?

But now it seems there is another problem: sometimes the joining fails (timeout), and so it takes a long time to send a message. Is it possible to use a more simple rejoin procedure instead of full joining ?

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

lucicop wrote:
How will work the join/leave procedure when security is activated ?

With preconfigured keys basically the same way, frames will be encoded with a key and that's all. With not preconfigured key extra time will be spent on key request-transfer.

lucicop wrote:
[LE] I have found the cause of the corruption: I had a buffer of 89 chars declared as static - is this a problem with the stack ?

Hard to say, 89 bytes of data by themselves are harmless, it depends on surrounding data and code.

lucicop wrote:
Is it possible to use a more simple rejoin procedure instead of full joining ?

In new release of BitCloud it will be possible to setup scan interval and scan attempts count before reporting fail. You may tweak this values. Otherwise - no, there are no simple rejoin procedure.

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:
In new release of BitCloud it will be possible to setup scan interval and scan attempts count before reporting fail. You may tweak this values. Otherwise - no, there are no simple rejoin procedure.

Will it be possible to deactivate the failure reporting ? I saw that Freescale stack has a feature: silent leave and silent rejoin. Basically, the parent doesn't know that the child is missing, this means that there is no failure reporting mechanism.

[LE] Is it possible (now or in future releases) to have a device part of multiple Zigbee networks ? (not as the same time, but to avoid rejoining) Or is it possible to just load the PAN ID/NWK Address and send a message to an address, assuming that you were previously registered into that PAN ?

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

lucicop wrote:
Basically, the parent doesn't know that the child is missing, this means that there is no failure reporting mechanism.

Parent keeps records for its children. How long should it keep it in case of silent child removal?
Can you give detailed description of how this feature works? Link to freescale document would be good.

lucicop wrote:

[LE] Is it possible (now or in future releases) to have a device part of multiple Zigbee networks ? (not as the same time, but to avoid rejoining) Or is it possible to just load the PAN ID/NWK Address and send a message to an address, assuming that you were previously registered into that PAN ?

I don't think so. It is not in ZigBee specification. And end device sends data via its parent, so someone must already know about this device.

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 will search for a link, but after tomorrow, for the moment I have a limited internet connection. I found this in Zigbee Wireless Networking book, on page 240 - Starting and Stopping Zigbee with ZDO.

alexru wrote:
Parent keeps records for its children. How long should it keep it in case of silent child removal?

The parent could have a timeout for the messages intended for its children.

alexru wrote:
I don't think so. It is not in ZigBee specification. And end device sends data via its parent, so someone must already know about this device.

I meant that the device could have more parents and alternately silent join to one of them.

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

lucicop wrote:
The parent could have a timeout for the messages intended for its children.

This timeout is CS_MAC_TRANSACTION_TIME, after this time MAC transaction considered expired and data sending is finished with 'fail' status. After few such fails device considered lost and removed from tables.

lucicop wrote:
I meant that the device could have more parents and alternately silent join to one of them.

The only difference from current situation is that network loss is indicated on child and application itself must start network search again.

Search time will not be decreased if stack will do it by itself.

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 gave it up and bought a couple xbee modules ;)

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

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

Torby wrote:
I gave it up and bought a couple xbee modules ;)

Well, that's sad :(

Can you please summarize what was "wrong" with BitCloud? And what you expected to see?

I can't promise to make things better right away but at least I'll have something to say at meetings.

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 all, happy holidays! :)

Torby, what in xbee better than bitcloud?

alexru, when new version of bitcloud will be released?

In case if I have distance between router A and coordinator is 10 meters and between router A and router B is 1 meter, when I send message from A to B it go via coordinator or direct from A to B? thank :)

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

code-by wrote:
Torby, what in xbee better than bitcloud?

Xbee is module similar to ZigBit with programmed SerialNet.

code-by wrote:

alexru, when new version of bitcloud will be released?

I don't know for sure. Somewhere at the beginning of 2010.

code-by wrote:

In case if I have distance between router A and coordinator is 10 meters and between router A and router B is 1 meter, when I send message from A to B it go via coordinator or direct from A to B? thank :)

It depends on LQI (link quality indicator) and RSSI (received signal strength indicator). Which are depend on distance, antennas quality and orientation, signal fading etc.

In ideal case it will be sent direct from A to B.

BitCloud does its best to ensure optimal routing. That's what ZigBee PRO is all 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

It is possible to send from A to B directly w/o check LQI and RSSI?

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

alexru wrote:

This timeout is CS_MAC_TRANSACTION_TIME, after this time MAC transaction considered expired and data sending is finished with 'fail' status. After few such fails device considered lost and removed from tables.

In my point of view, this is a feature, and the user should be able to choose if it wants it or not.

Regarding silent join and leave, it is described in this file: BSSRMZB2007.pdf that you can find on Freescale Web Site. I would be very interested to have something similar in BitCloud. Anyway, for me, the advantage of BitCloud is that is doesn't force you to buy an expensive compiler.

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

code-by wrote:
It is possible to send from A to B directly w/o check LQI and RSSI?

BitCloud checks it automatically. All you have to do is specify source and destination address. The rest is what BitCloud does and why it is actually needed :)

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:
In my point of view, this is a feature, and the user should be able to choose if it wants it or not.

We have specification which we should follow to pass certification tests. This behavior is clearly stated in specification, we just implemented it.

UPD: We can implement whatever we want, but it will not be compliant with other vendors, which is bad from ZigBee Alliance point of view.

lucicop wrote:
Regarding silent join and leave, it is described in this file: BSSRMZB2007.pdf

I'll see it. Probably after new year holidays.

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! I have been having problems with the sleep-mode for a few days. My program should go to sleep mode, and immediately after the wake-up indication, it should move to an other state, and do other things. Instead of doing that, it wakes up, the indication is called, and it goes again to sleep mode. Does anybody have a clue, why?

My code:

uint32_t sleepPer=1000;
CS_WriteParameter(CS_END_DEVICE_SLEEP_PERIOD_ID, &sleepPer);

...

case APP_PREPARE_TO_SLEEP:
  if(IsUARTBusy()){
  	SYS_PostTask(APL_TASK_ID);
  }else{
  	appState=APP_SLEEP;
      	zSleepReq.ZDO_SleepConf=ZDO_SleepConf;
	ZDO_SleepReq(&zSleepReq);
  }
break;
...
case APP_WOKE_UP:
     uartInit();
     SendUART("woke up\r\n");
break;

...

void ZDO_WakeUpInd(void)
{
	SendUART("wup indication");
	appState=APP_WOKE_UP;
	SYS_PostTask(APL_TASK_ID);
}

Thx.
Balazs

Edit 1: I use BitCloud 1.6
Edit 2: I get in HyperTerminal only this:

Quote:
wu
. My UART stack should work, it has been tested, the problem should not be there...

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

sandmann wrote:


case APP_WOKE_UP:
     uartInit();
     SendUART("woke up\r\n");
break;

void ZDO_WakeUpInd(void)
{
	SendUART("wup indication");
	appState=APP_WOKE_UP;
	SYS_PostTask(APL_TASK_ID);
}


So you are calling SendUART() and post task. And then in APP_WOKE_UP you are calling uartInit().

How this will work depends on how SendUART() is implemented.

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, you are right. Now I tried with this:

case APP_WOKE_UP:
  SendUART("woke up\r\n");
break;

...

void ZDO_WakeUpInd(void)
{
  uartInit();
  SendUART("wup indication");
  appState=APP_WOKE_UP;
  SYS_PostTask(APL_TASK_ID);
}

But got the same message. When I tried to debug the code, I experienced, that after WakeUpInd(), the APL_TaskHandler() is never called again. (Even when I commented the SendUART in WakeUpInd()...)

Thx.
Balazs

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

1. UART: try sending this string to uart right from first APL_TaskHandler(), befire sleep.

Remember that you should not block execution more than 10 ms in a row.

2. I can't tell whats happening, try starting with working application (LowPower for example) and add your code slowly to see where it start hanging.

Anyway after ZDO_WakeupInd BitCloud never goes to sleep by itself. You should explicitly put it to sleep.

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

[This post can be ignored.]

Is it true that .bss section is only 500 bytes large ? If so, can I set the linker script to be larger ? (BitCloud for Zigbit)

LE: I saw that this is not true, bss is just after data section ends. But I don't understand why, when I have some large variables, but that still fit into memory, I have strange behaviour: data corruption, stack resets... Any ideas here ?

ELE (even-later-edit): Well, it was my mistake. It has nothing to do with the stack or with the variables, but with a part of code I had ported from somewhere, and not verified enough.

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

Alex, one thing that I didn't find in the documentation: how fast can an app timer be set to run ? Is it ok at 100ms ?

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

lucicop wrote:
Alex, one thing that I didn't find in the documentation: how fast can an app timer be set to run ? Is it ok at 100ms ?

Application timer resolution is 10ms. Minimal value is also 10ms (you may set lower values, but they will be rounded to 10ms).

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

It is possible coordinator of one [sub]network to send data to coordinator of second one?

Pages