Home arrow Projects arrow FreakZ Zigbee Stack
FreakZ Open Source Zigbee Stack | Print |
Written by Akiba   
Tuesday, 18 November 2008

Background:

Zigbee is a low-power, low-cost, wireless sensor networking protocol defined by the Zigbee Alliance. The protocol was designed for low data rate wireless networks to facilitate automation and monitoring for applications such as home/building/HVAC automation, industrial control, farming, patient monitoring, and many other applications that could take advantage of low cost wireless communication and don't have a high data rate requirement.

Motivation:

One of the problems with the current state of Zigbee is that the software is either provided by semiconductor suppliers and bound to their hardware, or is proprietary and requires heavy licensing fees. This causes some major issues that I have a problem with:

1) It's very difficult for individual electronics enthusiasts to create their own Zigbee designs since they usually cannot afford the licensing fees or the costs of the proprietary tools (compilers, debuggers, etc) associated with developing a Zigbee application. In many cases, some of the most innovative creations come from individual enthusiasts or people with specific domain knowledge that might not be addressed by software or semiconductor vendors. I'm hoping that having a free stack with full source code access will allow people the freedom to create interesting things and hopefully create projects that can improve other people's lives.

2) It's almost impossible to mix and match hardware to optimize an application. Some designs are limited to using an ARM microcontroller since it may be part of an SOC that's needed for a specific application, ie: MP3 or video decoding. However the application would benefit from the addition of wireless communications. There currently isn't an easy way to take an MCU such as an ARM based one and mix it with an 802.15.4 radio from a different vendor to make a Zigbee application. This is because the Zigbee software given away by semiconductor vendors is either in binary form or contains a license clause which only permits the use of the software with their hardware. Software companies selling proprietary stacks usually charge stack licensing fees that can go upwards of $50k and also require fees for driver modification for specific MCUs. One of the goals of this project is to provide a free Zigbee stack which will give designer's flexibility in choosing their components with no proprietary lock-in.

Download:

The FreakZ Zigbee stack is an open source stack that is currently under development. The latest source code can be downloaded at SourceForge at the following address:

http://www.sourceforge.net/projects/freakz

The source can also be downloaded from the SourceForge Subversion repository here:

https://freakz.svn.sourceforge.net/svnroot/freakz

You can browse the documentation in html format from the following link:

http://www.freaklabs.org/freakz/v0_75/html/index.html

You can download the FreakZ Simulator and USB Hardware Command Line Interface here:

http://www.freaklabs.org/freakz/v0_75/FreakZ Simulator Interface.pdf

 

Hits: 27811
Trackback(0)
Comments (33)Add Comment
amazing!
written by arnold cahn, April 12, 2009
hello, i'd like to thank you for the amazing job you are doing. I hope to be able to test your zigbee stack soon.
report abuse
vote down
vote up
Votes: +1
...
written by Akiba, April 12, 2009
Thanks! It's taking a lot longer than I expected because of the documentation, testing, and bug fixes. But it's also much more interesting than I expected it to be.
report abuse
vote down
vote up
Votes: +3
...
written by Geoff, April 26, 2009
hey what development tools are you using Akiba? Visual studio? or something else?
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, April 26, 2009
Ha ha ha...wouldn't touch Visual Studio for embedded development, although it's a great IDE for Windows Application dev. I mostly use Slickedit which is a text editor with a lot of extra features and can integrate GCC into its build function. It's a commercial text editor though, and I think that Eclipse is probably just as good or better. I just haven't had the time to play with it too much.
report abuse
vote down
vote up
Votes: -1
Great Job
written by DivineBlade, May 26, 2009
Hi Akiba....great job with the open source zigbee stack......I have a question though......Is the FreakZ stack Zigbee certified??....
report abuse
vote down
vote up
Votes: -1
...
written by Akiba, May 26, 2009
The stack is not yet certified. I'm hoping to get it certified this year.
report abuse
vote down
vote up
Votes: +1
...
written by Eugene Izmailov, July 10, 2009
You started a Great project. But I have a question. Does it possible to use your stack in projects based on Keil uVision IDE for X51 or ARM MCUs with using RTOS like RTX51 ? Thanks.
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, July 10, 2009
It would take a lot of porting to get it running inside RTX51. The FreakZ stack currently uses Contiki for its OS services.
report abuse
vote down
vote up
Votes: +1
it's really a amazing job~
written by liu, August 04, 2009

Does it possible to port your stack to CC2430?

I have some CC2430EM module and I want to use the stack with them

