Skip to content

mcore1921/XBeePoller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

So you want to make a new config?  Here's the overview if you're using 
a Raspberry Pi 2

1) Set up your Rpi2.  See NewRpiConfig.txt for detailed instructions.

2) Get this repo onto the rpi2.

3) Set up a database.  Use the default names if you don't want to 
   figure out the config files.

From shell:
> mysql -u root -p

Now, inside mysql:
>create database therm;
>create user 'xbtherm'@'localhost' identified by 'therm';
>grant all privileges on therm.* to 'xbtherm'@'%';
>quit
... or, from the command line:
> mysql -u root -p < mysqlSetup.input

4) Build the code.
> make; cd htmlgen; make; cd ../battmail; make

5) Install the code.  You may need to sudo these...
> ./install.sh install <username to run the service as>
> cd htmlgen; ./install.sh install <prefix for web pages>
> cd ../battmail; ./install.sh install

6) Set up the config files.  These are in /etc/XBeeThermClient.

7) Start the service
> sudo service thermPollerInit start

8) Monitor the status
   You can monitor status of the running thermPoller by either:
   8a) watch -n 1 /var/tmp/xbcfg.out
   8b) browsing to your rpi from a web browser.  The default page is
       a mirror of /var/tmp/xbcfg.out.

That's the RPi part.  For the hardware part:
1) Configure an XBee in API Coordinator mode using X-CTU.  Also set a PanID 
   at this time.  This is the ID that allows multiple ZigBee networks in 
   the same area; choose one at random, but be sure to set the same one 
   for all your units.

2) Set up at least one remote station for testing.  You can use router
   or endpoint firmware - easiest to just leave the default firmware on
   your XBee (which is router).  The only parameter you need to set is the
   PAN ID.  You can do this directly from the RPI by connecting the remote
   to the configuration you set in (1) and doing the following:
   2a) In one shell, run:
       cat -A /dev/ttyAMA0
   2b) In a second shell, run the following.  Don't wait more than ~10
       seconds between each step or the XBee will switch back to non-config
       mode.
       > echo -ne "+++" > /dev/ttyAMA0
       After about a second you should see "OK" printed to the first shell
       Then, in the second shell, run the following, subbing your pan ID
       (in hex) for the XX:
       > echo -ne "ATIDXX\r\nATID\r\n" > /dev/ttyAMA0
       YOu should see an "OK" and then an echo back of the ID you set.
       Lastly, write the ID config to non-volatile memory:
       > echo -ne "ATWR\r\n" > /dev/ttyAMA0
       Now you can pop out the XBee and move on

3) Start up the thermPoller and watch the configuration.  It will take
   ~5-10 minutes for the master to reconfigure the remote completely;
   you can tell this has happenned when the "write" column of the 
   monitor page increments.  (Currently this is the 5th column of the
   line whos first column is the MAC of your remote XBee.)
   3a) You can reduce this time (~10x) by reducing the remote GET and SET 
       timeout in /etc/XBeeThermClient/XBeeThermPollerConfig.  Add the 
       following to the end of the file.  It's probably fine to leave these 
       parameters forever, but the XBee datasheets suggest different values 
       (which are the defaults).  Don't forget to restart the service after 
       you change the configfile.

:REMOTE_XBEE_MGR_CONFIG
SET_PARAM_TIMEOUT 30
GET_PARAM_TIMEOUT 30

4) Calibrate the remote station.  See Calibration.txt for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published