Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Echosounder S500 - ping-python implementation ? #142

Open
Tchiimy opened this issue Oct 29, 2024 · 3 comments
Open

Echosounder S500 - ping-python implementation ? #142

Tchiimy opened this issue Oct 29, 2024 · 3 comments

Comments

@Tchiimy
Copy link

Tchiimy commented Oct 29, 2024

Hello,

I'm trying to use the functions you are defining in this api related to the S500 echosounder.

From what I understood the ping-python library is "general" but I tried to make some modifications in the definitions.py and ping1D.py to add these functions for the api:
image

I tried to manually add the definitions and functions in the library:
definitions.py:

PING1D_DISTANCE2 = 1223
PING1D_PROFILE6_T = 1308
PING1D_SET_PING_PARAMETERS = 1015

    PING1D_SET_PING_PARAMETERS: {
        "name": "set_ping_params",
        "format": "IIhhHHHBB",
        "field_names": (
            "start_mm",
            "length_mm",
            "gain_index",
            "msec_per_ping",
            "pulse_len_usec",
            "report_id",
            "reserved",
            "chirp",
            "decimation",
        ),
        "payload_length": 20
    },

    PING1D_DISTANCE2: {
        "name": "distance2",
        "format": "IIHBBI",
        "field_names": (
            "this_ping_distance_mm",
            "averaged_distance_mm",
            "reserved",
            "this_ping_confidence",
            "confidence_of_averaged_distance",
            "timestamp",
        ),
        "payload_length": 16
    },

    PING1D_PROFILE6_T: {
        "name": "profile6_t",
        "format": "IIIIIIIIfffffffBBBBHH",
        "field_names": (
            "ping_number",
            "start_mm",
            "length_mm",
            "start_ping_hz",
            "end_ping_hz",
            "adc_sample_hz",
            "timestamp_msec",
            "spare2",
            "pulse_duration_sec",
            "analog_gain",
            "max_pwr_db",
            "min_pwr_db",
            "this_ping_depth_m",
            "smooth_depth_m",
            "fspare2",
            "this_ping_depth_measurement_confidence",
            "gain_index",
            "decimation",
            "smoothed_depth_measurement_confidence",
            "num_results",
            "pwr_results",
        ),
        "payload_length": 68
    },