smilies/smiley.gif
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, August 05, 2009
It currently doesn't support the CC2430. I would need to port it to either IAR or Keil which I don't really have access to at the moment. I'm planning on initially porting the stack to MCU architectures that are supported by GCC.
report abuse
vote down
vote up
Votes: +2
Why did you choose to go full-time at this endeavor?
written by Michael Stoops, August 06, 2009
Akiba,

Why did you choose to take this on full-time? Is it because you believe so passionately in the cause? You think it's your golden opportunity to make a name for yourself? Just curious.
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, August 06, 2009
It's because I wanted an opportunity to use up all my savings and this kind of came along.
report abuse
vote down
vote up
Votes: +3
Greate Job!
written by Edward, August 10, 2009
Greate job, Akiba. Is the stack free for both personal and comercial usage? What license is it released upon?
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, August 10, 2009
It's licensed under BSD with the additional requirement that it's subject to the IP restrictions in the Zigbee specification. That last part was added because Zigbee has a membership requirement clause in the spec if you want to use the protocol.
report abuse
vote down
vote up
Votes: +1
Membership Requirement?
written by Anon, October 14, 2009
As to your last point re: membership requirement, does this mean that by using your stack, the user is still required to be a Zigbee Alliance member (adopter?).
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, October 14, 2009
No. Using the stack does not require membership. However the Zigbee spec states that sale of any products using Zigbee IP requires membership in the Zigbee Alliance. This condition was what caused controversy on the stack's eligibility to use the GPL. Since I was already considering using Modified BSD, I decided to switch the license to avoid any problems in the future. I added the additional condition that the stack was based on the Zigbee spec and subject to the conditions outlined in it because I wanted people to be aware that there were conditions attached to basing a product on the Zigbee specification. I don't care for promoting Zigbee membership.
report abuse
vote down
vote up
Votes: +1
Wonderful!
written by dyan, October 20, 2009
Awesome effort Akiba, I am working on Zigbee, and infact, i attempted to design a sniffer as well using the stack from one of the vendors, but very strangely, i keep missing messages, atleast 10% of over the air traffic...and its random...i can never predict which msg i miss..
have you designed a sniffer as well?
report abuse
vote down
vote up
Votes: -1
Help me understand.
written by MD, April 03, 2010
Even though I am not an electronics or programming person by trade, I consider myself an advanced user. I have written a lot of code for my core business and am at ease with various programming concepts. When I decided to investigage embedded controllers for fun, I was delighted to find the Arduino environment. It seemed ready-made for my skill set and provided a comfortable, quick-start environment. Since finding Arduino, the wireless aspects of embedded controller has caught my attention. That's how I found your effort.

You obviously know this subjecte. I would like to ask a few questions. (pleaes forgive my ignorance):

1) Why does a device with X at the beginning of the name dominate the Arduino-type mesh sphere?
2) Why is there not a device independent layer for mesh networking for the cheap tranceivers?
3) What will your project mean to people like me (who want to dabble) when it is done?
4) Will your project be available in some version for the Arduion IDE? (an easy to get going version)
5) What questions should I be asking that I'm missing?

Thank you for your effort.
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, April 03, 2010
1) Why does a device with X at the beginning of the name dominate the Arduino-type mesh sphere?
2) Why is there not a device independent layer for mesh networking for the cheap tranceivers?
3) What will your project mean to people like me (who want to dabble) when it is done?
4) Will your project be available in some version for the Arduion IDE? (an easy to get going version)
5) What questions should I be asking that I'm missing?


Hi Mike.
Here's my answers:
A1) XBee by Digi was originally made by a company called Maxstream and was one of the first companies to make 802.15.4 modules. The original XBee Arduino drivers were made by a company called Libelium who were doing open source Zigbee applications for their Squidbee. Since then, it's been quite well received by the Arduino community.

A2) Ha ha ha...hence the need for open source. Most modules are just running stock software developed by the chip manufacturer. There are almost no indie software houses making Zigbee or 802.15.4 protocol stacks, hence no device independence. The suppliers want to tie the protocol stacks into products they make. Hence XBee's stack is by Ember who doesn't allow Digi to open up the code. TI's Z-Stack is only tied to TI's radios and MCUs. Atmel's software is just ported to and licensed for Atmel products, etc...

A3) If you're interested in wireless, but just getting started, I would not recommend Zigbee. The protocol is fairly complex because of the problems of standardizing communication between embedded devices. Think what the internet would be without IP, TCP, HTTP, browsers, W3C, CSS, HTML, etc... The same is true for devices that need to be able to talk to other devices in a common language.

