예제 #1
0
def main(args=None):
    """ Aggregate all nodes sniffer """
    args = args or sys.argv[1:]
    opts = SerialAggregator.parser.parse_args(args)
    try:
        # Parse arguments
        nodes_list = SerialAggregator.select_nodes(opts)
        # Run the aggregator
        with SerialAggregator(nodes_list, print_lines=True) as aggregator:
            while True:
                message = 'd'
                for node in aggregator.keys():
                    aggregator._send(node, message)
                    time.sleep(0.1) 
    except (ValueError, RuntimeError) as err:
        sys.stderr.write("%s\n" % err)
        exit(1)
예제 #2
0
def main():
    """ Reads nodes from ressource json in stdin and
    aggregate serial links of all nodes
    """
    parser = opts_parser()
    opts = parser.parse_args()
    opts.with_a8 = True

    try:
        nodes_list = SerialAggregator.select_nodes(opts)
        # nodes_list = SerialAggregator.select_nodes(**var(opts))

    except RuntimeError as err:
        sys.stderr.write("%s\n" % err)
        exit(1)

    uids = get_uids(nodes_list)
    print json.dumps(uids, indent=4, sort_keys=True)
예제 #3
0
def main():
    """ Reads nodes from ressource json in stdin and
    aggregate serial links of all nodes
    """
    parser = opts_parser()
    opts = parser.parse_args()
    opts.with_a8 = True

    try:
        nodes_list = SerialAggregator.select_nodes(opts)
        # nodes_list = SerialAggregator.select_nodes(**var(opts))

    except RuntimeError as err:
        sys.stderr.write("%s\n" % err)
        exit(1)

    uids = get_uids(nodes_list)
    print json.dumps(uids, indent=4, sort_keys=True)
예제 #4
0
def main():
    """ Launch serial aggregator and aggregate serial links
    of all nodes.
    """
    parser = opts_parser()
    opts = parser.parse_args()
    api = Api(*get_user_credentials())
    opts.with_a8 = True
    try:
        nodes = SerialAggregator.select_nodes(opts)
    except RuntimeError as err:
        print(err)
        exit(1)
    if opts.experiment_id:
        exp_id = opts.experiment_id
    else:
        exp_id = iotlabcli.get_current_experiment(api)
    print("Running radio logger ...")
    run_radio_logger(exp_id, opts, nodes)