Home arrow Blog arrow Embedded arrow Introducing...Chibi - A Simple, Small, Wireless stack for Open Hardware Hackers and Enthusiasts
Introducing...Chibi - A Simple, Small, Wireless stack for Open Hardware Hackers and Enthusiasts | Print |
Written by Akiba   
Sunday, 11 October 2009

Well, I finally did it. I mentioned before that I was working on something when I was in the US to while away the time at the coffee shops. That something was an ultra-simple, ultra-small wireless stack that could just be used to transmit and receive data. It’s something that came out of working with the people at Tokyo Hackerspace . A lot of them were interested in being able to control things wirelessly, but I didn’t really have an answer for them. I felt that Zigbee was too complex, and even 802.15.4 had a fairly steep learning curve, due to the need to do passive/active scans and associate with other nodes.

What most of them were looking for was just something that they could transmit and receive data with. I’ve been thinking about how to implement something like that for a while because wireless stacks, even simple ones, can get complicated due to wireless being an unreliable medium. Hence you have to build in complexity to handle timeouts, retries, acknowledgements, etc.

When I was hanging out at a Berkeley coffee shop, I thought about using the built-in MAC hardware on most of the newer 802.15.4 radios since they already had hardware blocks that handled acknowledgement and retries. This would get rid of the need to implement state machines or use an OS which would simplify code tremendously. Of course the amount of simplification is just limited to basic operations since you would still need an OS or state machines to handle more sophisticated features like mesh routing or indirect transfers. However for something like sending and receiving data, it was perfect.

So without further ado, I’d like to introduce “chibi”, a simple wireless protocol stack for openhardware hackers and enthusiasts to control their projects. Chibi is slang for “midget” in Japanese and is a popular term used frequently in anime.

The software stack requires approximately 3 kB of flash memory and about 150 bytes of RAM. Its completely open source and is licensed under modified BSD, which means that you can use it, modify it, and do whatever you’d like to it and it won’t require attribution in the documentation.

The operation of the stack is pretty simple. There are only three commands: init, write, and read. Each wireless node that runs the stack needs to have a 16-bit address which can be stored in an EEPROM, toggled via DIP switches, etc. I already added hooks to use the internal EEPROM on AVR controllers, but others can modify it to read GPIO for DIP switches, or handle any other way to identify a node.

Once a node has an address, then you just talk to it by using the “write” function with the address of the target node and the data you want to send to it. The size of the data payload is limited by the maximum frame size used by the 802.15.4 protocol (127 bytes) minus the MAC headers so you get about 100 bytes for the payload.

When a message is received, it will set a flag. You would normally poll the flag in the main loop of your system and when it shows that data was received, then you just call the “read” function and retrieve the data.

All of the other parameters such as the PAN ID, channel, etc are hard coded, but may be changed later on depending on how the requirements of the stack evolves.

As for the network topology, any node can communicate with any other node as long as its within listening range. Also, you can use the special broadcast address (0xFFFF) to send data to all nodes simultaneously.

That’s pretty much about it for the operation of the stack. There isn’t much commercial application since it’s a pretty barebones stack with no encryption, but it should fit the bill for people that want to create cool, new projects that interact with each other wirelessly. Or if you just want to add something simple like updating firmware wirelessly, this would also work as well. All of the source code can be found in the zip file at the end of this post. Also included in the zip file is the FreakUSB stack which I'm using to interface my development boards to my PC. 

I’ll be adding documentation soon and should be releasing some open hardware designs and finished boards for people to play around with the stack. I’ll also be doing a port to the AVR Raven USB stick since the hardware that I’m currently using is very similar to it and the USB stick is cheap and has an 802.15.4 radio.

Good luck with your wireless projects. Let me know about any cool designs using this stack. I’d really love to hear about them!

Here's the link to v0.1 of the source code: 

Chibi Link

And here's some pics of my setup:

Click image to open!
Click image to open!

Hits: 55137
Trackback(0)
Comments (10)Add Comment
...
written by Kevin Townsend, October 11, 2009
You might want to add this to the Projects tab on the site to make it easier to find ... great work, though. It's definately useful for small single purpose setups with inexpensive 8KB/32KB parts, etc. I just have to cortexify it. :-)
report abuse
vote down
vote up
Votes: +0
Mr.
written by Herry, October 12, 2009
Wow, this is extremely cool. From where I could get the hardware? You said the hardware is open source. Where I could download the schematic and pcb layout? Anyway, congrats to you with this project. looking forward to try it for cool stuff wirelessly.
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, October 12, 2009
Yeah, I'll be adding it to the projects section. I need to comment the code and write up documentation and tutorial/walkthroughs for it. A bit swamped right now, tho smilies/sad.gif