I would recommend checking out my Chibi stack which is in my Projects directory. It was originally designed for Tokyo Hackerspace so they could incorporate wireless into their art projects. I made it simple and small and it only supports three commands: init, send, and receive. Those are all you need for any type of communication.

A4) I'm going to start doing more stuff to bring wireless options to the Arduino. I'm particularly interested in the wearable electronics community that has formed around the Arduino. For that, I'll probably start playing around with devices like the ATMega128RFA1 which is an AVR radio in a single chip. If I can port the Arduino core libs to it and include a wireless driver, then it can make for a very compact Arduino-based wireless system for wearable electronics.

A5) I would say that you might want to specify the application you're thinking of. The crowd on this site are all involved in wireless sensors and if you specify a particular application, then someone can usually help out. You might want to post the question in the forums though since no-one really monitors comment threads. Also, I'm going to be posting my notes from teaching microcontrollers and wireless at the tokyo hackerspace soon (i've been saying that for awhile now *sigh*) so hopefully that might inspire more questions. After I can get all the busy-ness with the shop out of the way, then I also want to focus on actual applications of wireless sensor networks so I think that will be interesting also. So far, everyone is just talking about Zigbee, 802.15.4, 6LoWPAN, or the "internet of things" in abstract terms. I'd like to make all of that more concrete.
report abuse
vote down
vote up
Votes: +0
Thank you. Another question if I may.
written by MD, April 03, 2010
Your Chibi project seems amazingly interesting.

As a civilian to your industry, it seems to me that many of the electronic engineers are "optimizing" much of the mesh features - localizing, communication speeds, etc. However, it doesn't seem to me that many of the practical needs of a mesh network require this level of engineering.

For example, suppose that the network is monitoring the moisture in the soil of a large garden. The garden sprinkler has several zones and waters each as necessary. The soil dries slowly and doesn't need a gazillion megabit optimization protocal all the time. It just needs to report the moisture a few times per day. I can see that many mesh uses would be similar.

Why not develop a simple "mesh-like" function with Chibi? It won't be a "true mesh" or get close to the technical features but it could meet the needs of the network. At a snails pace, the network could identify network nodes, wake them up, find routes, transmit data, and then put the members to sleep again.

Please forgive my ignorance on the subject, but there seems to be a need for a slower, simpler networking environment that is being overlooked.

Sincerely,

MD
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, April 03, 2010
Actually, if you're doing things within a localized area like your lawn, I'd recommend just doing a simple star network. Chibi or any other 802.15.4 based stack supports a star topology where you can just have all of your data transmitting to a single data sink node. You can have your firmware send the data periodically or have the sink node broadcast out a request and have each node respond. Each node is individually addressable by the address that you assign it so one node, presumably attached to the PC, could control all other nodes within listening range. To control the listening range, you can just adjust the transmit power. I've found that using 900 MHz radios with a transmit power of 10 mW (10 dBm), I'm able to cover two floors of a building and a distance of roughly 100-150m through a couple of walls. This was testing at the Tokyo Hackerspace house. This should be more than enough to cover a house and lawn. For a more distributed network or one with many nodes, than more complex topologies will be required and this is when mesh networking and other protocol features start coming in to play.

A mesh for Chibi would unfortunately complicate the Chibi software which is counter to what I'm trying to achieve. I created it to be an easy introduction to wireless sensors and communication. Once people outgrow the features of Chibi, then they should know enough about their application to compare other protocol's features to look for what they want.

I'm hoping to create some video tutorials of using other protocols such as 6LoWPAN (IPv6 over 802.15.4) and Zigbee in the future to make things easier on people trying to integrate the full strength protocols. At the moment, wireless sensor networking is still in a young phase where standards are still being hammered out (even after 7 years w/Zigbee). That's why there's a lot of posturing and hype but very few actual deployments that you hear about.
report abuse
vote down
vote up
Votes: +0
Thanks
written by MD, April 04, 2010
You have been very generous. I will start working with Chibi.
report abuse
vote down
vote up
Votes: +0
*(U16*) Issue
written by RNC, May 01, 2010
Some compilers will only do this as a word-aligned operation, which may break the header on some devices. It's also endian specific, so it might be safer to do something like:
*buf->dptr = hdr->src_pan_id&0xFF;
*buf->dptr = (hdr->src_pan_id>>smilies/cool.gif&0xFF;
buf->dptr = 2;

Aside from that, great work. Nice to have a reference other than IEEE's on which to verify I'm doing everything sanely.
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, May 01, 2010
Haven't thought about that. I'll need to test it on MSP430s and ARMs to see how it fares. A major rewrite should be coming up soon. So far, GCC seems to handle it fairly well which is the main target compiler. I have heard that there are some alignment issues on MSP430s with GCC though so I'll be watching for this.
report abuse
vote down
vote up
Votes: +0
improving humanity
written by Dennis, May 16, 2010
I just stumbled on your site today. It's interesting, and I'm interested in a lot of things you address here.
Having just read and exchange of messages in the FreakZ area, something struck me -
You take the time to give clear, useful answers to questions you obviously took the time to read and understand. In other words, you are genuinely helpful.
However useful and impressive your efforts are in the open standards wireless field (and I don't mean to downplay them - your effort is clearly pioneering), I think you helpfulness as one human being to another is more profoundly significant.
This is how humankind improves.

I'm glad I stumbled on your site.
report abuse
vote down
vote up
Votes: +1
...
written by Akiba, May 16, 2010
Thanks. Your words are probably overly kind.
Answering questions and trying to help out is par for the course in the open source world smilies/smiley.gif
report abuse
vote down
vote up
Votes: +1
Using the stack on actual HW.
written by Richard, May 31, 2010
Hello,

Can this stack actually be used on real hardware?

From looking at the documentation it only seems to run under a simulator, yet looking at the code there seems to be a driver for the at86rf230/1.

Personally, I'm looking for wireless temperature sensors to litter around my house so I can test / monitor various changes I've made in my house regarding insulation and ventallation changes I've been making, but finding a wireless temperature sensor for less than USD$20 is near impossible (8 sensors @ $20 is easier to get past the wife than 8 sensors @ USD$160).

Thoughts / suggestions?
-Richard Maxwell
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, May 31, 2010
The stack will be undergoing some major changes soon, but I'll also be looking to put out some wireless temperature sensors soon using the Chibi stack. Zigbee and the other standardized protocols are looking quite big at the moment which means that the MCU required to run them will be fairly costly. Hence its going to take a large amount of volume for them to be able to push the cost under $20. I'm particularly interested in hooking up a sensor array to the Tokyo Hackerspace to monitor the temperature gradients throughout the house.
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, May 31, 2010
Oops...just found this. It might be what you're looking for. A $20 wireless temperature sensor:
http://www.lacrossetechnology.com/tx6/index.php
report abuse
vote down
vote up
Votes: +0
Yup, I was wanting to do temperature gradients as well.
written by Richard, June 01, 2010
Thanks for the quick response :-)

Like most of my internet searches the $20 sensor you find is close, but no cigar (well, unless I want to hack it :-)

Basically I wanted to have around 15-20 temperature sensors around the house and log the data in 1-5 minute intervals. Wireless seemed like the best way to go, but then cost rares its ugly head :-/

Anyway, the moment someone has a working open source zigbee stack, the sooner you'll have the crazy awesome uses that people just can't predict. So, please, keep up the good work.

-Richard Maxwell
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, June 01, 2010
Ha ha ha...stay tuned. The wireless temp sensors will be coming rather quickly smilies/smiley.gif Only the first version will be using Chibi rather than Zigbee since its small and a good fit for a simple application like temperature monitoring.
report abuse
vote down
vote up
Votes: +0
...
written by mzoltan, July 07, 2010
Hi, congratulations for Your effort.
Im searching for platform alternatives for a ZigBee enabled project (about 100nodes over 100sqm area).

Is Zstack working on the Chibi hardware?
Or the Raven hardware?
Could I have an AVR (xmega128a3) a CC2520 and a Zstack combination doing the networking of these 100 nodes?
Im not bound to use ZigBee, also considering ipv6WLAN or route under MAC as ATMEL calls it.

The only problem I have with the ATMEL CPU RF solution is its cost ~4EUR the CPU and ~2EUR the transceiver.
Im looking for something that ~3EUR CPU transceiver ....

I just stumpled on your site, not studied Your solution in detail yet.

Thanks
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, July 07, 2010
If you want to run a full Zigbee or 6LoWPAN stack, 3 Euros for an integrated chip is going to be difficult at the moment. The CC2530 runs around $7.50 in 100 pcs quants and thats roughly similar to the EM351 and also the ATMega128RFA1. Z-Stack can only be run on TI hardware and you only get the binary libraries so porting is not possible. Atmel's Bitcloud is similar. Your best bet is to use SICSLoWPAN which is an open source IPv6 over 802.15.4 (6LoWPAN) stack. Otherwise, I'd recommend TI's Z-Stack or Atmel's Bitcloud for a Zigbee solution. My stack needs to be updated and isn't ready for real deployment at the moment.
report abuse
vote down
vote up
Votes: +0

Write comment

busy