Beispiel #1
0
xb1 = BaseStation('COM3', baudrate = 57600 , verbose = False)
xb2 = BaseStation('COM4', baudrate = 57600 , verbose = False)

if __name__ == '__main__':
    
    XBEES = [xb1, xb2]
    
    print "Setting temporary XBee config..."
    
    # Change xbee settings
    xb1.setChannel(XB_CHAN)
    xb1.setSrcAddr(XB1_ADDR)
    xb1.setPanID(XB_PANID)
    
    print "--------  XBee #1  ----------"
    chan = xb1.getChannel()
    print "xbee CHAN : 0x%x" % chan
    src = xb1.getSrcAddr()
    print "xbee SRC addr : 0x%x" % src
    pan = xb1.getPanID()
    print "xbee PAN ID : 0x%x" % pan
    print "\n",
    
    # Change xbee settings
    xb2.setChannel(XB_CHAN)
    xb2.setSrcAddr(XB2_ADDR)
    xb2.setPanID(XB_PANID)
    
    print "--------  XBee #2  ----------"
    chan = xb2.getChannel()
    print "xbee CHAN : 0x%x" % chan
Beispiel #2
0
import time, serial, sys, os
from BaseStation import *

#Define constants to use
DEST_ADDR = '\x20\x12'

#Initialize the basestation and the helper functions
xb = BaseStation('COM3', 57600, verbose=False)

if __name__ == '__main__':

    print "Type Ctrl+C to exit at any time."

    print "Initial settings:"
    print "-----------------"
    chan = xb.getChannel()
    print "xbee CHAN : 0x%x" % chan
    src = xb.getSrcAddr()
    print "xbee SRC addr : 0x%x" % src
    pan = xb.getPanID()
    print "xbee PAN ID : 0x%x" % pan

    # Change xbee settings
    print "\n"
    print " -- changing xbee CHAN to 0xe"
    xb.setChannel('\x0e')
    print " -- changing xbee SRC to 0x1234"
    xb.setSrcAddr('\x12\x34')
    print " -- changing xbee PAN to 0x9999"
    xb.setPanID('\x99\x99')
Beispiel #3
0
import time, serial, sys, os
from BaseStation import *

#Define constants to use
DEST_ADDR = '\x20\x12'

#Initialize the basestation and the helper functions
xb = BaseStation('COM3', 57600, verbose = False)

if __name__ == '__main__':
    
    print "Type Ctrl+C to exit at any time."
    
    print "Initial settings:"
    print "-----------------"
    chan = xb.getChannel()
    print "xbee CHAN : 0x%x" % chan
    src = xb.getSrcAddr()
    print "xbee SRC addr : 0x%x" % src
    pan = xb.getPanID()
    print "xbee PAN ID : 0x%x" % pan
    
    # Change xbee settings
    print "\n"
    print " -- changing xbee CHAN to 0xe"
    xb.setChannel('\x0e')
    print " -- changing xbee SRC to 0x1234"
    xb.setSrcAddr('\x12\x34')
    print " -- changing xbee PAN to 0x9999"
    xb.setPanID('\x99\x99')