The code I am running to collect sonar data works for my colleague, who was using a serial connection to test the sonar. I am using a UDP connection on the actual AUV, and am trying to run her code, using the UDP option instead. (She has the argparse and connection setup in the right way, like you do in the examples) I am getting the error, seen in the above image.
Here is a snippet of the main loop of the program, the header of the log file has already been written, and p is the ping device.
while True: direction=direction*(-1) for x in range(61)[::direction]: device_data = p.transmitAngle(x) print(x) print(p.set_number_of_samples(200)) print(p.get_device_data()) print(device_data.gain_setting) print(device_data.data) orginal_string1 = str(datetime.datetime.now().time())[:-3] encoded__byte_string1 = orginal_string1.encode('utf-16-be') version_format = '>1i' a1=struct.Struct(version_format).pack(len(encoded__byte_string1.decode())) file.write(a1) file.write(encoded__byte_string1)