3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.


Image Capturing Bird Feeder

Step 5XBee Library Discussion

XBee Library Discussion
If you've gotten this far you should take a moment to reflect.  it's pretty amazing being able to take a picture with an MCU.  If you added an SD card you will have built your own digital camera!

However, we don't need a SD card because we are going to stream that data to a computer.  My weapon of choice for this task is the XBee.  These are great modules that do a whole lot more than just send and receive blindly.  You will need to configure two XBees in API mode.  If you are unsure how to do this, please consult my instructable on API Mode for XBees.   I used two Series 1 XBees because I have several lying around and I don't need to deal with coordinator/router/end device settings (too much thinking).

We use API mode to more easily ensure that each packet we send gets received. When in API mode the receiver will checksum the packet to make sure it's not corrupt and reply with a Delivery Status (ACK) packet so the sender knows it was sent successfully.You could write your own XBee library but I would recommend using the XBee-Java API written by Andrew Rapp. 

There is a Python equivalent of this library, which I had intended to use but was unable to get working.  The XBee-Python API depends on PySerial.  Every time the XBee sends 0x13, PySerial encodes the byte as 0x7D 0x33.  It turns out that there are 3 other problem bytes: 0x11, 0x91, and 0x93.  Turns out that "Some modems with software flow control may intercept outgoing DC1 and DC3 ignoring the 8th (parity) bit. This data would be transmitted on the link as follows":
  • 0x11 is encoded as 0x7d, 0x31. (XON)
  • 0x13 is encoded as 0x7d, 0x33. (XOFF)
  • 0x91 is encoded as 0x7d, 0xb1. (XON with parity set)
  • 0x93 is encoded as 0x7d, 0xb3. (XOFF with parity set)
I tried all possible settings with PySerial and was unable to solve this encoding problem.  So...I used the XBee-Java API, which worked perfectly!

« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
38
Followers
11
Author:quasiben(Electric Stitches)