CIDCO-dev / Poseidon

Hydrographic surveying platform operating system
MIT License
10 stars 10 forks source link

[Sonar_Imagenex_852] Data transmission fron the node #366

Closed Ddoiron-cidco closed 6 months ago

Ddoiron-cidco commented 10 months ago

Every less than a second the node transmit data to the sonar on the serial port causing the sonar to respond with the depth.

If the pps is present the Sonar is not syncronised with the PPS and the sonar ping are not tuned on a perfect 1hz

If the pps is disconnected the sonar continue to transmit the depth and are still not tuned on a perfect 1hz

I'made a small python script to test the sonar and the ability to transmit on the pps and it work well.

import serial

port = '/dev/sonar' 
baudrate = 115200  

ser = serial.Serial(port, baudrate=baudrate)
parity = serial.PARITY_NONE 
bytesize = 8  
stopbits = 1  

ser = serial.Serial(port, baudrate=baudrate, parity=parity, bytesize=bytesize, stopbits=stopbits)

try:
    init_data = bytes([0xFE, 0x44, 0x11, 0x32, 0x00, 0x00, 0x43, 0x00, 0x06, 0x00, 0x20, 0x00, 0x00, 0x00, 150, 32, 0x00, 0x00, 0x07, 0, 0, 0, 1, 0, 0, 0, 0xFD])
    ser.write(init_data)

    while True:
        response = ser.read(13) 
        print("sonar responce:", response)

finally:
    ser.close()