and pind1D.py:

    def get_distance2(self):
        if self.legacyRequest(definitions.PING1D_DISTANCE2) is None:
            return None
        data = ({
            "this_ping_distance_mm": self._this_ping_distance_mm,  # Units: mm; Distance to the target in this ping.
            "averaged_distance_mm": self._averaged_distance_mm,      # Units: mm; Averaged distance across multiple pings.
            "reserved": self._reserved,                               # Reserved field, not used.
            "this_ping_confidence": self._this_ping_confidence,      # Units: %; Confidence in this ping's distance measurement.
            "confidence_of_averaged_distance": self._confidence_of_averaged_distance,  # Units: %; Confidence in the averaged distance measurement.
            "timestamp": self._timestamp,                             # Units: ms; Timestamp of the measurement.
        })
        return data

    def get_profile6_t(self):
        if self.legacyRequest(definitions.PING1D_PROFILE6_T) is None:
            return None
        data = ({
            "ping_number": self._ping_number,                       # Units: N/A; The ping number.
            "start_mm": self._start_mm,                             # Units: mm; Start position for the ping.
            "length_mm": self._length_mm,                           # Units: mm; Length of the ping measurement.
            "start_ping_hz": self._start_ping_hz,                   # Units: Hz; Starting frequency of the ping.
            "end_ping_hz": self._end_ping_hz,                       # Units: Hz; Ending frequency of the ping.
            "adc_sample_hz": self._adc_sample_hz,                   # Units: Hz; ADC sampling frequency.
            "timestamp_msec": self._timestamp_msec,                 # Units: ms; Timestamp in milliseconds.
            "spare2": self._spare2,                                 # Units: N/A; Spare field, not used.
            "pulse_duration_sec": self._pulse_duration_sec,         # Units: sec; Duration of the pulse.
            "analog_gain": self._analog_gain,                       # Units: N/A; Gain used in the analog signal processing.
            "max_pwr_db": self._max_pwr_db,                         # Units: dB; Maximum power level measured.
            "min_pwr_db": self._min_pwr_db,                         # Units: dB; Minimum power level measured.
            "this_ping_depth_m": self._this_ping_depth_m,           # Units: m; Depth measurement for this ping.
            "smooth_depth_m": self._smooth_depth_m,                 # Units: m; Smoothed depth measurement.
            "fspare2": self._fspare2,                               # Units: N/A; Spare field, not used.
            "this_ping_depth_measurement_confidence": self._this_ping_depth_measurement_confidence,  # Units: %; Confidence in this ping's depth measurement.
            "gain_index": self._gain_index,                         # Units: N/A; Index of the gain setting used.
            "decimation": self._decimation,                         # Units: N/A; Decimation factor used.
            "smoothed_depth_measurement_confidence": self._smoothed_depth_measurement_confidence,  # Units: %; Confidence in the smoothed depth measurement.
            "num_results": self._num_results,                       # Units: N/A; Number of results returned.
            "pwr_results": self._pwr_results,                       # Units: N/A; Array of power results.
        })
        return data

    def set_ping_params(self, start_mm, length_mm, gain_index, msec_per_ping,
                        pulse_len_usec, report_id, reserved, chirp, decimation,
                        verify=True):
        # Create and pack the message
        m = pingmessage.PingMessage(definitions.PING1D_SET_PING_PARAMETERS)
        m.start_mm = start_mm
        m.length_mm = length_mm
        m.gain_index = gain_index
        m.msec_per_ping = msec_per_ping
        m.pulse_len_usec = pulse_len_usec
        m.report_id = report_id
        m.reserved = reserved
        m.chirp = chirp
        m.decimation = decimation
        m.pack_msg_data()
        
        self.write(m.msg_data)
        
        if self.legacyRequest(definitions.PING1D_SET_PING_PARAMETERS) is None:
            return False

        if (verify and (
            self._start_mm != start_mm or
            self._length_mm != length_mm or
            self._gain_index != gain_index or
            self._msec_per_ping != msec_per_ping or
            self._pulse_len_usec != pulse_len_usec or
            self._report_id != report_id or
            self._reserved != reserved or
            self._chirp != chirp or
            self._decimation != decimation)):
            return False
        
        return True  # Success

Then I made a basic test with my S500:

from brping.ping1d import Ping1D
import time

# Create class object
myPing = Ping1D()

# Connect via UDP (Ethernet for example)
myPing.connect_udp("192.168.3.51", 51200)

if not myPing.initialize():
    print("Failed to initialize Ping!")
    exit(1)

test_0 = myPing.get_distance()
print(test_0)

print("")
test = myPing.get_distance2()
print(test)

print("")
test2 = myPing.get_profile6_t()
print(test2)

myPing.set_ping_params(start_mm=0, length_mm=0, gain_index=-1, msec_per_ping=-1,
                        pulse_len_usec=0, report_id=1308, reserved=0, chirp=0, decimation=0,verify=True)

And got theses output:

Opening 192.168.3.51:51200
{'distance': 0, 'confidence': 0, 'transmit_duration': 50, 'ping_number': 0, 'scan_start': 0, 'scan_length': 1000, 'gain_setting': 0}

{'this_ping_distance_mm': 352, 'averaged_distance_mm': 0, 'reserved': 0, 'this_ping_confidence': 0, 'confidence_of_averaged_distance': 0, 'timestamp': 29833152}

