Hi!
I have a problem with understanding which values from profile data are distances and confidences of measurements. I obtain following data :
b'\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xbb5\x02\x11H\x8b\xbf\xba\x8drk^Ze\x9c\xd3\xfd\xfb\xd0\xb4\xb4\xc0\xc8\xda\xe3\xdd\xb6w3\x0b\x02\n\x17(6GLH:$\x0f\x03\x10+IN8\x1c\r\x12\x1e&"\x16\x0b\x03\x01\x07\x10\x12\x0e\x05\x01\x02\x06\x08\x08\x05\x03\x03\x03\x06\x0b\x0e\x11\x12\x0f\t\x04\x03\x03\x04\x03\x01\x00\x00\x01\x02\x02\x01\x00\x01\x03\x04\x05\x03\x01\x00\x00\x01\x02\x02\x00\x00\x00\x01\x03\x03\x03\x03\x03\x02\x03\x03\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
and using code in Python I convert it to decimal data:
98 39 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 98 98 53 92 120 48 50 92 120 49 49 72 92 120 56 98 92 120 98 102 92 120 98 97 92 120 56 100 114 107 94 90 101 92 120 57 99 92 120 100 51 92 120 102 100 92 120 102 98 92 120 100 48 92 120 98 52 92 120 98 52 92 120 99 48 92 120 99 56 92 120 100 97 92 120 101 51 92 120 100 100 92 120 98 54 119 51 92 120 48 98 92 120 48 50 92 110 92 120 49 55 40 54 71 76 72 58 36 92 120 48 102 92 120 48 51 92 120 49 48 43 73 78 56 92 120 49 99 92 114 92 120 49 50 92 120 49 101 38 34 92 120 49 54 92 120 48 98 92 120 48 51 92 120 48 49 92 120 48 55 92 120 49 48 92 120 49 50 92 120 48 101 92 120 48 53 92 120 48 49 92 120 48 50 92 120 48 54 92 120 48 56 92 120 48 56 92 120 48 53 92 120 48 51 92 120 48 51 92 120 48 51 92 120 48 54 92 120 48 98 92 120 48 101 92 120 49 49 92 120 49 50 92 120 48 102 92 116 92 120 48 52 92 120 48 51 92 120 48 51 92 120 48 52 92 120 48 51 92 120 48 49 92 120 48 48 92 120 48 48 92 120 48 49 92 120 48 50 92 120 48 50 92 120 48 49 92 120 48 48 92 120 48 49 92 120 48 51 92 120 48 52 92 120 48 53 92 120 48 51 92 120 48 49 92 120 48 48 92 120 48 48 92 120 48 49 92 120 48 50 92 120 48 50 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 49 92 120 48 51 92 120 48 51 92 120 48 51 92 120 48 51 92 120 48 51 92 120 48 50 92 120 48 51 92 120 48 51 92 120 48 49 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 49 92 120 48 49 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 39
My code in Python:
from brping import PingParser, PingMessage, Ping1D
import time
myPing = Ping1D() # obiekt klasy Ping1D
myMessage = PingMessage() # obiekt klasy PingMessage
myParser = PingParser() # obiekt klasy PingParser
myPing.connect_serial("COM4",115200) # poĹÄ
czenie echosondy z komputerem
#myPing.set_ping_interval(200) # ustawienie przedziaĹu czasowego pomiÄdzy pomiarami
myPing.initialize() # inicjacja pracy echosondy
myPing.set_ping_enable(1)
time.sleep(1)
predkosc = myPing.get_speed_of_sound()
print(predkosc)
myMessage = myPing.get_profile() # odczyt profilu danych
#data = myMessage.unpack_msg_data()
#myMessage = myParser.parse_byte(myMessage) # dekodowanie informacji z profilu
dystanse = str(myMessage['profile_data'])
print('\n',dystanse,'\n')
print(' '.join(str(ord(c)) for c in dystanse))
There is an option to handle this problem with brping library? If yes, please let me know by share code.