Home / Experiments / Communicating with the NXTBee

Communicating with the NXTBee

NXTBee State Engine [Click to enlarge]So I’ve had these Dexter Industries NXTBees for about two weeks now and I’ve been working hard to come up with something cool.  Even before I received these NXTBees I spoke with John from DI about sending telemetry data from one NXT to another over a distance using these sensors.

One of the potentially biggest data volume generating sensors I have is the Mindsensors NXTCamV3 which can produce around 40 bytes for each “cycle”. No form of communication is perfect and you would be a fool to not keep this in mind when sending messages from one point to another.  This also applies to sending data via the NXTBees.  I implemented two Finite State Machines (FSM), one for the master and one for the slave that can deal with things not going right. I don’t handle every single possible problem but my code does

  • use fixed length messages (keeps the code nice and simple);
  • check message integrity using an 8-bit CRC (with a lookup table for speed);
  • a timeout when transmitting from the master to the slave is handled by retransmitting the packet.  A subsequent timeout will result in a failed transmission to be handled by the application itself.

The driver is still beta and is more a proof of concept than anything. I’ve included the communications library, a master and a slave program. I intend to expand on this library as time goes by.  Below is a video of my experiment with the NXTBees and an NXTCam. The master continuously requests blob data from the slave.  The master displays the fetched blob data on its screen.

You can download the ROBOTC code here: [LINK].  Please note that there are not as many comments in there as there should be.

About Xander

Xander Soldaat is a Software Engineer and former Infrastructure Architect. He loves building and programming robots. He recently had the opportunity to turn his robotics hobby into his profession and has started working for Robomatter, the makers of ROBOTC and Robot Virtual Words.