error unpacking payload: unpack requires a buffer of 68 bytes
msg_data: bytearray(b'BRB\x08\x1c\x05\x00\x00=\x00\x00\x00\x00\x00\x00\x00\xe8\x03\x00\x00 \xa1\x07\x00 \xa1\x07\x00\x80\x84\x1e\x00\xf87\xc7\x01\x00\x00\x00\x00\x17\xb7Q8R\xb8~@VQ\xa2B\xae\xef\x04B\x00\x80\xb4>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\xeba\t\x8a\xeb\xb0\xd5\xc9t\xd6\xba\xe1\x92\xe8C\xf3\xa6\xf6\x1e\xfa#\xff\xe7\xff\xff\xff\n\xfe\x13\xfc(\xfa\xf9\xf6\xe1\xed\x9a\xe7\xc0\xdf&\xcbB\xbb\xda\xa1\xf3\xa0\x9f\xb0\x06\xb9-\xc5\xa7\xd2\x1c\xd9\xeb\xde\xbd\xe2\xa5\xe4\x18\xe5\xb7\xe1\xc1\xde\xfc\xdaS\xd3c\xcc\x17\xbf,\xb2\xc3\x97j\x1e\x8f\x84\x8b\xa4\x8f\xb9\xf5\xcd\xc1\xd4\xc4\xd6\xd8\xd8S\xd8\xb0\xd9V\xd3B\xd1\x08\xc90\xc0\x16\xae\xda\x9a(\x87>\x831uQeWj\xa9f\xedh\xe7P\xeap\xe5\x95M\x9d\xfb\xa4?\xaa\xe9\xa4$\xa3g\xa1\x83\xb2\x1f\xb7\xa3\xbc\xf5\xba\xc0\xbb3\xb8+\xb6\xca\xb2\x84\xb4)\xb5\xad\xb9\xb5\xbaA\xbd\x0e\xc0\x1c\xc5\xfa\xcd5\xd2\xba\xd3L\xd6>\xd6\x11\xd3\xa0\xcd\xb7\xcai\xc7L\xc3\xac\xbbY\xb6\xd1\xb1\xa0\xa5W\xa1\x9e\x9cf\x83\x05kPU\xd3o(\x9a\xb1\xa5@\xacE\xb7T\xb9\x17\xba\xc1\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\x16\x88Q\x8b\xc7\x8f\x08\x92n\x94<\x96;\x99\xd5\x9a%\x9cf\x9ep\x9f\x86\xa0\xd9\xa1r\xa2B\xa3\x19\xa3\xe1\xa2\x01\xa3B\xa2\x81\x9f\xe5\x9d\x97\x9bQ\x97T\x94\x8c\x8e+\x8a\xa2\x86{\x7f\x1b} \x7f^~,\x81~\x89}\x8d\x1c\x91\xac\x99h\x9d\xc3\xa0\x06\xa4\xb4\xa9\x1e\xacN\xae\xb4\xb1&\xb3\xc3\xb4\xab\xb6\xae\xb7\xe1\xb8\xae\xb9\xc6\xba\xd1\xbb\x86\xbc\x88\xbd9\xbe0\xbf\xe9\xbfn\xc0T\xc1\xb3\xc1\xa9\xc1;\xc2"\xc29\xc1\xd1\xc0l\xc0\xd9\xbe\xf4\xbd\x0c\xbd\x02\xbc\xd1\xb9\x8f\xb8A\xb7\x8b\xb4\xc8\xb2\x05\xb1\xec\xad\xf3\xab\x8e\xa8j\xa5\x06\xa3\xdf\x9d\xde\x9a\n\x98\x89\x91]\x8e\xbd\x8b\xb2\x88\xc5\x81h\x80D~py\x17y%{P{\x14}\'\x80\xf3\x81\xc0\x84I\x86J\x87~\x89\xfd\x89\xc4\x88\xb0\x89\x19\x89\x9b\x86\xb4\x85"\x85\xe2\x82\x1f\x82\x83\x81;\x81\x80\x82\xe3\x81\xa1\x82\xd5\x86#\x88\xb9\x87\xbc\x8b\xbc\x8c\xef\x8c\xfa\x8d\x1b\x90\xd4\x90\x91\x91\xe3\x92\x86\x93\xb7\x94\xf7\x95\xa7\x96\xd8\x97\xf0\x98\xba\x99\xb7\x9aT\x9b\xe8\x9bO\x9cT\x9c\xba\x9b6\x9b\x1f\x9a\t\x98\x8d\x96D\x94F\x92W\x8eF\x8b\x93\x88#\x83\xd9\x7f\xe6{\xdes\x9an?h\xf4`TN\xbd=\xea\'\x00\x00J\x1d;5TP\xb5Ylb\x08i\xd4r\xd4w\xba{\xb5\x81\x8e\x84!\x88\xcc\x8b\xce\x8d\xc8\x90o\x92\x0f\x94U\x96M\x97\xcd\x97I\x98^\x99\xb2\x98{\x98\xce\x98{\x97\x0e\x97\xd1\x961\x96\xe8\x94k\x94\xd1\x93\xd3\x92W\x92"\x91z\x90\xd9\x8f\x9e\x8d\xe8\x8c\x83\x8dc\x8bp\x8b&\x8d\x8f\x8d\xe7\x8c\xc8\x8f\xdb\x90 \x91q\x92\x15\x95\x9a\x95i\x96\xfa\x97\x88\x98\xe8\x98\x9a\x99\xd7\x99?\x9aF\x9a\xe0\x99"\x9a\xd4\x99\xed\x98o\x98?\x98%\x97\x84\x96\x86\x960\x96\xc8\x95\xed\x95\xf5\x95\x85\x96\xd4\x96\x8c\x97\xe4\x98\xc3\x99t\x9a>\x9b\xa6\x9c[\x9d\x14\x9e1\x9f\x0b\xa0\xab\xa0\xe4\xa1\xb4\xa2\x98\xa3\xe2\xa4j\xa5e\xa6\xea\xa6w\xa7\x04\xa8\x1d\xa8\xc3\xa7a\xa7U\xa7;\xa6\x85\xa5\xaf\xa4\xd5\xa3e\xa2\xfd\xa0\x00\xa0Y\x9eL\x9d\\\x9bh\x99@\x98K\xd3'), header: (66, 82, 2114, 1308, 0, 0)
format: <IIIIIIIIfffffffBBBBHH, buf: bytearray(b'=\x00\x00\x00\x00\x00\x00\x00\xe8\x03\x00\x00 \xa1\x07\x00 \xa1\x07\x00\x80\x84\x1e\x00\xf87\xc7\x01\x00\x00\x00\x00\x17\xb7Q8R\xb8~@VQ\xa2B\xae\xef\x04B\x00\x80\xb4>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\xeba\t\x8a\xeb\xb0\xd5\xc9t\xd6\xba\xe1\x92\xe8C\xf3\xa6\xf6\x1e\xfa#\xff\xe7\xff\xff\xff\n\xfe\x13\xfc(\xfa\xf9\xf6\xe1\xed\x9a\xe7\xc0\xdf&\xcbB\xbb\xda\xa1\xf3\xa0\x9f\xb0\x06\xb9-\xc5\xa7\xd2\x1c\xd9\xeb\xde\xbd\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\x9a\n\x98\x89\x91]\x8e\xbd\x8b\xb2\x88\xc5\x81h\x80D~py\x17y%{P{\x14}\'\x80\xf3\x81\xc0\x84I\x86J\x87~\x89\xfd\x89\xc4\x88\xb0\x89\x19\x89\x9b\x86\xb4\x85"\x85\xe2\x82\x1f\x82\x83\x81;\x81\x80\x82\xe3\x81\xa1\x82\xd5\x86#\x88\xb9\x87\xbc\x8b\xbc\x8c\xef\x8c\xfa\x8d\x1b\x90\xd4\x90\x91\x91\xe3\x92\x86\x93\xb7\x94\xf7\x95\xa7\x96\xd8\x97\xf0\x98\xba\x99\xb7\x9aT\x9b\xe8\x9bO\x9cT\x9c\xba\x9b6\x9b\x1f\x9a\t\x98\x8d\x96D\x94F\x92W\x8eF\x8b\x93\x88#\x83\xd9\x7f\xe6{\xdes\x9an?h\xf4`TN\xbd=\xea\'\x00\x00J\x1d;5TP\xb5Ylb\x08i\xd4r\xd4w\xba{\xb5\x81\x8e\x84!\x88\xcc\x8b\xce\x8d\xc8\x90o\x92\x0f\x94U\x96M\x97\xcd\x97I\x98^\x99\xb2\x98{\x98\xce\x98{\x97\x0e\x97\xd1\x961\x96\xe8\x94k\x94\xd1\x93\xd3\x92W\x92"\x91z\x90\xd9\x8f\x9e\x8d\xe8\x8c\x83\x8dc\x8bp\x8b&\x8d\x8f\x8d\xe7\x8c\xc8\x8f\xdb\x90 \x91q\x92\x15\x95\x9a\x95i\x96\xfa\x97\x88\x98\xe8\x98\x9a\x99\xd7\x99?\x9aF\x9a\xe0\x99"\x9a\xd4\x99\xed\x98o\x98?\x98%\x97\x84\x96\x86\x960\x96\xc8\x95\xed\x95\xf5\x95\x85\x96\xd4\x96\x8c\x97\xe4\x98\xc3\x99t\x9a>\x9b\xa6\x9c[\x9d\x14\x9e1\x9f\x0b\xa0\xab\xa0\xe4\xa1\xb4\xa2\x98\xa3\xe2\xa4j\xa5e\xa6\xea\xa6w\xa7\x04\xa8\x1d\xa8\xc3\xa7a\xa7U\xa7;\xa6\x85\xa5\xaf\xa4\xd5\xa3e\xa2\xfd\xa0\x00\xa0Y\x9eL\x9d\\\x9bh\x99@\x98')
IIIIIIIIfffffffBBBBHH
attribute error while handling msg 1308 (profile6_t): bytearray(b'BRB\x08\x1c\x05\x00\x00=\x00\x00\x00\x00\x00\x00\x00\xe8\x03\x00\x00 \xa1\x07\x00 \xa1\x07\x00\x80\x84\x1e\x00\xf87\xc7\x01\x00\x00\x00\x00\x17\xb7Q8R\xb8~@VQ\xa2B\xae\xef\x04B\x00\x80\xb4>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\xeba\t\x8a\xeb\xb0\xd5\xc9t\xd6\xba\xe1\x92\xe8C\xf3\xa6\xf6\x1e\xfa#\xff\xe7\xff\xff\xff\n\xfe\x13\xfc(\xfa\xf9\xf6\xe1\xed\x9a\xe7\xc0\xdf&\xcbB\xbb\xda\xa1\xf3\xa0\x9f\xb0\x06\xb9-\xc5\xa7\xd2\x1c\xd9\xeb\xde\xbd\xe2\xa5\xe4\x18\xe5\xb7\xe1\xc1\xde\xfc\xdaS\xd3c\xcc\x17\xbf,\xb2\xc3\x97j\x1e\x8f\x84\x8b\xa4\x8f\xb9\xf5\xcd\xc1\xd4\xc4\xd6\xd8\xd8S\xd8\xb0\xd9V\xd3B\xd1\x08\xc90\xc0\x16\xae\xda\x9a(\x87>\x831uQeWj\xa9f\xedh\xe7P\xeap\xe5\x95M\x9d\xfb\xa4?\xaa\xe9\xa4$\xa3g\xa1\x83\xb2\x1f\xb7\xa3\xbc\xf5\xba\xc0\xbb3\xb8+\xb6\xca\xb2\x84\xb4)\xb5\xad\xb9\xb5\xbaA\xbd\x0e\xc0\x1c\xc5\xfa\xcd5\xd2\xba\xd3L\xd6>\xd6\x11\xd3\xa0\xcd\xb7\xcai\xc7L\xc3\xac\xbbY\xb6\xd1\xb1\xa0\xa5W\xa1\x9e\x9cf\x83\x05kPU\xd3o(\x9a\xb1\xa5@\xacE\xb7T\xb9\x17\xba\xc1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85\x16\x88Q\x8b\xc7\x8f\x08\x92n\x94<\x96;\x99\xd5\x9a%\x9cf\x9ep\x9f\x86\xa0\xd9\xa1r\xa2B\xa3\x19\xa3\xe1\xa2\x01\xa3B\xa2\x81\x9f\xe5\x9d\x97\x9bQ\x97T\x94\x8c\x8e+\x8a\xa2\x86{\x7f\x1b} \x7f^~,\x81~\x89}\x8d\x1c\x91\xac\x99h\x9d\xc3\xa0\x06\xa4\xb4\xa9\x1e\xacN\xae\xb4\xb1&\xb3\xc3\xb4\xab\xb6\xae\xb7\xe1\xb8\xae\xb9\xc6\xba\xd1\xbb\x86\xbc\x88\xbd9\xbe0\xbf\xe9\xbfn\xc0T\xc1\xb3\xc1\xa9\xc1;\xc2"\xc29\xc1\xd1\xc0l\xc0\xd9\xbe\xf4\xbd\x0c\xbd\x02\xbc\xd1\xb9\x8f\xb8A\xb7\x8b\xb4\xc8\xb2\x05\xb1\xec\xad\xf3\xab\x8e\xa8j\xa5\x06\xa3\xdf\x9d\xde\x9a\n\x98\x89\x91]\x8e\xbd\x8b\xb2\x88\xc5\x81h\x80D~py\x17y%{P{\x14}\'\x80\xf3\x81\xc0\x84I\x86J\x87~\x89\xfd\x89\xc4\x88\xb0\x89\x19\x89\x9b\x86\xb4\x85"\x85\xe2\x82\x1f\x82\x83\x81;\x81\x80\x82\xe3\x81\xa1\x82\xd5\x86#\x88\xb9\x87\xbc\x8b\xbc\x8c\xef\x8c\xfa\x8d\x1b\x90\xd4\x90\x91\x91\xe3\x92\x86\x93\xb7\x94\xf7\x95\xa7\x96\xd8\x97\xf0\x98\xba\x99\xb7\x9aT\x9b\xe8\x9bO\x9cT\x9c\xba\x9b6\x9b\x1f\x9a\t\x98\x8d\x96D\x94F\x92W\x8eF\x8b\x93\x88#\x83\xd9\x7f\xe6{\xdes\x9an?h\xf4`TN\xbd=\xea\'\x00\x00J\x1d;5TP\xb5Ylb\x08i\xd4r\xd4w\xba{\xb5\x81\x8e\x84!\x88\xcc\x8b\xce\x8d\xc8\x90o\x92\x0f\x94U\x96M\x97\xcd\x97I\x98^\x99\xb2\x98{\x98\xce\x98{\x97\x0e\x97\xd1\x961\x96\xe8\x94k\x94\xd1\x93\xd3\x92W\x92"\x91z\x90\xd9\x8f\x9e\x8d\xe8\x8c\x83\x8dc\x8bp\x8b&\x8d\x8f\x8d\xe7\x8c\xc8\x8f\xdb\x90 \x91q\x92\x15\x95\x9a\x95i\x96\xfa\x97\x88\x98\xe8\x98\x9a\x99\xd7\x99?\x9aF\x9a\xe0\x99"\x9a\xd4\x99\xed\x98o\x98?\x98%\x97\x84\x96\x86\x960\x96\xc8\x95\xed\x95\xf5\x95\x85\x96\xd4\x96\x8c\x97\xe4\x98\xc3\x99t\x9a>\x9b\xa6\x9c[\x9d\x14\x9e1\x9f\x0b\xa0\xab\xa0\xe4\xa1\xb4\xa2\x98\xa3\xe2\xa4j\xa5e\xa6\xea\xa6w\xa7\x04\xa8\x1d\xa8\xc3\xa7a\xa7U\xa7;\xa6\x85\xa5\xaf\xa4\xd5\xa3e\xa2\xfd\xa0\x00\xa0Y\x9eL\x9d\\\x9bh\x99@\x98K\xd3')
None

