What I did was use the XBee library's asynchronous call, which creates another thread, to receive the message, then put the message on a queue. In the original thread, I check the queue and pull off the message, dismantle it and use it. Actually, this isn't a terrible way to do it, just very different from what I've done before.
Then, I realized that waiting on the queue to have something in it was silly. I simply checked the queue to see if something was there and if not continued. If there is something there, I call a routine to handle it. To test it, I added the Python scheduler to the code and set up a timer so that, every 30 seconds, I send a status request message out to my network, and see if the answer comes back. This is a feature of my network, not a general thing. What I did was enable the current Arduino house controller to respond to a very simple message by sending the status of a few devices as a broadcast. This allows me to have devices that send the query and look at the response to see what's going on. It also helps by being a source of messages that I could look for.
The code got pretty complex, but I tried to comment the heck out of it so you can see what is going on:
Yes, this also means I can both send and receive XBee messages. So, I have a scheduled XBee message that can get the response, a separate thread to receive XBee messages and not load down the main thread, the ability to get the data out of the message and use it. Now, I need to combine that with a web server that can display the results.
One thing that needs to be understood about the Python XBee library: it only returns good packets. If there is a collision and the checksum doesn't work, you don't get the message. If the message is fragmented by noise, you don't get the message. If anything goes wrong, you don't get the message. That makes debugging a network problem almost impossible since you can't see anything when things go bad. So, keep an arduino around to look at stuff or build a sniffer like I did <link> to follow the traffic. XCTU can help, but remember, if the message is sent to a specific address, it's invisible to the output of a different XBee and XBees don't have a promiscuous mode like Ethernet chips.
I'm going to look at web servers now.
Edit: It took exactly 5 minutes to get a web server running. I'm starting to like this board.