| DevJournal - Zigbee Broadcasts Are Up | | Print | |
| Written by Akiba | |
| Saturday, 14 June 2008 | |
|
I finally got the Zigbee broadcasts working. It's a slight deviation from my original plan to get the mesh routing working, but as I was going through the mesh code, I realized that it requires the use of broadcast transmissions. So I figured why not get broadcasts up first. I ran into numerous problems with broadcasts. Even though I tested it in my original test fixture, it was only capable of testing two devices which was almost a trivial case. When I tested it out in the simulator with a multi-node network, I ran into infinite broadcast loops that kept on crashing my stack. So many data transmissions were flying around that it would immediately exhaust the buffer pools in all the nodes and they would end up hanging. Hmmm...need to do something about that too. I should be able to recover gracefully if I exhaust my buffers. Anyways, I almost had to rewrite the broadcast handling code to get it to work. I didn't take into consideration a couple of different situations that I should have thought of. I also found a lot of repetitive code that didn't need to be there so I cut all of that out. Finally, I got things to work and tested it on a five node network with the topology I mentioned previously . Ahhh...now I can go home and drink a beer. I've been working out of hamburger shop on a Saturday night. Not the best way to spend a weekend. I'm sick of the smell of burgers and fries. If you're ever at a Mos Burger in Japan, you should try out the rice burgers, though. They're pretty interesting.
Email This
Hits: 825 Trackback(0)
Comments (0)
![]() Write comment
|
| about broadcast |
DevJournal - Zigbee Broadcasts Are Up
Jul 03 2008 07:24:50 This thread discusses the Content article: DevJournal - Zigbee Broadcasts Are Up
I have met the problem about broadcasting. I am interested to know how you figure out this problem. I use mc13213 from freescale,it has 4k ram,but when i use broadcast mode, after 3packets sending,the sending process is stopped until 5s later. I think this is the problem you have met before. |
#142 |
| Akiba |
Re:DevJournal - Zigbee Broadcasts Are Up
Jul 03 2008 08:36:00 Do you happen to have a protocol analyzer trace file? I am currently using the Microchip Sniffer for Zigbee protocol analysis. If I could see what's going on in your network, it'd probably be easier to comment.
In any case, broadcasts are very sensitive to how they are implemented. If it's not handled right, then you set off a broadcast storm, where they spiral out of control. If you are using the Freescale stack, then chances are the broadcasts should be working correctly. My issue was that I was implementing the broadcast handling myself. I can think of two possible issues that you might have run into. 1) It's possible that you used up your buffer pool by sending out the three broadcasts. If you have a network with five nodes, then sending out one broadcast frame results in four frames being received. If you send out three broadcasts with little delay in between, then there's a possibility that you received enough frames to exhaust your buffer pool. 2) It's possible that the Freescale stack has trouble handling multiple broadcast transactions. Zigbee broadcasts use a passive ack mechanism meaning that you wait for a certain period and then check to see which of your neighbors returned your broadcast frame. If all your neighbors sent you back your original broadcast, then you can assume you reached everyone and you end the broadcast. If not, then you retry. The problem may arise if you send out a new broadcast before the old one ends. This is a tricky situation in terms of implementation so it might have unusual consequences. Unfortunately, I can't give an exact answer. It would probably be more obvious if you had a sniffer trace file. However, one thing that might help is if the Freescale stack allows you to control the broadcast radius. That means how many hops the broadcast can travel before it dies. If it exists, I would set the broadcast radius to one hop and see if you still have a problem. If not, then it was probably a buffer issue. |
#143 |
| Akiba |
Re:DevJournal - Zigbee Broadcasts Are Up
Jul 03 2008 08:37:15 I should also mention that it's probably wise to use broadcasts as little as possible. They propagate exponentially and they're difficult to control.
|
#144 |
| thanks for your reply |
Re:DevJournal - Zigbee Broadcasts Are Up
Jul 03 2008 09:49:04 Actually, I only use 2 nodes, the structure of the zigbee system is "serial port--zigbee--zigbee--serial port".
For avoiding the broadcasting storm, I have canceled the ack and set the radius as 1,change the MaxBroadcastTransactionTableEntries as 5(default is 3), but the behavior is as usual. So, before freescale can give me a satisfied answer, I will take your advise to give up the broadcast mode. I will concern on your stack, hoping you can conquer all the problems and show us a well worked zigbee stack. |
#145 |
| Akiba |
Re:DevJournal - Zigbee Broadcasts Are Up
Jul 04 2008 00:55:27 Looks like you probably don't have to worry too much about broadcast storms with two ports
Most likely, the problem is just with some type of setting in the stack. This looks like a job for Freescale support. Regarding my stack, I'm telling most people not to expect too much from it at first. Once I can release the code, there will be a lot of bug fixing and modifications. The important point to me is that all the users will have access to complain directly to me. I believe that the author of the code should be the same one that supports it. Unfortunately, many companies don't understand this. |
#148 |
| alex |
Re:DevJournal - Zigbee Broadcasts Are Up
Jul 04 2008 10:06:47 Just enjoy your process,not only the end.
Even if I work for a company designing home appliances, I still pay lots of time studying on the control theory, mobile platform and graphic processing algorithms, just for fun. I admire your plentiful time on the zigbee stack. It is good for you to know the mechanism of the stacks,not only for zigbee, but also bluetooth, tcp/ip. If you have add the task scheduler into the stack, you may know much more about os. I would like to learn a stack from the 3rd part, but if designing the product, I would consider freescale or Ti' zstack, after all, reliable is everything. |
#149 |
| < Prev | Next > |
|---|