I send you the modified files if you require it:
test (2).zip

Did I missed something in my try ?

@ES-Alexander
Copy link
Contributor

Hi @Tchiimy :-)

We're happy for people to contribute extensions or new device types to the ping protocol, but manually modifying the auto-generated files (instead of the protocol and/or the template files) is not the recommended approach for doing so, and makes it hard to determine whether there's an error in your code implementation or in the way you tried to specify the messages.

I'd recommend modifying the relevant protocol definition file(s) instead (in the lib/ping-protocol/src/definitions/ folder), which in this case would be the ping1d.json file, or a new s500.json file based on the Ping1D one. If you then run the ping-python generator and it fails, we can try to help determine whether it's a definition issue or something else.

I would also note that the API docs you linked to specify the S500 supports most of the Ping1D messages, but isn't clear which messages or fields it doesn't support, which makes it harder to know whether a proposed S500 definition file is correct.

@Tchiimy
Copy link
Author

Tchiimy commented Nov 25, 2024

Hi @ES-Alexander :-)

Thanks for your answer, for the context we were mainly trying to implement the functions profile_data6t and set_ping_params from the S500 api documentation (to have access to chirp signals + more data from the pings for analysis).

We "manually modified" the definitions.py by adding:

PING1D_PROFILE6_T = 1308
PING1D_SET_PING_PARAMETERS = 1015

    PING1D_PROFILE: {
        "name": "profile",
        "format": "IHHIIIIH",
        "field_names": (
             "distance",
             "confidence",
             "transmit_duration",
             "ping_number",
             "scan_start",
             "scan_length",
             "gain_setting",
             "profile_data_length",
             "profile_data",
            ),
        "payload_length": 26
    },
    
        PING1D_PROFILE6_T: {
        "name": "profile6_t",
        "format": "IIIIIIIIfffffffBBBBH",
        "field_names": (
            "ping_number",
            "start_mm",
            "length_mm",
            "start_ping_hz",
            "end_ping_hz",
            "adc_sample_hz",
            "timestamp_msec",
            "spare2",
            "pulse_duration_sec",
            "analog_gain",
            "max_pwr_db",
            "min_pwr_db",
            "this_ping_depth_m",
            "smooth_depth_m",
            "fspare2",
            "this_ping_depth_measurement_confidence",
            "gain_index",
            "decimation",
            "smoothed_depth_measurement_confidence",
            "num_results",
            "pwr_results",
        ),
        "payload_length": 66
    },

