A toolset for .
cd data
ip = myip()
print(ip)
dp_yaml_path = find_duckiepond_devices_yaml("duckiepond-devices-machine.yaml")
print(dp_yaml_path)
dp_dict = dp_load_config(dp_yaml_path)
print(dp_dict)
Below code will catch your local ip so the device you run this code should be in the yaml file, if you use your laptop to run it, eventually get the error, no mind!
machine,device = whoami(dp_dict)
xbee_address = get_xbee_address_boat(dp_dict,machine)
print(machine)
print(device)
print(xbee_address)
boats = dp_get_devices(dp_yaml_path, 'boat*')
print("load boats: {}".format(boats))
dtkvbots = dp_get_devices(dp_yaml_path, 'dt-kv*')
print("load bots: {}".format(dtkvbots))
anchors = dp_get_devices(dp_yaml_path, 'anchor*')
print("load anchors: {}".format(anchors))
sensors = dp_get_devices(dp_yaml_path, 'sensor*')
print("load sensors: {}".format(sensors))
sensors = device_get_sensors(dp_dict, 'sensor4')
print(sensors)
for sensor in sensors:
topic = sensor_get_topic(dp_dict, 'sensor4', sensor)
print(topic)