def loop_forever(): while (True): sleep(0.1) mesh.run() if (config["mqtt"]["enable"]): clientMQTT.loop() return
def loop(nb): while (nb > 0): sleep(0.05) mesh.run() nb = nb - 1 return
parser = argparse.ArgumentParser() parser.add_argument("-c","--channel",default=10) parser.add_argument("-f","--function",default="x") args = parser.parse_args() #TODO this have a default that comes from the config #so that the command line can only override the config if required chan = int(args.channel) clientMQTT = mqtt_start(config,mqtt_on_message,True) mesh.start(config,mesh_on_broadcast,mesh_on_message,mesh_on_cmd_response,node_log) this_node_id = 5 #set_channel(chan) #loop(10) #to get the node id #rov_bldc(0,0.2) while(True): mesh.run() #bldc(75,37) #loop(200) #for i in range(5000): # bldc(75,i%256) # sleep(0.002)