For the hardware, I'll be porting it to the Atmel Raven USB stick soon ($40 @ Digikey). I currently have it working on my Zigbee development platform, however its a bit overkill for this tiny stack. The main reason I wrote this stack is so that Tokyo Hackerspace and other hackers can do wireless with low cost microcontroller boards. So I'm planning on designing and releasing new hardware that has a cheaper microcontroller (ATMega32U4, 32k flash/2k RAM, USB) and an on-board radio. The good thing about the ATMega32U4 is that its compatible with the AVR Dragon, Atmel's low cost debugging tool so you won't get stuck with paying $300 for the standard JTAG ICE MKII which is needed for my current boards.
report abuse
vote down
vote up
Votes: +2
...
written by Herry, October 13, 2009
Yea, some simple documentation will do. So you could pull some gigs out there (me included) to speed up and jump in and do some cool stuff with your code.
report abuse
vote down
vote up
Votes: +0
Chibi
written by guest, January 15, 2010
Hi
Can you please tell when will the documentation(software part and hardware aswell ) for Chibi protocol stack be available.
Thnx
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, January 15, 2010
Sorry. I'm lagging on a lot of things right now. I'll be posting tutorials and documentaiton for Chibi soon. I just need to knock a bunch of things of my todo list.
report abuse
vote down
vote up
Votes: +0
ATmega128RFa1
written by Knight.Tim, February 07, 2011
have you tested this with the atmel ATmega128RF MCU?
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, February 07, 2011
Haven't had a chance to play with the ATMega128RFA1, but the radio section is based on the AT86RF231 radio. The porting should be fairly simple, once I can get my hands on the chip.
report abuse
vote down
vote up
Votes: +0
I am looking for an open source implementation for Wireless Electronics Shelf Label (ESL).
written by allankliu, February 11, 2012
I am asked to define a wireless Eletronics Shelf Label (ESL) system. It is a distributed wireless network for price labels with LCD/e-paper. Currently, some vendors use diffuse infraread and VLF(Very Low Frequency, 38.4KHz) for two-way communication. My client wants to have it run on 2.4GHz or sub-1GHz ISM RF band.

The quotation is limited under 5USD, i.e., its BOM (LCM MCU RF) cost should be lower than 4USD. It is a tight budget anyway.

I google the wireless network. It seems that IEEE802.15.4 and Zigbee stack/chipset is much powerful and expensive than our requirements, we can use such designs only if its cost is lower.

I am not familiar with RF protocol, so I am not confident to define a new protocol stack. That's why I have to find the correct direction head to.

So far, I know the following facts:

MAC layer is very important for such point-to-multi-point (Star) topology.
Mesh network seems too complex, it introduces routing and other features into network.
MAC layer should be able to anti-collision (MAC).
The RF transceiver should have wake-on-radio for low-power consumption (PHY).
The node(ESL) should be self-configured (MAC/LAC).
Simple encryption for communication and authentication (application layer).
Open source implementation and market proven robustness.
I have read some design guide from TI/Freescale/Microchip/Atmel/EM/nordic, some chip is suitable like nRF24L01 /CC2500, however the protocol/support is not.

Does Chibi fits the requirements for ESL?
report abuse
vote down
vote up
Votes: +0
...
written by Akiba, February 14, 2012
It does fit the requirements although you'd have to add in the encryption/decryption yourself. This is usually done by an AES engine on the MCU. I would probably recommend getting more familiar with the RF protocols though before starting the design.
report abuse
vote down
vote up
Votes: +0

Write comment

busy
 

Discuss (4 posts)
mr happy
Introducing...Chibi - A Simple, Small, Wireless stack for Open Hardware Hackers and Enthusiasts
Nov 10 2009 23:24:28
This thread discusses the Content article: Introducing...Chibi - A Simple, Small, Wireless stack for Open Hardware Hackers and Enthusiasts

kinda shocked that the open source zigbee blog sees a need for something non-zigbee.... then again... it seems to generally take people a couple years of being involved closely with zigbee before they see the light.
#1436

Akiba
Re:Introducing...Chibi - A Simple, Small, Wireless stack for Open Hardware Hackers and Enthusiasts
Nov 11 2009 00:45:10
Shouldn't be shocked. If you don't need interoperability and just want to control your art/hack projects, then its better to just use raw 802.15.4 and generate your own data format.
#1438
Michael Stovenour
Re:Introducing...Chibi - A Simple, Small, Wireless stack for Open Hardware Hackers and Enthusiasts
Dec 07 2009 07:27:35
I really like this concept. I completely agree that hackers will have a difficult time creating Zigbee profiles for one off projects. How ever one of the strengths of Zigbee is support for the mesh topology. Does chibi support mesh topologies or is it simply any-to-any peer-to-peer?

The latter is what I implied from the description. I like the concept of Atmel's BitCloud demo software if it were only open source. It appears to support a mesh topology but can transfer non-Zigbee structured data. The actual communication is only end node to coordinator but routers form a mesh and can forward frames for end nodes that can not directly reach the coordinator. This seems like a feature set that might fit a wide range of projects. Although I wonder if use of your stack would still be commercially encumbered if it included the Zigbee network layer and/or supported a ZDO for the device? likely...
#1507

Akiba
Re:Introducing...Chibi - A Simple, Small, Wireless stack for Open Hardware Hackers and Enthusiasts
Dec 07 2009 09:55:00
There's no mesh routing supported in Chibi. It's just peer-to-peer single hop. There's no joining, no leaving, channel scanning, etc. Its pretty much a basic wireless stack to just communicate.
Mesh routing is much nicer, but if you check the BitCloud stack, it also takes over 100kB which drives up the amount of hardware and cost required. My experience with Tokyo Hackerspace taught me that for a large number of people, they just want to transmit over short distances wirelessly and as simply as possible. Hence, the reason for making only three functions. Incidentally, a lot of the simplifications contributed to getting the stack down to ~3kB flash which makes it capable of being used on really small or cheap MCUs.
#1508


Discuss...
< Prev   Next >