The pingmessage.py with:
variable_msgs = [definitions.PING1D_PROFILE, definitions.PING1D_PROFILE6_T, definitions.PING360_DEVICE_DATA, ]

And the ping1d.py with:

    def get_profile6_t(self):
        if self.legacyRequest(definitions.PING1D_PROFILE6_T) is None:
            return None
        data = ({
            "ping_number": self._ping_number,                       # Units: N/A; The ping number.
            "start_mm": self._start_mm,                             # Units: mm; Start position for the ping.
            "length_mm": self._length_mm,                           # Units: mm; Length of the ping measurement.
            "start_ping_hz": self._start_ping_hz,                   # Units: Hz; Starting frequency of the ping.
            "end_ping_hz": self._end_ping_hz,                       # Units: Hz; Ending frequency of the ping.
            "adc_sample_hz": self._adc_sample_hz,                   # Units: Hz; ADC sampling frequency.
            "timestamp_msec": self._timestamp_msec,                 # Units: ms; Timestamp in milliseconds.
            "spare2": self._spare2,                                 # Units: N/A; Spare field, not used.
            "pulse_duration_sec": self._pulse_duration_sec,         # Units: sec; Duration of the pulse.
            "analog_gain": self._analog_gain,                       # Units: N/A; Gain used in the analog signal processing.
            "max_pwr_db": self._max_pwr_db,                         # Units: dB; Maximum power level measured.
            "min_pwr_db": self._min_pwr_db,                         # Units: dB; Minimum power level measured.
            "this_ping_depth_m": self._this_ping_depth_m,           # Units: m; Depth measurement for this ping.
            "smooth_depth_m": self._smooth_depth_m,                 # Units: m; Smoothed depth measurement.
            "fspare2": self._fspare2,                               # Units: N/A; Spare field, not used.
            "this_ping_depth_measurement_confidence": self._this_ping_depth_measurement_confidence,  # Units: %; Confidence in this ping's depth measurement.
            "gain_index": self._gain_index,                         # Units: N/A; Index of the gain setting used.
            "decimation": self._decimation,                         # Units: N/A; Decimation factor used.
            "smoothed_depth_measurement_confidence": self._smoothed_depth_measurement_confidence,  # Units: %; Confidence in the smoothed depth measurement.
            "num_results": self._num_results,                       # Units: N/A; Number of results returned.
            "pwr_results": self._pwr_results,                       # Units: N/A; Array of power results.
        })
        return data

    def set_ping_params(self, start_mm, length_mm, gain_index, msec_per_ping,
                        pulse_len_usec, report_id, reserved, chirp, decimation,
                        verify=True):
        # Create and pack the message
        m = pingmessage.PingMessage(definitions.PING1D_SET_PING_PARAMETERS)
        m.start_mm = start_mm
        m.length_mm = length_mm
        m.gain_index = gain_index
        m.msec_per_ping = msec_per_ping
        m.pulse_len_usec = pulse_len_usec
        m.report_id = report_id
        m.reserved = reserved
        m.chirp = chirp
        m.decimation = decimation
        m.pack_msg_data()
        
        self.write(m.msg_data)
        
        if self.legacyRequest(definitions.PING1D_SET_PING_PARAMETERS) is None:
            return False

        if (verify and (
            self._start_mm != start_mm or
            self._length_mm != length_mm or
            self._gain_index != gain_index or
            self._msec_per_ping != msec_per_ping or
            self._pulse_len_usec != pulse_len_usec or
            self._report_id != report_id or
            self._reserved != reserved or
            self._chirp != chirp or
            self._decimation != decimation)):
            return False
        
        return True  # Success

We didn't knew about the generation method, if I understood I need to add the modifications in ping1d.json and then run the src/generate-markdown.py right ? Or is it better to separate the devices and make a S500.json file instead ?

@ES-Alexander
Copy link
Contributor

We didn't knew about the generation method, if I understood I need to add the modifications in ping1d.json ... Or is it better to separate the devices and make a S500.json file instead ?

If it's just for personal use (and you know you're not going to accidentally use the S500-exclusive methods when communicating with a device which only implements the Ping1D protocol) then directly extending the Ping1D file is the simplest approach to get something that works.

If you're wanting to contribute to the ping-protocol repository and/or the ping-python library then keeping the extra messages separate makes sense, to avoid confusion over which messages each device supports. Then you'd want to make a file generate/templates/s500.py.in, with an S500 class that inherits from Ping1D and pulls in the extra S500 messages.

and then run the src/generate-markdown.py right ?

That one is for documentation of ping-protocol. In the ping-python repo the file you want to run is generate/generate-python.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants