Esempio n. 1
0
def connectToMote():
    cache = MoteCache()
    cache.read()

    # print "GetMotes:", cache.getMotes()
    allDevs = detectAllPossible()

    selectedMoteId = None
    for d in allDevs:
        if d in cache.getMotes():
            selectedMoteId = d
            break

    if selectedMoteId == None:
        print "No motes found.  Device ids:", allDevs, "cacheMoteIds:", cache.getMotes(
        ).keys()
        sys.exit()

    # mote = cache.getMotes().values()[0]
    mote = cache.getMotes()[selectedMoteId]
    mote.connect()

    mote.setLeds(1, 0, 0, 0)

    mote.startReadThread()

    mote.irExtendedModeOn()

    return mote
Esempio n. 2
0
def connectToMote():
    cache = MoteCache()
    cache.read()

    # print "GetMotes:", cache.getMotes()
    allDevs = detectAllPossible()

    selectedMoteId = None
    for d in allDevs:
        if d in cache.getMotes():
            selectedMoteId = d
            break

    if selectedMoteId == None:
        print "No motes found.  Device ids:", allDevs, "cacheMoteIds:", cache.getMotes().keys()
        sys.exit()

    # mote = cache.getMotes().values()[0]
    mote = cache.getMotes()[selectedMoteId]
    mote.connect()

    mote.setLeds(1,0,0,0)

    mote.startReadThread()

    mote.irFullModeOn()

    return mote
Esempio n. 3
0
import time, sys
import mote
from moteCache import MoteCache

if __name__ == "__main__":
    cache = MoteCache()
    cache.read()

    # print "GetMotes:", cache.getMotes()
    allDevs = mote.detectAllPossible()

    selectedMoteId = None
    for d in allDevs:
        if d in cache.getMotes():
            selectedMoteId = d
            break

    if selectedMoteId == None:
        print "No motes found.  Device ids:", allDevs, "cacheMoteIds:", cache.getMotes().keys()
        sys.exit()

    # mote = cache.getMotes().values()[0]
    mote = cache.getMotes()[selectedMoteId]
    mote.connect()

    mote.setLeds(1,0,0,0)

    mote.startReadThread()

    mote.irBasicModeOn()
Esempio n. 4
0
from moteCache import MoteCache
from mote import detectAllPossible

if __name__ == "__main__":
    devices = detectAllPossible()
    print "Devices:", devices