# I cannot read all the data from profile (ID:1300) response

**URL:** <https://discuss.bluerobotics.com/t/i-cannot-read-all-the-data-from-profile-id-1300-response/8658>\
**Category:** Ping Sonar Devices\
**Created:** [November 25, 2020, 6:01pm UTC](https://discuss.bluerobotics.com/t/i-cannot-read-all-the-data-from-profile-id-1300-response/8658 "2020-11-25T18:01:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kath\_04](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kath\_04](https://discuss.bluerobotics.com/u/kath_04)\
**Post date:** [November 25, 2020, 6:01pm UTC](https://discuss.bluerobotics.com/t/i-cannot-read-all-the-data-from-profile-id-1300-response/8658/1 "2020-11-25T18:01:16Z")

</div>

One year ago approximately, I have in my hand the Ping Sonar altimeter and echosounder. The sonar works just fine, I am obtaining data from it (with rasp). But, in the protocol, there is a command to obtain continuously profile data from the sonar, but when I program to do that, the sonar cannot send me the approx 267 data array, and then when I ask for information (distance ID) the sonar is no longer working. Perhaps you have a solution, I plan to obtain data value every 50 seg or even less (if its possible), without asking for the response data, that why I start to know the response data from profile message, then go to 1400 continuous\_start message. Here is the data i am sending:

```
  uint8_t* profile(){
    msgDat[0] = 'B'; //0 66dec
    msgDat[1] = 'R'; //1 82dec
    (uint16_t&)msgDat[2] = 27; // payload size ----2-3
    (uint16_t&)msgDat[4] = Profile; // id =1300
    msgDat[6] = 0; //6 ist immer 0
    msgDat[7] = 0; //7 ist immer 0
    (uint16_t&)msgDat[8] = 1; //payload
    (uint16_t&)msgDat[10] = 0; //
    (uint16_t&)msgDat[12] = 0; //
    (uint16_t&)msgDat[14] = 0; //
    (uint16_t&)msgDat[16] = 0; //
    (uint16_t&)msgDat[18] = 0; //
    (uint16_t&)msgDat[20] = 0; //
    (uint16_t&)msgDat[22] = 0; //
    (uint16_t&)msgDat[24] = 0; //
    (uint16_t&)msgDat[26] = 0; //
    (uint16_t&)msgDat[28] = 0; //
    (uint16_t&)msgDat[30] = 0; //
    (uint16_t&)msgDat[32] = 0; //
    msgDat[34] = 0; //
    (uint16_t&)msgDat[35] = checksum_num(msgDat,35);

    for(i = 0 ;i <37 ; i++){
// serialPutchar (fd, msgDat[i]) ;
        printf("%d\n",msgDat[i]);
    }
    return msgDat;
}

void update_todate(){
    send(profile(),37);
    delay(1500);
    read(107);

  // if(checksum_proof(read(36),36) != 0){
    distanc_l = memory[9]<< 8 | memory[8];
    distanc_h = memory[11]<< 8 | memory[10];
    distanc_t = distanc_h <<16 | distanc_l;
    cout << "Distancia: "<<(int)distanc_t <<" mm"<< endl;

    confidence = memory[13]<< 8 | memory[12];
    cout << "Confidencia: "<<confidence <<" %"<< endl;

    dur_transmit = memory[15]<< 8 | memory[14];
    cout << "Duracion de transmision: "<< dur_transmit <<" us"<< endl;

    pingnumber_l = memory[17]<< 8 | memory[16];
    pingnumber_h = memory[19]<< 8 | memory[18];
    pingnumber_t = pingnumber_l <<16 | pingnumber_h;
    cout << "Medicion de pulso: "<< pingnumber_t << endl;

    beginscan_l = memory[21]<< 8 | memory[20];
    beginscan_h = memory[23]<< 8 | memory[22];
    beginscan_t = beginscan_l <<16 | beginscan_h;
    cout << "Inicio de scan: "<< beginscan_t <<" mm"<< endl;

    length_scan_l = memory[25]<< 8 | memory[24];
    length_scan_h = memory[27]<< 8 | memory[26];
    length_scan = length_scan_l <<16 | length_scan_h;
    cout << "Distancia de la region de scan: "<< length_scan <<" mm"<< endl;

    gain_l = memory[29]<< 8 | memory[28];
    gain_h = memory[31]<< 8 | memory[30];
    gain = gain_l <<16 | gain_h;
    cout << "Ganancia: "<< gain << endl;

    profile_length = memory[33]<< 8 | memory[32];
    cout << "Profile data length: "<< profile_length << endl;

    profile_data = memory[34];
    cout << "Profile data: "<< profile_data << endl;

    limpiar_memoria();
   // }
   send(voltage_5v(),12);
    delay(50);
    read(12);
    volt = memory[9]<< 8 | memory[8];
        cout << "Voltaje: " << volt<< " mV"<< endl;
    limpiar_memoria();

    send(processor_temp(),12);
    delay(50);
    read(12);

    temp = memory[9]<< 8 | memory[8];
    cout << "Temp de procesador: " << temp/100.f<< " °C"<< endl;
    limpiar_memoria();

}

```

And the response is:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/b/bab26c737cce3c2da3442b3a88485d9d9b3f7568.png)

as far as I understand is that after the 0x00 from response[07], the payload it seems 226 (does is the actual data that I am going to read?), also, as you see in the code I processed the data received but when I ask again for voltage\_5v and temperature, there is no coherent response from the sonar.

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [November 30, 2020, 12:42pm UTC](https://discuss.bluerobotics.com/t/i-cannot-read-all-the-data-from-profile-id-1300-response/8658/2 "2020-11-30T12:42:48Z")

</div>

Hi @kath_04,

Please use our ping-protocol library for Arduino.

Guide:

> **[Using the Ping Sonar with an Arduino](https://bluerobotics.com/learn/using-the-ping-sonar-with-an-arduino/)**
>
> This guide teaches you how to connect the Ping Echosounder sonar with an Arduino to measure distances underwater. It can be used the make a basic fishfinder, boat depth sensor, and for ROV and robotics projects.

---

<div class="post-metadata">

**Author:** ![kath\_04](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kath\_04](https://discuss.bluerobotics.com/u/kath_04)\
**Post date:** [December 10, 2020, 4:43pm UTC](https://discuss.bluerobotics.com/t/i-cannot-read-all-the-data-from-profile-id-1300-response/8658/3 "2020-12-10T16:43:09Z")

</div>

Yeah, I have read it, my code is based on the Arduino library. But, there is still this issue when I run it.

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [December 11, 2020, 6:07pm UTC](https://discuss.bluerobotics.com/t/i-cannot-read-all-the-data-from-profile-id-1300-response/8658/4 "2020-12-11T18:07:46Z")

</div>

Hi,

Can you share a minimum version of your code that replicates the problem ?
