
238 MAKING THINGS TALK
Then type: mode char\r
This command puts telnet into character mode, meaning
that it will send every character as you type it. You’ll need
to be in this mode in order to send the +++ string (by
default, the Windows telnet program is in the correct mode).
Now try typing XBee commands to read the configuration.
Start with the usual +++ and wait for the OK, then ATMY\r,
ATDL\r and so forth. If you’ve wired the circuit correctly,
you should get responses from the XBee just as if you
were connected to its serial port — because you are!
Once you know that you’ve got serial data transmitting
from the XPort to the XBee, power up the sensor radio
while you’re still logged in to the XPort. Once it starts up,
it should be transmitting regularly, and you should see the
data coming into your telnet window. It’s being transmit-
ted from the sensor’s radio, then to the XPort’s radio, on to
the XPort, and to your window via the network. Likewise,
if you plug the monkey radio in now, you should see the
monkey clashing his cymbals as the data changes from
the sensor. Now all of your hardware works.
The Server Code
Once you have all of the circuits working, it’s time to get
the data onto the Web. To do this, you’re going to write a
PHP script that logs into the XPort, retrieves the data, and
displays the results. It will display a summary value telling
you the sensor’s average reading ...